Skip to main content

LocalizationPipeline

Struct LocalizationPipeline 

Source
pub struct LocalizationPipeline<M = BruteForceMatcher, S = AllLandmarksSelector, E = PnPRansac<PnpMinimalSolver>> {
    pub matcher: M,
    pub candidate_selector: S,
    pub pose_estimator: E,
    pub config: LocalizationConfig,
}

Fields§

§matcher: M§candidate_selector: S§pose_estimator: E§config: LocalizationConfig

Implementations§

Source§

impl<M> LocalizationPipeline<M>
where M: Matcher + Clone,

Source

pub fn new(matcher: M, config: LocalizationConfig) -> LocalizationPipeline<M>

Source§

impl<M, S> LocalizationPipeline<M, S>

Source

pub fn with_candidate_selector( matcher: M, candidate_selector: S, config: LocalizationConfig, ) -> LocalizationPipeline<M, S>

Source§

impl<M, S> LocalizationPipeline<M, S>

Source

pub fn set_pnp_solver(&mut self, solver: PnpMinimalSolver)

Switches the RANSAC minimal solver (and LocalizationConfig::pnp_solver with it) on a built pipeline, e.g. to PnpMinimalSolver::P3p for a map dominated by walls.

Source

pub fn with_pnp_solver( self, solver: PnpMinimalSolver, ) -> LocalizationPipeline<M, S>

Builder form of Self::set_pnp_solver.

Source§

impl<M, S, E> LocalizationPipeline<M, S, E>

Source

pub const fn with_pose_estimator( matcher: M, candidate_selector: S, pose_estimator: E, config: LocalizationConfig, ) -> LocalizationPipeline<M, S, E>

Source

pub fn localize( &self, query: &QueryImage, map: &VisualMap, ) -> LocalizationResult

Source

pub fn localize_with_provider<P>( &self, query: &QueryImage, provider: &P, ) -> LocalizationResult

Source

pub fn localize_image_with_extractor<X>( &self, image: &<X as FeatureExtractor>::Image, camera: Camera, map: &VisualMap, extractor: &X, ) -> Result<LocalizationResult, <X as FeatureExtractor>::Error>

Source

pub fn localize_image_with_extractor_and_provider<X, P>( &self, image: &<X as FeatureExtractor>::Image, camera: Camera, provider: &P, extractor: &X, ) -> Result<LocalizationResult, <X as FeatureExtractor>::Error>

Source

pub fn localize_image_with_extractor_and_descriptor_store<X>( &self, image: &<X as FeatureExtractor>::Image, camera: Camera, map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, extractor: &X, ) -> Result<LocalizationResult, <X as FeatureExtractor>::Error>

Source

pub fn localize_frame( &self, frame: &Frame, map: &VisualMap, ) -> LocalizationResult

Source

pub fn localize_frame_with_provider<P>( &self, frame: &Frame, provider: &P, ) -> LocalizationResult

Source

pub fn localize_frame_image_with_extractor<X>( &self, frame_id: u64, camera_id: u64, image: &<X as FeatureExtractor>::Image, map: &VisualMap, extractor: &X, ) -> Result<FrameLocalizationResult, <X as FeatureExtractor>::Error>

Source

pub fn localize_frame_image_with_extractor_and_provider<X, P>( &self, frame_id: u64, camera_id: u64, image: &<X as FeatureExtractor>::Image, provider: &P, extractor: &X, ) -> Result<FrameLocalizationResult, <X as FeatureExtractor>::Error>

Source

pub fn localize_frame_image_with_extractor_and_descriptor_store<X>( &self, frame_id: u64, camera_id: u64, image: &<X as FeatureExtractor>::Image, map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, extractor: &X, ) -> Result<FrameLocalizationResult, <X as FeatureExtractor>::Error>

Source

pub fn localize_frames( &self, frames: &[Frame], map: &VisualMap, ) -> Vec<FrameLocalizationResult>

Source

pub fn localize_frame_with_descriptor_store( &self, frame: &Frame, map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, ) -> LocalizationResult

Source

pub fn localize_frame_with_candidate_selector_and_descriptor_store<S2>( &self, frame: &Frame, map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, candidate_selector: S2, ) -> LocalizationResult

Source

pub fn localize_frames_with_descriptor_store( &self, frames: &[Frame], map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, ) -> Vec<FrameLocalizationResult>

Source

pub fn localize_with_candidate_selector_and_descriptor_store<S2>( &self, query: &QueryImage, map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, candidate_selector: S2, ) -> LocalizationResult

Source

