Skip to main content

MatchGraph

Struct MatchGraph 

Source
pub struct MatchGraph { /* private fields */ }
Expand description

Correspondence graph.

Implementations§

Source§

impl MatchGraph

Source

pub fn new() -> Self

Empty graph.

Source

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.

Source

pub fn exists_image(&self, image_id: ImageId) -> bool

Whether the image node exists.

Source

pub fn num_images(&self) -> usize

Number of image nodes.

Source

pub fn pair_count(&self) -> usize

Number of pairs.

Source

pub fn image_ids(&self) -> Vec<ImageId> ⓘ

List of image ids (ascending).

Source

pub fn num_points2d(&self, image_id: ImageId) -> usize

Number of 2D points of the image.

Source

pub fn observation_count_of(&self, image_id: ImageId) -> usize

Number of 2D points with at least one correspondence.

Source

pub fn match_count_of(&self, image_id: ImageId) -> usize

Sum of match counts of the pairs the image belongs to.

Source

pub fn match_count_between(&self, id1: ImageId, id2: ImageId) -> usize

Number of matches between two images.

Source

pub fn exists_image_pair(&self, id1: ImageId, id2: ImageId) -> bool

Whether a pair exists between two images.

Source

pub fn image_pairs(&self) -> Vec<(PairId, usize)>

(pair id, match count), ascending by pair id.

Source

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.

Source

pub fn from_store(store: &FeatureStore, opts: &MatchGraphOptions) -> Self

Builds from a store.

Source

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.

Source

pub fn find_correspondences( &self, image_id: ImageId, point2d_idx: Point2DIdx, ) -> &[Correspondence]

Direct correspondences of (image, 2D point).

Source

pub fn has_correspondences( &self, image_id: ImageId, point2d_idx: Point2DIdx, ) -> bool

Whether (image, 2D point) has a correspondence.

Source

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.

Source

pub fn matches_between(&self, id1: ImageId, id2: ImageId) -> Vec<FeatureMatch>

Matches between two images: ascending by image 1 2D point.

Source

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.

Source

pub fn two_view_geometry( &self, id1: ImageId, id2: ImageId, ) -> Option<TwoViewGeometry>

Two-view geometry in the (id1 -> id2) direction (inliers excluded).

Source

pub fn replace_two_view( &mut self, id1: ImageId, id2: ImageId, tvg: &TwoViewGeometry, ) -> bool

Updates with the geometry in the (id1 -> id2) direction.

Source

pub fn union_find_tracks<F>(&self, pair_filter: F) -> Vec<Vec<Correspondence>>
where F: Fn(ImageId, ImageId) -> bool,

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MatchGraph

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MatchGraph

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.