pub struct BinaryLandmarkIndex { /* private fields */ }Expand description
A map’s landmarks with their binary descriptors packed for matching.
Implementations§
Source§impl BinaryLandmarkIndex
impl BinaryLandmarkIndex
Sourcepub fn new(map: &VisualMap, store: &LandmarkDescriptorStore) -> Self
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.
Sourcepub fn with_extra_descriptors<D: AsRef<[f32]>>(
self,
rows: &[(LandmarkId, D)],
max_per_landmark: usize,
) -> Self
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.
Sourcepub fn extra_descriptor_count(&self) -> usize
pub fn extra_descriptor_count(&self) -> usize
Number of extra descriptors indexed.
Sourcepub fn with_duplicate_radius(self, radius_m: f64) -> Self
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.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn pack_query<D: AsRef<[f32]>>(
&self,
descriptors: &[D],
) -> PackedDescriptors
pub fn pack_query<D: AsRef<[f32]>>( &self, descriptors: &[D], ) -> PackedDescriptors
Packs query descriptors for Self::match_all /
Self::match_projected.
Sourcepub fn match_all(
&self,
keypoints: &[Point2<f64>],
query: &PackedDescriptors,
gates: BinaryMatchGates,
threads: usize,
) -> CorrespondenceSet
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.
Sourcepub fn match_among(
&self,
keypoints: &[Point2<f64>],
query: &PackedDescriptors,
gates: BinaryMatchGates,
landmarks: &[usize],
) -> CorrespondenceSet
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.
Sourcepub fn landmark_index(&self, id: LandmarkId) -> Option<usize>
pub fn landmark_index(&self, id: LandmarkId) -> Option<usize>
Index of landmark id in this index, if it has a descriptor.
Sourcepub fn match_projected(
&self,
camera: &Camera,
pose_prior: &Pose,
keypoints: &[Point2<f64>],
query: &PackedDescriptors,
radius_px: f64,
gates: BinaryMatchGates,
) -> CorrespondenceSet
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
impl Clone for BinaryLandmarkIndex
Auto Trait Implementations§
impl Forget for BinaryLandmarkIndex
impl Freeze for BinaryLandmarkIndex
impl Move for BinaryLandmarkIndex
impl RefUnwindSafe for BinaryLandmarkIndex
impl Send for BinaryLandmarkIndex
impl Sync for BinaryLandmarkIndex
impl Unpin for BinaryLandmarkIndex
impl UnsafeUnpin for BinaryLandmarkIndex
impl UnwindSafe for BinaryLandmarkIndex
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<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.