pub struct Camera {
pub fx: f64,
pub fy: f64,
pub cx: f64,
pub cy: f64,
pub k1: f64,
pub k2: f64,
pub p1: f64,
pub p2: f64,
pub k3: f64,
}Expand description
Pinhole intrinsics (fx, fy, cx, cy) plus distortion (k1, k2, p1, p2, k3).
Fields§
§fx: f64§fy: f64§cx: f64§cy: f64§k1: f64§k2: f64§p1: f64§p2: f64§k3: f64Implementations§
Source§impl Camera
impl Camera
Sourcepub fn new(fx: f64, fy: f64, cx: f64, cy: f64) -> Self
pub fn new(fx: f64, fy: f64, cx: f64, cy: f64) -> Self
A distortion-free pinhole camera (all distortion coefficients zero).
Sourcepub fn with_distortion(
fx: f64,
fy: f64,
cx: f64,
cy: f64,
k1: f64,
k2: f64,
p1: f64,
p2: f64,
k3: f64,
) -> Self
pub fn with_distortion( fx: f64, fy: f64, cx: f64, cy: f64, k1: f64, k2: f64, p1: f64, p2: f64, k3: f64, ) -> Self
A camera with the full radial (k1, k2, k3) and tangential (p1, p2) distortion model.
Sourcepub fn undistort_point(&self, u: f64, v: f64) -> (f64, f64)
pub fn undistort_point(&self, u: f64, v: f64) -> (f64, f64)
Maps a distorted pixel (u, v) to its undistorted pixel location in the same
camera (same intrinsics), inverting the distortion model iteratively (OpenCV’s
undistortPoints scheme).
Sourcepub fn distort_point(&self, x: f64, y: f64) -> (f64, f64)
pub fn distort_point(&self, x: f64, y: f64) -> (f64, f64)
Forward model: maps ideal normalized coordinates to a distorted pixel. The
inverse of Self::undistort_point’s normalized stage; used to validate the inverse.
Trait Implementations§
impl Copy for Camera
impl StructuralPartialEq for Camera
Auto Trait Implementations§
impl Freeze for Camera
impl RefUnwindSafe for Camera
impl Send for Camera
impl Sync for Camera
impl Unpin for Camera
impl UnsafeUnpin for Camera
impl UnwindSafe for Camera
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more