pub struct MatchGraph { /* private fields */ }Expand description
Correspondence graph.
Implementations§
Source§impl MatchGraph
impl MatchGraph
Sourcepub fn add_image(&mut self, image_id: ImageId, num_points2d: usize)
pub fn add_image(&mut self, image_id: ImageId, num_points2d: usize)
Adds a node (an empty correspondence list per 2D point). Ignored if it already exists.
Sourcepub fn exists_image(&self, image_id: ImageId) -> bool
pub fn exists_image(&self, image_id: ImageId) -> bool
Whether the image node exists.
Sourcepub fn num_images(&self) -> usize
pub fn num_images(&self) -> usize
Number of image nodes.
Sourcepub fn pair_count(&self) -> usize
pub fn pair_count(&self) -> usize
Number of pairs.
Sourcepub fn num_points2d(&self, image_id: ImageId) -> usize
pub fn num_points2d(&self, image_id: ImageId) -> usize
Number of 2D points of the image.
Sourcepub fn observation_count_of(&self, image_id: ImageId) -> usize
pub fn observation_count_of(&self, image_id: ImageId) -> usize
Number of 2D points with at least one correspondence.
Sourcepub fn match_count_of(&self, image_id: ImageId) -> usize
pub fn match_count_of(&self, image_id: ImageId) -> usize
Sum of match counts of the pairs the image belongs to.
Sourcepub fn match_count_between(&self, id1: ImageId, id2: ImageId) -> usize
pub fn match_count_between(&self, id1: ImageId, id2: ImageId) -> usize
Number of matches between two images.
Sourcepub fn exists_image_pair(&self, id1: ImageId, id2: ImageId) -> bool
pub fn exists_image_pair(&self, id1: ImageId, id2: ImageId) -> bool
Whether a pair exists between two images.
Sourcepub fn image_pairs(&self) -> Vec<(PairId, usize)>
pub fn image_pairs(&self) -> Vec<(PairId, usize)>
(pair id, match count), ascending by pair id.
Sourcepub fn insert_two_view(
&mut self,
id1: ImageId,
id2: ImageId,
tvg: &TwoViewGeometry,
) -> AddPairStats
pub fn insert_two_view( &mut self, id1: ImageId, id2: ImageId, tvg: &TwoViewGeometry, ) -> AddPairStats
Adds a pair. Matches are (index in id1, index in id2). Both image nodes must exist (otherwise nothing happens). Geometry is stored in the smaller id -> larger id direction.
Sourcepub fn from_store(store: &FeatureStore, opts: &MatchGraphOptions) -> Self
pub fn from_store(store: &FeatureStore, opts: &MatchGraphOptions) -> Self
Builds from a store.
Sourcepub fn update_from_store(
&mut self,
store: &FeatureStore,
opts: &MatchGraphOptions,
) -> usize
pub fn update_from_store( &mut self, store: &FeatureStore, opts: &MatchGraphOptions, ) -> usize
Applies only the pairs newly recorded in the store (incremental). Also adds new image nodes if needed. Returns: the number of newly added pairs.
Sourcepub fn find_correspondences(
&self,
image_id: ImageId,
point2d_idx: Point2DIdx,
) -> &[Correspondence]
pub fn find_correspondences( &self, image_id: ImageId, point2d_idx: Point2DIdx, ) -> &[Correspondence]
Direct correspondences of (image, 2D point).
Sourcepub fn has_correspondences(
&self,
image_id: ImageId,
point2d_idx: Point2DIdx,
) -> bool
pub fn has_correspondences( &self, image_id: ImageId, point2d_idx: Point2DIdx, ) -> bool
Whether (image, 2D point) has a correspondence.
Sourcepub fn in_two_view_track(
&self,
image_id: ImageId,
point2d_idx: Point2DIdx,
) -> bool
pub fn in_two_view_track( &self, image_id: ImageId, point2d_idx: Point2DIdx, ) -> bool
Two-view observation: exactly 1 correspondence and the other side also has exactly 1.
Sourcepub fn matches_between(&self, id1: ImageId, id2: ImageId) -> Vec<FeatureMatch>
pub fn matches_between(&self, id1: ImageId, id2: ImageId) -> Vec<FeatureMatch>
Matches between two images: ascending by image 1 2D point.
Sourcepub fn transitive_matches(
&self,
image_id: ImageId,
point2d_idx: Point2DIdx,
depth: usize,
) -> Vec<Correspondence>
pub fn transitive_matches( &self, image_id: ImageId, point2d_idx: Point2DIdx, depth: usize, ) -> Vec<Correspondence>
Transitive correspondences (breadth-first, depth t). The starting observation and already-seen observations are excluded.
Sourcepub fn two_view_geometry(
&self,
id1: ImageId,
id2: ImageId,
) -> Option<TwoViewGeometry>
pub fn two_view_geometry( &self, id1: ImageId, id2: ImageId, ) -> Option<TwoViewGeometry>
Two-view geometry in the (id1 -> id2) direction (inliers excluded).
Sourcepub fn replace_two_view(
&mut self,
id1: ImageId,
id2: ImageId,
tvg: &TwoViewGeometry,
) -> bool
pub fn replace_two_view( &mut self, id1: ImageId, id2: ImageId, tvg: &TwoViewGeometry, ) -> bool
Updates with the geometry in the (id1 -> id2) direction.
Sourcepub fn union_find_tracks<F>(&self, pair_filter: F) -> Vec<Vec<Correspondence>>
pub fn union_find_tracks<F>(&self, pair_filter: F) -> Vec<Vec<Correspondence>>
Union-find tracks (connected components). Only pairs for which pair_filter(smaller id, larger id) is true are used.
Each component is ascending by (image, point); the component list is ascending by first element. There are no length-1 components.
Trait Implementations§
Source§impl Clone for MatchGraph
impl Clone for MatchGraph
Source§impl Debug for MatchGraph
impl Debug for MatchGraph
Auto Trait Implementations§
impl Freeze for MatchGraph
impl RefUnwindSafe for MatchGraph
impl Send for MatchGraph
impl Sync for MatchGraph
impl Unpin for MatchGraph
impl UnsafeUnpin for MatchGraph
impl UnwindSafe for MatchGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.