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: LocalizationConfigImplementations§
Source§impl<M> LocalizationPipeline<M>
impl<M> LocalizationPipeline<M>
pub fn new(matcher: M, config: LocalizationConfig) -> LocalizationPipeline<M>
Source§impl<M, S> LocalizationPipeline<M, S>
impl<M, S> LocalizationPipeline<M, S>
pub fn with_candidate_selector( matcher: M, candidate_selector: S, config: LocalizationConfig, ) -> LocalizationPipeline<M, S>
Source§impl<M, S> LocalizationPipeline<M, S>
impl<M, S> LocalizationPipeline<M, S>
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,
) -> LocalizationPipeline<M, S>
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>
impl<M, S, E> LocalizationPipeline<M, S, E>
pub const fn with_pose_estimator( matcher: M, candidate_selector: S, pose_estimator: E, config: LocalizationConfig, ) -> LocalizationPipeline<M, S, E>
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 as FeatureExtractor>::Image,
camera: Camera,
map: &VisualMap,
extractor: &X,
) -> Result<LocalizationResult, <X as FeatureExtractor>::Error>where
X: FeatureExtractor,
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>
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>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: u64,
camera_id: u64,
image: &<X as FeatureExtractor>::Image,
map: &VisualMap,
extractor: &X,
) -> Result<FrameLocalizationResult, <X as FeatureExtractor>::Error>where
X: FeatureExtractor,
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>
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>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§
Source§impl<M, S, E> Clone for LocalizationPipeline<M, S, E>
impl<M, S, E> Clone for LocalizationPipeline<M, S, E>
Source§fn clone(&self) -> LocalizationPipeline<M, S, E>
fn clone(&self) -> LocalizationPipeline<M, S, E>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<M, S, E> Debug for LocalizationPipeline<M, S, E>
impl<M, S, E> Debug for LocalizationPipeline<M, S, E>
Source§impl Default for LocalizationPipeline
impl Default for LocalizationPipeline
Source§fn default() -> LocalizationPipeline
fn default() -> LocalizationPipeline
Source§impl<M, S, E> FrameLocalizer for LocalizationPipeline<M, S, E>
impl<M, S, E> FrameLocalizer for LocalizationPipeline<M, S, E>
fn localize_frame_with_descriptor_store( &self, frame: &Frame, map: &VisualMap, descriptor_store: &LandmarkDescriptorStore, ) -> LocalizationResult
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
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
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
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
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
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§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>
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>
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>
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>
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
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.