pub fn localize_with_candidate_selector_and_descriptor_store_and_pose_prior<S2>( &self, query: &QueryImage, map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, candidate_selector: S2, pose_prior: Option<&Pose>, ) -> LocalizationResult

Source

pub fn localize_with_descriptor_store( &self, query: &QueryImage, map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, ) -> LocalizationResult

Source

pub fn localize_frame_with_projection_window_and_descriptor_store( &self, frame: &Frame, map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, pose_prior: &Pose, candidate_radius: Option<f64>, search_radius_px: f64, ) -> LocalizationResult

ORB-SLAM3-style projection-guided variant of [Self::localize_frame_with_pose_prior_and_descriptor_store]: instead of an appearance-global descriptor search restricted to a radius candidate set, each candidate landmark is projected into the frame with pose_prior and matched only against query keypoints within search_radius_px pixels of the projection (see ProjectionCorrespondenceBuilder). Falls through to the existing pose-estimation-and-quality-gate path unchanged.

Source

pub fn localize_frame_with_projection_window_descriptor_store_and_query_landmark_ratio( &self, frame: &Frame, map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, pose_prior: &Pose, candidate_radius: Option<f64>, search_radius_px: f64, max_query_landmark_distance_ratio: Option<f32>, ) -> LocalizationResult

Source

pub fn localize_with_projection_window_and_descriptor_store<S2>( &self, query: &QueryImage, map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, candidate_selector: S2, pose_prior: &Pose, search_radius_px: f64, ) -> LocalizationResult

Source

pub fn localize_with_projection_window_descriptor_store_and_query_landmark_ratio<S2>( &self, query: &QueryImage, map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, candidate_selector: S2, pose_prior: &Pose, search_radius_px: f64, max_query_landmark_distance_ratio: Option<f32>, ) -> LocalizationResult

Source

pub fn refine_frame_pose_with_local_map_and_descriptor_store( &self, frame: &Frame, map: &VisualMap, local_map_descriptor_store: &LandmarkDescriptorStore, estimated: &LocalizationResult, refinement_search_radius_px: f64, ) -> Option<LocalizationResult>

Stage-3 local-map refinement: given an already-successful estimated localization for frame, project local_map_descriptor_store’s landmarks with the ESTIMATED pose, harvest additional correspondences within refinement_search_radius_px, and re-run pose estimation over the union with estimated’s own inlier correspondences (duplicates by landmark id are dropped, preferring the already-known-good inlier entry). Returns None when estimated carries no pose or the combined correspondence set is too small for the estimator to run; callers are responsible for accept/reject decisions (this method does not compare inlier counts against estimated).

Source

pub fn revise_frame_pose_with_local_map_and_descriptor_store( &self, frame: &Frame, map: &VisualMap, local_map_descriptor_store: &LandmarkDescriptorStore, estimated: &LocalizationResult, refinement_search_radius_px: f64, ) -> Option<LocalizationResult>

DROID-style correspondence-revision primitive for the sparse tracker: discard the previous 2D-3D assignment, project the local map with the latest pose, rebuild a fresh one-to-one correspondence set, and solve PnP again. Repeating this operation alternates correspondence and pose updates while preserving the existing robust estimator and quality gate. Unlike Self::refine_frame_pose_with_local_map_and_descriptor_store, query keypoints may switch to a different landmark between iterations.

Source

pub fn localize_correspondences( &self, camera: &Camera, correspondence_set: CorrespondenceSet, ) -> LocalizationResult

Pose estimation and quality gate over correspondences built outside the pipeline, e.g. by BinaryLandmarkIndex: the same tail as every localize_* method, so results are gated identically.

Source

pub fn localize_with_unknown_focal( &self, query: &QueryImage, map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, focal_config: &P4PfRansacConfig, ) -> UnknownFocalLocalization

Localize a query whose focal length is unknown, such as a photo with no EXIF or a cropped one: the 2D-3D correspondences are built as in Self::localize_with_descriptor_store, P4Pf RANSAC (estimate_pose_with_focal) estimates the focal length from them, and the configured pose estimator and quality gate then run with that focal length, so the result is gated exactly like the known-focal path.

The focal length in query.camera is ignored; its size and principal point (cx, cy, or the image centre when it has no pinhole intrinsics) are kept. Assumes square pixels and no lens distortion.

Trait Implementations§

Source§

impl<M, S, E> Clone for LocalizationPipeline<M, S, E>
where M: Clone, S: Clone, E: Clone,

Source§

