Skip to main content

FThetaCamera

Struct FThetaCamera 

Source
pub struct FThetaCamera {
    pub cx: f64,
    pub cy: f64,
    pub distortion: DistortionModel,
}
Expand description

NVIDIA f-theta fisheye camera with 6 intrinsic parameters.

Stores the principal point (cx, cy) and the four forward-polynomial coefficients k₁…k₄. The model is isotropic (no separate fx/fy).

Fields§

§cx: f64

Principal point x (u₀ in the paper), pixels.

§cy: f64

Principal point y (v₀ in the paper), pixels.

§distortion: DistortionModel

Forward-polynomial distortion — must be DistortionModel::FTheta.

Implementations§

Source§

impl FThetaCamera

Source

pub fn new( cx: f64, cy: f64, distortion: DistortionModel, ) -> Result<Self, CameraModelError>

Create a new f-theta camera.

§Errors

Returns CameraModelError::InvalidParams if distortion is not DistortionModel::FTheta, or if any parameter fails validation.

Source

pub fn try_from_params(params: &[f64]) -> Result<Self, CameraModelError>

Build directly from the six scalar parameters [cx, cy, k1, k2, k3, k4].

Source

pub fn distortion_params(&self) -> (f64, f64, f64, f64)

Extract (k1, k2, k3, k4) from the stored distortion.

§Panics

Panics if self.distortion is not DistortionModel::FTheta — this cannot happen after successful construction.

Source

pub fn linear_estimation( &self, points_3d: &Matrix3xX<f64>, points_2d: &Matrix2xX<f64>, ) -> Result<Self, CameraModelError>

Least-squares estimation of k₁..k₄ given 3D-2D correspondences, assuming cx and cy are already known.

Constructs a Vandermonde system [θ θ² θ³ θ⁴] · [k₁ k₂ k₃ k₄]ᵀ = r and solves it with SVD (nalgebra full-pivoting).

Returns an updated FThetaCamera with the estimated polynomial coefficients. The principal point is unchanged.

§Arguments
  • points_3d — 3×N matrix of 3D points in camera frame
  • points_2d — 2×N matrix of observed pixel coordinates

Trait Implementations§

Source§

impl CameraModel for FThetaCamera

Source§

const INTRINSIC_DIM: usize = 6

Number of intrinsic parameters (compile-time constant).
Source§

type IntrinsicJacobian = Matrix<f64, Const<2>, Const<6>, ArrayStorage<f64, 2, 6>>

Jacobian type for intrinsics: 2 × INTRINSIC_DIM.
Source§

type PointJacobian = Matrix<f64, Const<2>, Const<3>, ArrayStorage<f64, 2, 3>>

Jacobian type for 3D point: 2 × 3.
Source§

fn project( &self, p_cam: &Vector3<f64>, ) -> Result<Vector2<f64>, CameraModelError>

Projects a 3D point in camera coordinates to 2D image coordinates. Read more
Source§

fn unproject( &self, point_2d: &Vector2<f64>, ) -> Result<Vector3<f64>, CameraModelError>

Unprojects a 2D image point to a normalized 3D ray in camera frame. Read more
Source§

fn jacobian_point(&self, p_cam: &Vector3<f64>) -> Self::PointJacobian

Jacobian of projection with respect to 3D point coordinates. Read more
Source§

fn jacobian_intrinsics(&self, p_cam: &Vector3<f64>) -> Self::IntrinsicJacobian

Jacobian of projection with respect to intrinsic parameters. Read more
Source§

fn validate_params(&self) -> Result<(), CameraModelError>

Validates camera intrinsic and distortion parameters. Read more
Source§

fn get_pinhole_params(&self) -> PinholeParams

Returns the pinhole parameters (fx, fy, cx, cy). Read more
Source§

fn get_distortion(&self) -> DistortionModel

Returns the distortion model and parameters. Read more
Source§

fn get_model_name(&self) -> &'static str

Returns the camera model name identifier. Read more
Source§

fn jacobian_pose( &self, p_world: &Vector3<f64>, pose: &SE3, ) -> (Self::PointJacobian, SMatrix<f64, 3, 6>)

Jacobian of projection w.r.t. camera pose (SE3). Read more
Source§

fn project_batch(&self, points_cam: &Matrix3xX<f64>) -> Matrix2xX<f64>

Batch projection of multiple 3D points to 2D image coordinates. Read more
Source§

impl Clone for FThetaCamera

Source§

fn clone(&self) -> FThetaCamera

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FThetaCamera

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&FThetaCamera> for [f64; 6]

Parameter order: [cx, cy, k1, k2, k3, k4].

Source§

fn from(cam: &FThetaCamera) -> Self

Converts to this type from the input type.
Source§

impl From<&FThetaCamera> for DVector<f64>

Source§

fn from(cam: &FThetaCamera) -> Self

Converts to this type from the input type.
Source§

impl From<[f64; 6]> for FThetaCamera

Source§

fn from(p: [f64; 6]) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for FThetaCamera

Source§

fn eq(&self, other: &FThetaCamera) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<&[f64]> for FThetaCamera

Source§

type Error = CameraModelError

The type returned in the event of a conversion error.
Source§

fn try_from(params: &[f64]) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Copy for FThetaCamera

Source§

impl StructuralPartialEq for FThetaCamera

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,