[−][src]Struct cv_pinhole::CameraIntrinsics
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]
P: ImagePoint,
Takes in a point from an image in pixel coordinates and
converts it to a NormalizedKeyPoint
.
use cv_core::{KeyPoint, CameraModel}; use cv_pinhole::{NormalizedKeyPoint, CameraIntrinsics}; use cv_core::nalgebra::{Vector2, Vector3, Point2}; 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.
use cv_core::{KeyPoint, CameraModel}; use cv_pinhole::{NormalizedKeyPoint, CameraIntrinsics}; use cv_core::nalgebra::{Vector2, Vector3, Point2}; 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]
fn clone(&self) -> CameraIntrinsics
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for CameraIntrinsics
[src]
impl Debug for CameraIntrinsics
[src]
impl PartialEq<CameraIntrinsics> for CameraIntrinsics
[src]
fn eq(&self, other: &CameraIntrinsics) -> bool
[src]
fn ne(&self, other: &CameraIntrinsics) -> bool
[src]
impl PartialOrd<CameraIntrinsics> for CameraIntrinsics
[src]
fn partial_cmp(&self, other: &CameraIntrinsics) -> Option<Ordering>
[src]
fn lt(&self, other: &CameraIntrinsics) -> bool
[src]
fn le(&self, other: &CameraIntrinsics) -> bool
[src]
fn gt(&self, other: &CameraIntrinsics) -> bool
[src]
fn ge(&self, other: &CameraIntrinsics) -> bool
[src]
impl StructuralPartialEq for CameraIntrinsics
[src]
Auto Trait Implementations
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<T> Scalar for T where
T: PartialEq<T> + Copy + Any + Debug,
[src]
T: PartialEq<T> + Copy + Any + Debug,
fn inlined_clone(&self) -> T
[src]
fn is<T>() -> bool where
T: Scalar,
[src]
T: Scalar,
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, 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>,