[−][src]Struct cv::geom::MinSquaresTriangulator
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() -> MinSquaresTriangulator
[src]
Creates a MinSquaresTriangulator
with default values.
Same as calling Default::default
.
pub fn epsilon(self, epsilon: f64) -> MinSquaresTriangulator
[src]
Set the epsilon used in the symmetric eigen solver.
Default is 1e-9
.
pub fn max_iterations(self, max_iterations: usize) -> MinSquaresTriangulator
[src]
Set the maximum number of iterations for the symmetric eigen solver.
Default is 100
.
Trait Implementations
impl Clone for MinSquaresTriangulator
[src]
fn clone(&self) -> MinSquaresTriangulator
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for MinSquaresTriangulator
[src]
impl Debug for MinSquaresTriangulator
[src]
impl Default for MinSquaresTriangulator
[src]
fn default() -> MinSquaresTriangulator
[src]
impl TriangulatorObservances for MinSquaresTriangulator
[src]
fn triangulate_observances<B>(
&self,
pairs: impl IntoIterator<Item = (WorldToCamera, B)>
) -> Option<WorldPoint> where
B: Bearing,
[src]
&self,
pairs: impl IntoIterator<Item = (WorldToCamera, B)>
) -> Option<WorldPoint> where
B: Bearing,
Auto Trait Implementations
impl RefUnwindSafe for MinSquaresTriangulator
impl Send for MinSquaresTriangulator
impl Sync for MinSquaresTriangulator
impl Unpin for MinSquaresTriangulator
impl UnwindSafe for MinSquaresTriangulator
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> TriangulatorRelative for T where
T: TriangulatorObservances,
[src]
T: TriangulatorObservances,
fn triangulate_relative<A, B>(
&self,
CameraToCamera,
a: A,
b: B
) -> Option<CameraPoint> where
A: Bearing,
B: Bearing,
[src]
&self,
CameraToCamera,
a: A,
b: B
) -> Option<CameraPoint> where
A: Bearing,
B: Bearing,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,