pairs
pairs
#
Which images to compare: every pair, a sliding window, or the neighbours of known poses.
Matching costs a pair at a time, so the choice of pairs is the choice of how
long a reconstruction takes. exhaustive_pairs compares everything;
sequential_pairs compares each image with the next few, as a video
walks; nearby_pairs uses prior poses to compare only cameras that stand
close and look the same way — the optional-positions guidance, which also
takes sparse priors and falls back to the sequential walk where there is none.
dense_pairs(poses, neighbors=32, max_distance_meters=50.0, max_angle_degrees=90.0)
#
nearby_pairs over a prior pose for every image; see there.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
poses
|
Array[Pose]
|
The prior pose of every image, in image order. |
required |
neighbors
|
int
|
How many neighbours each pose keeps at most. |
32
|
max_distance_meters
|
float
|
The furthest a neighbour's centre may be. |
50.0
|
max_angle_degrees
|
float
|
The widest angle between two optical axes. |
90.0
|
Source code in capturegraph-recipes/capturegraph_recipes/sfm/correspondence/pairs.py
exhaustive_pairs(count)
#
Every pair of count images.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
count
|
int
|
How many images there are. |
required |
Source code in capturegraph-recipes/capturegraph_recipes/sfm/correspondence/pairs.py
nearby_pairs(poses, count=None, neighbors=32, max_distance_meters=50.0, max_angle_degrees=90.0)
#
Each pose paired with its nearest neighbours that look roughly the same way.
Neighbours are ranked by the distance between camera centres; one further
than max_distance_meters, or whose optical axis turns more than
max_angle_degrees from the pose's own, is passed over. Priors may be
sparse — a Map keyed by image index, as exif_priors gives — in
which case the images with a prior pair among themselves by distance and
every image without one pairs with the neighbors images on either
side of it in index order, as a burst walks. The two cases are the
memoized dense_pairs and sparse_pairs; this is their one door.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
poses
|
Array[Pose] | Map[String, Pose]
|
The prior pose of every image in image order, or of some
images keyed by array position, as |
required |
count
|
int | None
|
How many images there are; required with a |
None
|
neighbors
|
int
|
How many neighbours each pose keeps at most, and the index window of an image without a prior. |
32
|
max_distance_meters
|
float
|
The furthest a neighbour's centre may be. |
50.0
|
max_angle_degrees
|
float
|
The widest angle between two optical axes. |
90.0
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in capturegraph-recipes/capturegraph_recipes/sfm/correspondence/pairs.py
sequential_pairs(count, window=10)
#
Each of count images paired with the window that follow it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
count
|
int
|
How many images there are. |
required |
window
|
int
|
How many later images each image is compared with. |
10
|
Source code in capturegraph-recipes/capturegraph_recipes/sfm/correspondence/pairs.py
sparse_pairs(poses, count, neighbors=32, max_distance_meters=50.0, max_angle_degrees=90.0)
#
nearby_pairs over priors some images have; see there.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
poses
|
Map[String, Pose]
|
A prior pose per image, keyed by array position. |
required |
count
|
int
|
How many images there are. |
required |
neighbors
|
int
|
How many neighbours a posed image keeps at most, and the index window of an image without a prior. |
32
|
max_distance_meters
|
float
|
The furthest a neighbour's centre may be. |
50.0
|
max_angle_degrees
|
float
|
The widest angle between two optical axes. |
90.0
|