pub struct LocalizationPipeline<M = BruteForceMatcher, S = AllLandmarksSelector, E = LocalizationRansac> {
pub matcher: M,
pub candidate_selector: S,
pub pose_estimator: E,
pub config: LocalizationConfig,
}Fields§
§matcher: M§candidate_selector: S§pose_estimator: E§config: LocalizationConfigImplementations§
Source§impl<M> LocalizationPipeline<M, AllLandmarksSelector, LocalizationRansac>
impl<M> LocalizationPipeline<M, AllLandmarksSelector, LocalizationRansac>
pub fn new(matcher: M, config: LocalizationConfig) -> Self
Source§impl<M, S> LocalizationPipeline<M, S, LocalizationRansac>
impl<M, S> LocalizationPipeline<M, S, LocalizationRansac>
pub fn with_candidate_selector( matcher: M, candidate_selector: S, config: LocalizationConfig, ) -> Self
Source§impl<M, S> LocalizationPipeline<M, S, LocalizationRansac>
impl<M, S> LocalizationPipeline<M, S, LocalizationRansac>
Sourcepub fn set_pnp_solver(&mut self, solver: PnpMinimalSolver)
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.
Sourcepub fn with_pnp_solver(self, solver: PnpMinimalSolver) -> Self
pub fn with_pnp_solver(self, solver: PnpMinimalSolver) -> Self
Builder form of Self::set_pnp_solver.
Source§impl<M, S, E> LocalizationPipeline<M, S, E>
impl<M, S, E> LocalizationPipeline<M, S, E>
pub const fn with_pose_estimator( matcher: M, candidate_selector: S, pose_estimator: E, config: LocalizationConfig, ) -> Self
pub fn localize( &self, query: &QueryImage, map: &VisualMap, ) -> LocalizationResult
pub fn localize_with_provider<P>(
&self,
query: &QueryImage,
provider: &P,
) -> LocalizationResultwhere
P: MapProvider + DescriptorProvider,
pub fn localize_image_with_extractor<X>(
&self,
image: &X::Image,
camera: Camera,
map: &VisualMap,
extractor: &X,
) -> Result<LocalizationResult, X::Error>where
X: FeatureExtractor,
pub fn localize_image_with_extractor_and_provider<X, P>( &self, image: &X::Image, camera: Camera, provider: &P, extractor: &X, ) -> Result<LocalizationResult, X::Error>
pub fn localize_image_with_extractor_and_descriptor_store<X>(
&self,
image: &X::Image,
camera: Camera,
map: &VisualMap,
descriptor_store: &LandmarkDescriptorStore,
extractor: &X,
) -> Result<LocalizationResult, X::Error>where
X: FeatureExtractor,
pub fn localize_frame( &self, frame: &Frame, map: &VisualMap, ) -> LocalizationResult
pub fn localize_frame_with_provider<P>(
&self,
frame: &Frame,
provider: &P,
) -> LocalizationResultwhere
P: MapProvider + DescriptorProvider,
pub fn localize_frame_image_with_extractor<X>(
&self,
frame_id: FrameId,
camera_id: CameraId,
image: &X::Image,
map: &VisualMap,
extractor: &X,
) -> Result<FrameLocalizationResult, X::Error>where
X: FeatureExtractor,
pub fn localize_frame_image_with_extractor_and_provider<X, P>( &self, frame_id: FrameId, camera_id: CameraId, image: &X::Image, provider: &P, extractor: &X, ) -> Result<FrameLocalizationResult, X::Error>
pub fn localize_frame_image_with_extractor_and_descriptor_store<X>(
&self,
frame_id: FrameId,
camera_id: CameraId,
image: &X::Image,
map: &VisualMap,
descriptor_store: &LandmarkDescriptorStore,
extractor: &X,
) -> Result<FrameLocalizationResult, X::Error>where
X: FeatureExtractor,
pub fn localize_frames( &self, frames: &[Frame], map: &VisualMap, ) -> Vec<FrameLocalizationResult>
pub fn localize_frame_with_descriptor_store( &self, frame: &Frame, map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, ) -> LocalizationResult
pub fn localize_frame_with_candidate_selector_and_descriptor_store<S2>(
&self,
frame: &Frame,
map: &VisualMap,
descriptor_store: &LandmarkDescriptorStore,
candidate_selector: S2,
) -> LocalizationResultwhere
S2: CandidateSelector + Clone,
pub fn localize_frames_with_descriptor_store( &self, frames: &[Frame], map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, ) -> Vec<FrameLocalizationResult>
pub fn localize_with_candidate_selector_and_descriptor_store<S2>(
&self,
query: &QueryImage,
map: &VisualMap,
descriptor_store: &LandmarkDescriptorStore,
candidate_selector: S2,
) -> LocalizationResultwhere
S2: CandidateSelector + Clone,
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>,
) -> LocalizationResultwhere
S2: CandidateSelector + Clone,
pub fn localize_with_descriptor_store( &self, query: &QueryImage, map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, ) -> LocalizationResult
Sourcepub 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
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.
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
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,
) -> LocalizationResultwhere
S2: CandidateSelector + Clone,
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>,
) -> LocalizationResultwhere
S2: CandidateSelector + Clone,
Sourcepub 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>
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).
Sourcepub 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>
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.
Sourcepub fn localize_correspondences(
&self,
camera: &Camera,
correspondence_set: CorrespondenceSet,
) -> LocalizationResult
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.
Sourcepub fn localize_with_unknown_focal(
&self,
query: &QueryImage,
map: &VisualMap,
descriptor_store: &LandmarkDescriptorStore,
focal_config: &P4PfRansacConfig,
) -> UnknownFocalLocalization
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§
Auto Trait Implementations§
impl<M, S, E> Forget for LocalizationPipeline<M, S, E>
impl<M, S, E> Freeze for LocalizationPipeline<M, S, E>
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>
impl<M, S, E> Sync for LocalizationPipeline<M, S, E>
impl<M, S, E> Unpin for LocalizationPipeline<M, S, E>
impl<M, S, E> UnsafeUnpin for LocalizationPipeline<M, S, E>
impl<M, S, E> UnwindSafe for LocalizationPipeline<M, S, E>
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.