[][src]Struct cv_pinhole::PoseSolver

pub struct PoseSolver<'a> { /* fields omitted */ }

Allows pose solving to be parameterized if defaults are not sufficient.

Implementations

impl<'a> PoseSolver<'a>[src]

pub fn epsilon(self, epsilon: f64) -> Self[src]

Set the epsilon to be used in SVD.

pub fn max_iterations(self, max_iterations: usize) -> Self[src]

Set the max number of iterations to be used in SVD.

pub fn consensus_ratio(self, consensus_ratio: f64) -> Self[src]

Set the level of agreement required for the pose to be accepted.

pub fn solve_unscaled(
    &self,
    correspondences: impl Iterator<Item = FeatureMatch<NormalizedKeyPoint>>
) -> Option<CameraToCamera>
[src]

Return the CameraToCamera that transforms a CameraPoint of image A (source of a) to the corresponding CameraPoint of image B (source of b). The function takes an iterator over FeatureMatch from A to B. The translation scale is unknown of the returned pose.

  • depth - The actual depth (z axis, not distance) of normalized keypoint a
  • a - A keypoint from image A
  • b - A keypoint from image B

self must satisfy the constraint:

transpose(homogeneous(a)) * E * homogeneous(b) = 0

Also, a and b must be a correspondence.

This will take the average translation over the entire iterator. This is done to smooth out noise and outliers (if present).

epsilon is a small value to which SVD must converge to before terminating.

max_iterations is the maximum number of iterations that SVD will run on this matrix. Use this to cap the execution time. A max_iterations of 0 may execute indefinitely and is not recommended except for non-production code.

consensus_ratio is the ratio of points which must be in front of the camera for the model to be accepted and return Some. Otherwise, None is returned. Set this to about 0.45 to have approximate majority consensus.

bearing_scale is a function that is passed a translation bearing vector, an untranslated (but rotated) camera point, and a normalized key point where the actual point exists. It must return the scalar which the translation bearing vector must by multiplied by to get the actual translation. It may return None if it fails.

correspondences must provide an iterator of tuples containing the matches of a 3d CameraPoint a from camera A and the matching NormalizedKeyPoint b from camera B.

This does not communicate which points were outliers to each model.

pub fn solve_unscaled_inliers(
    &self,
    correspondences: impl Iterator<Item = FeatureMatch<NormalizedKeyPoint>>
) -> Option<(CameraToCamera, Vec<usize>)>
[src]

Same as PoseSolver::solve_unscaled, but also communicates the inliers.

The alloc feature must be enabled to use this method.

Trait Implementations

impl<'a> Clone for PoseSolver<'a>[src]

impl<'a> Copy for PoseSolver<'a>[src]

impl<'a> Debug for PoseSolver<'a>[src]

Auto Trait Implementations

impl<'a> Send for PoseSolver<'a>

impl<'a> Sync for PoseSolver<'a>

impl<'a> Unpin for PoseSolver<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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