Skip to main content

BinaryLandmarkIndex

Struct BinaryLandmarkIndex 

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

A map’s landmarks with their binary descriptors packed for matching.

Implementations§

Source§

impl BinaryLandmarkIndex

Source

pub fn new(map: &VisualMap, store: &LandmarkDescriptorStore) -> Self

Indexes every landmark of map that has a descriptor in store, in landmark-id order. Descriptors whose length differs from the first one never match.

Source

pub fn with_extra_descriptors<D: AsRef<[f32]>>( self, rows: &[(LandmarkId, D)], max_per_landmark: usize, ) -> Self

Adds extra descriptors, (landmark id, descriptor) rows with ids repeated freely, at most max_per_landmark per landmark in the order given; rows of landmarks not indexed are skipped. Replaces any extra descriptors added before.

Source

pub fn extra_descriptor_count(&self) -> usize

Number of extra descriptors indexed.

Source

pub fn with_duplicate_radius(self, radius_m: f64) -> Self

Makes the ratio test of Self::match_all treat landmarks within radius_m of the best one as the same point: the second-best distance is that of the best landmark farther away. See the module documentation. radius_m <= 0 turns it off.

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub const fn dimension(&self) -> usize

Descriptor length of the indexed landmarks.

Source

pub fn pack_query<D: AsRef<[f32]>>( &self, descriptors: &[D], ) -> PackedDescriptors

Packs query descriptors for Self::match_all / Self::match_projected.

Source

pub fn match_all( &self, keypoints: &[Point2<f64>], query: &PackedDescriptors, gates: BinaryMatchGates, threads: usize, ) -> CorrespondenceSet

Appearance-only matching: every query descriptor against every landmark, split over up to threads threads. Without a duplicate radius, the same correspondences, in the same order, as CorrespondenceBuilder with a HammingMatcher of the same gates: one per accepted keypoint, several keypoints may share a landmark.

Source

pub fn match_among( &self, keypoints: &[Point2<f64>], query: &PackedDescriptors, gates: BinaryMatchGates, landmarks: &[usize], ) -> CorrespondenceSet

Self::match_all restricted to the landmarks at landmarks (indices into this index, e.g. from KeyframeRetrieval): each keypoint’s ratio test then weighs only those landmarks against each other.

Source

pub fn landmark_index(&self, id: LandmarkId) -> Option<usize>

Index of landmark id in this index, if it has a descriptor.

Source

pub fn match_projected( &self, camera: &Camera, pose_prior: &Pose, keypoints: &[Point2<f64>], query: &PackedDescriptors, radius_px: f64, gates: BinaryMatchGates, ) -> CorrespondenceSet

Projection-guided matching: each landmark is projected with pose_prior and its descriptors (the nearest of them) compared only with the keypoints within radius_px of the projection (best and second best among them, gated by gates); overlapping windows are then resolved one-to-one, lowest distance first. The same correspondences as ProjectionCorrespondenceBuilder::build_with_pose_prior with a HammingMatcher of the same gates, except that landmarks behind the camera (z <= 0) are skipped before projecting.

Trait Implementations§

Source§

impl Clone for BinaryLandmarkIndex

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 BinaryLandmarkIndex

Source§

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

Formats the value using the given formatter. 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> 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V