[][src]Struct cv_pinhole::CameraIntrinsics

pub struct CameraIntrinsics {
    pub focals: Vector2<f64>,
    pub principal_point: Point2<f64>,
    pub skew: f64,
}

This contains intrinsic camera parameters as per this Wikipedia page.

For a high quality camera, this may be sufficient to normalize image coordinates. Undistortion may also be necessary to normalize image coordinates.

Fields

focals: Vector2<f64>principal_point: Point2<f64>skew: f64

Implementations

impl CameraIntrinsics[src]

pub fn identity() -> Self[src]

Creates camera intrinsics that would create an identity intrinsic matrix. This would imply that the pixel positions have an origin at 0,0, the pixel distance unit is the focal length, pixels are square, and there is no skew.

pub fn focals(self, focals: Vector2<f64>) -> Self[src]

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

pub fn principal_point(self, principal_point: Point2<f64>) -> Self[src]

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

pub fn matrix(&self) -> Matrix3<f64>[src]

Trait Implementations

impl CameraModel for CameraIntrinsics[src]

type Projection = NormalizedKeyPoint

fn calibrate<P>(&self, point: P) -> NormalizedKeyPoint where
    P: ImagePoint
[src]

Takes in a point from an image in pixel coordinates and converts it to a NormalizedKeyPoint.

let intrinsics = CameraIntrinsics {
    focals: Vector2::new(800.0, 900.0),
    principal_point: Point2::new(500.0, 600.0),
    skew: 1.7,
};
let kp = KeyPoint(Point2::new(471.0, 322.0));
let nkp = intrinsics.calibrate(kp);
let calibration_matrix = intrinsics.matrix();
let distance = (kp.to_homogeneous() - calibration_matrix * nkp.to_homogeneous()).norm();
assert!(distance < 0.1);

fn uncalibrate(&self, projection: NormalizedKeyPoint) -> KeyPoint[src]

Converts a NormalizedKeyPoint back into pixel coordinates.

let intrinsics = CameraIntrinsics {
    focals: Vector2::new(800.0, 900.0),
    principal_point: Point2::new(500.0, 600.0),
    skew: 1.7,
};
let kp = KeyPoint(Point2::new(471.0, 322.0));
let nkp = intrinsics.calibrate(kp);
let ukp = intrinsics.uncalibrate(nkp);
assert!((kp.0 - ukp.0).norm() < 1e-6);

impl Clone for CameraIntrinsics[src]

impl Copy for CameraIntrinsics[src]

impl Debug for CameraIntrinsics[src]

impl PartialEq<CameraIntrinsics> for CameraIntrinsics[src]

impl PartialOrd<CameraIntrinsics> for CameraIntrinsics[src]

impl StructuralPartialEq for CameraIntrinsics[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<T> Scalar for T where
    T: PartialEq<T> + Copy + Any + Debug
[src]

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

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