fn clone(&self) -> LocalizationPipeline<M, S, E>

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<M, S, E> Debug for LocalizationPipeline<M, S, E>
where M: Debug, S: Debug, E: Debug,

Source§

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

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

impl Default for LocalizationPipeline

Source§

fn default() -> LocalizationPipeline

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

impl<M, S, E> FrameLocalizer for LocalizationPipeline<M, S, E>

Source§

fn localize_frame_with_descriptor_store( &self, frame: &Frame, map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, ) -> LocalizationResult

Source§

fn localize_frame_with_pose_prior_and_descriptor_store( &self, frame: &Frame, map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, pose_prior: Option<&Pose>, candidate_radius: Option<f64>, ) -> LocalizationResult

Source§

fn localize_frame_with_pose_prior_warm_start_and_descriptor_store( &self, frame: &Frame, map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, pose_prior: Option<&Pose>, candidate_radius: Option<f64>, ) -> LocalizationResult

Variant that, in addition to the radius candidate filter, ALSO threads the pose prior into the PnP RANSAC as a warm-start hypothesis. Default impl falls back to the non-warm-start variant so existing implementors don’t need to change.
Source§

fn localize_frame_with_projection_window_and_descriptor_store( &self, frame: &Frame, map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, pose_prior: &Pose, candidate_radius: Option<f64>, search_radius_px: f64, ) -> LocalizationResult

ORB-SLAM3-style projection-guided variant: for each candidate landmark, project it into the frame with pose_prior and match its descriptor only against query keypoints within search_radius_px of the projection (rather than an appearance-global search over the whole candidate set). Default implementation ignores the projection window and falls back to the appearance-global _pose_prior_and_descriptor_store variant, so a FrameLocalizer implementor that hasn’t opted in still produces a (non-projection) result the tracker’s widen-retry ladder can fall through to.
Source§

fn localize_frame_with_projection_window_descriptor_store_and_query_landmark_ratio( &self, frame: &Frame, map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, pose_prior: &Pose, candidate_radius: Option<f64>, search_radius_px: f64, max_query_landmark_distance_ratio: Option<f32>, ) -> LocalizationResult

Projection-guided localization with an additional reverse query-keypoint -> landmark ambiguity ratio. Implementors without a specialized path retain the projection/default behavior above.
Source§

fn refine_pose_with_local_map_and_descriptor_store( &self, frame: &Frame, map: &VisualMap, local_map_descriptor_store: &LandmarkDescriptorStore, estimated: &LocalizationResult, refinement_search_radius_px: f64, ) -> Option<LocalizationResult>

Stage-3 local-map refinement: given an already-successful estimated localization, project local_map_descriptor_store’s landmarks with the ESTIMATED pose and harvest additional correspondences within refinement_search_radius_px, then re-run pose estimation over the union with estimated’s inliers. Returns None when the implementor doesn’t support refinement (default) or no usable correspondences could be harvested; callers (see Tracker) independently gate acceptance on inlier count, since this method does not compare against estimated itself.
Source§

fn revise_pose_with_local_map_and_descriptor_store( &self, frame: &Frame, map: &VisualMap, local_map_descriptor_store: &LandmarkDescriptorStore, estimated: &LocalizationResult, refinement_search_radius_px: f64, ) -> Option<LocalizationResult>

Rebuild projection-guided correspondences from scratch around the latest pose so 2D keypoints can change landmark assignment between rounds. Implementors without a specialized revision path retain the conservative refinement behavior.

Auto Trait Implementations§

§

impl<M, S, E> Forget for LocalizationPipeline<M, S, E>

§

impl<M, S, E> Freeze for LocalizationPipeline<M, S, E>
where M: Freeze, S: Freeze, E: Freeze,

§

impl<M, S, E> Move for LocalizationPipeline<M, S, E>

§

impl<M, S, E> RefUnwindSafe for LocalizationPipeline<M, S, E>

§

impl<M, S, E> Send for LocalizationPipeline<M, S, E>
where E: Send, S: Send, M: Send,

§

impl<M, S, E> Sync for LocalizationPipeline<M, S, E>
where E: Sync, S: Sync, M: Sync,

§

impl<M, S, E> Unpin for LocalizationPipeline<M, S, E>
where E: Unpin, S: Unpin, M: Unpin,

§

impl<M, S, E> UnsafeUnpin for LocalizationPipeline<M, S, E>

§

impl<M, S, E> UnwindSafe for LocalizationPipeline<M, S, E>
where M: UnwindSafe, S: UnwindSafe, E: UnwindSafe,

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.
Source§

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

Source§

fn vzip(self) -> V