pub enum CameraModel {
Show 14 variants
Pinhole,
SimplePinhole,
SimpleRadial,
Radial,
OpenCv,
FullOpenCv,
OpenCvFisheye,
SimpleRadialFisheye,
RadialFisheye,
ThinPrismFisheye,
Fov,
DoubleSphere,
Equirectangular,
Unknown(String),
}Expand description
Camera projection models understood by the shared geometry front-end.
Pinhole-family models (Pinhole, SimplePinhole, SimpleRadial,
Radial, OpenCv) use [fx, fy, cx, cy] intrinsics plus optional
radial-tangential coefficients. The fisheye-family models use their own
parameter layouts (documented on Camera::intrinsics) and are dispatched
to the matching project/normalize_pixel math.
Variants§
Pinhole
SimplePinhole
SimpleRadial
Radial
OpenCv
FullOpenCv
OpenCV rational model: [fx, fy, cx, cy, k1, k2, p1, p2, k3, k4, k5, k6].
OpenCvFisheye
OpenCV fisheye / Kannala-Brandt equidistant: [fx, fy, cx, cy, k1, k2, k3, k4].
SimpleRadialFisheye
Equidistant with one radial coefficient: [f, cx, cy, k1].
RadialFisheye
Equidistant with two radial coefficients: [f, cx, cy, k1, k2].
ThinPrismFisheye
COLMAP THIN_PRISM_FISHEYE: equidistant coordinates with radial,
tangential and thin-prism terms,
[fx, fy, cx, cy, k1, k2, p1, p2, k3, k4, sx1, sy1].
Fov
Devernay FOV model: [fx, fy, cx, cy, omega].
DoubleSphere
Double Sphere model: [fx, fy, cx, cy, xi, alpha].
Equirectangular
COLMAP’s EQUIRECTANGULAR 360° panorama: [w, h], the image size.
Column x is the azimuth atan2(X, Z) from -π at x = 0 to π
at x = w, row y the elevation atan2(-Y, hypot(X, Z)) from
π/2 at y = 0 to -π/2 at y = h: every direction projects,
including those behind the camera. No focal length, so
Camera::intrinsics is None.
Unknown(String)
Implementations§
Source§impl CameraModel
impl CameraModel
pub fn from_colmap_name(name: &str) -> CameraModel
Sourcepub fn colmap_name(&self) -> Option<&str>
pub fn colmap_name(&self) -> Option<&str>
Canonical COLMAP model name, when this model has one. Double Sphere is
not a COLMAP model and returns None.
Sourcepub const fn colmap_param_count(&self) -> Option<usize>
pub const fn colmap_param_count(&self) -> Option<usize>
Number of PARAMS[] the COLMAP camera model carries in
cameras.txt / cameras.bin, or None for models COLMAP does not
define.
Sourcepub const fn extra_param_indices(&self) -> Range<usize> ⓘ
pub const fn extra_param_indices(&self) -> Range<usize> ⓘ
Indices into Camera::params of the model’s distortion parameters,
everything after its focal length(s) and principal point (COLMAP’s
extra_params_idxs): k1 of SIMPLE_RADIAL is 3..4, k1 k2 p1 p2
of OPENCV 4..8. Empty for the undistorted pinholes and the
panorama.
Sourcepub const fn is_spherical(&self) -> bool
pub const fn is_spherical(&self) -> bool
Whether this model sees in every direction (the equirectangular panorama): rays behind the camera are valid, and there is no image plane to measure depth against.
Sourcepub const fn is_fisheye(&self) -> bool
pub const fn is_fisheye(&self) -> bool
Whether this model is a fisheye/wide-angle model whose pixel-to-ray map
is not the pinhole (x/z, y/z) projection.
Trait Implementations§
Source§impl Clone for CameraModel
impl Clone for CameraModel
Source§fn clone(&self) -> CameraModel
fn clone(&self) -> CameraModel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CameraModel
impl Debug for CameraModel
impl Eq for CameraModel
Source§impl PartialEq for CameraModel
impl PartialEq for CameraModel
impl StructuralPartialEq for CameraModel
Auto Trait Implementations§
impl Forget for CameraModel
impl Freeze for CameraModel
impl Move for CameraModel
impl RefUnwindSafe for CameraModel
impl Send for CameraModel
impl Sync for CameraModel
impl Unpin for CameraModel
impl UnsafeUnpin for CameraModel
impl UnwindSafe for CameraModel
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.