pub trait CameraModel:
Copy
+ Send
+ Sync
+ 'static {
const IS_RECTIFIED: bool;
// Required methods
fn distort(&self, xn: f64, yn: f64) -> [f64; 2];
fn undistort(&self, xd: f64, yd: f64) -> [f64; 2];
fn distort_jacobian(&self, xn: f64, yn: f64) -> [[f64; 2]; 2];
}Expand description
A compile-time abstraction over camera distortion models.
Monomorphizing on this trait allows the compiler to completely eliminate all
distortion code when IS_RECTIFIED = true (e.g., for PinholeModel),
leaving zero overhead for the common rectified-image case.
Required Associated Constants§
Sourceconst IS_RECTIFIED: bool
const IS_RECTIFIED: bool
True iff the camera produces a rectified (undistorted) image.
When true, the compiler can statically prove that distort and undistort
are identity functions and will eliminate all branches guarded by !C::IS_RECTIFIED.
Required Methods§
Sourcefn distort(&self, xn: f64, yn: f64) -> [f64; 2]
fn distort(&self, xn: f64, yn: f64) -> [f64; 2]
Map normalized ideal (undistorted) coordinates (xn, yn) to normalized
distorted coordinates (xd, yd).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.