[][src]Struct cv_geom::MinSquaresTriangulator

pub struct MinSquaresTriangulator { /* fields omitted */ }

This solves triangulation problems by simply minimizing the squared reprojection error of all observances.

This is a quick triangulator to execute and is fairly robust.

use cv_core::nalgebra::{Vector3, Point3, Rotation3, Unit};
use cv_core::{TriangulatorRelative, CameraToCamera, CameraPoint, Pose, Projective};
use cv_geom::MinSquaresTriangulator;

let point = CameraPoint::from_point(Point3::new(0.3, 0.1, 2.0));
let pose = CameraToCamera::from_parts(Vector3::new(0.1, 0.1, 0.1), Rotation3::new(Vector3::new(0.1, 0.1, 0.1)));
let bearing_a = point.bearing();
let bearing_b = pose.transform(point).bearing();
let triangulated = MinSquaresTriangulator::new().triangulate_relative(pose, bearing_a, bearing_b).unwrap();
let distance = (point.point().unwrap().coords - triangulated.point().unwrap().coords).norm();
assert!(distance < 1e-6);

Implementations

impl MinSquaresTriangulator[src]

pub fn new() -> Self[src]

Creates a MinSquaresTriangulator with default values.

Same as calling Default::default.

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

Set the epsilon used in the symmetric eigen solver.

Default is 1e-9.

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

Set the maximum number of iterations for the symmetric eigen solver.

Default is 100.

Trait Implementations

impl Clone for MinSquaresTriangulator[src]

impl Copy for MinSquaresTriangulator[src]

impl Debug for MinSquaresTriangulator[src]

impl Default for MinSquaresTriangulator[src]

impl TriangulatorObservances for MinSquaresTriangulator[src]

Auto Trait Implementations

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> TriangulatorRelative for T where
    T: TriangulatorObservances
[src]

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>,