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: f64Principal point x (u₀ in the paper), pixels.
cy: f64Principal point y (v₀ in the paper), pixels.
distortion: DistortionModelForward-polynomial distortion — must be DistortionModel::FTheta.
Implementations§
Source§impl FThetaCamera
impl FThetaCamera
Sourcepub fn new(
cx: f64,
cy: f64,
distortion: DistortionModel,
) -> Result<FThetaCamera, CameraModelError>
pub fn new( cx: f64, cy: f64, distortion: DistortionModel, ) -> Result<FThetaCamera, CameraModelError>
Create a new f-theta camera.
§Errors
Returns CameraModelError::InvalidParams if distortion is not
DistortionModel::FTheta, or if any parameter fails validation.
Sourcepub fn try_from_params(params: &[f64]) -> Result<FThetaCamera, CameraModelError>
pub fn try_from_params(params: &[f64]) -> Result<FThetaCamera, CameraModelError>
Build directly from the six scalar parameters [cx, cy, k1, k2, k3, k4].
Sourcepub fn distortion_params(&self) -> (f64, f64, f64, f64)
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.
Sourcepub fn linear_estimation(
&self,
points_3d: &Matrix<f64, Const<3>, Dyn, VecStorage<f64, Const<3>, Dyn>>,
points_2d: &Matrix<f64, Const<2>, Dyn, VecStorage<f64, Const<2>, Dyn>>,
) -> Result<FThetaCamera, CameraModelError>
pub fn linear_estimation( &self, points_3d: &Matrix<f64, Const<3>, Dyn, VecStorage<f64, Const<3>, Dyn>>, points_2d: &Matrix<f64, Const<2>, Dyn, VecStorage<f64, Const<2>, Dyn>>, ) -> Result<FThetaCamera, 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 framepoints_2d— 2×N matrix of observed pixel coordinates
Trait Implementations§
Source§impl CameraModel for FThetaCamera
impl CameraModel for FThetaCamera
Source§const INTRINSIC_DIM: usize = 6
const INTRINSIC_DIM: usize = 6
Source§type IntrinsicJacobian = Matrix<f64, Const<2>, Const<6>, ArrayStorage<f64, 2, 6>>
type IntrinsicJacobian = Matrix<f64, Const<2>, Const<6>, ArrayStorage<f64, 2, 6>>
Source§type PointJacobian = Matrix<f64, Const<2>, Const<3>, ArrayStorage<f64, 2, 3>>
type PointJacobian = Matrix<f64, Const<2>, Const<3>, ArrayStorage<f64, 2, 3>>
Source§fn project(
&self,
p_cam: &Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
) -> Result<Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>, CameraModelError>
fn project( &self, p_cam: &Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, ) -> Result<Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>, CameraModelError>
Source§fn unproject(
&self,
point_2d: &Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>,
) -> Result<Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, CameraModelError>
fn unproject( &self, point_2d: &Matrix<f64, Const<2>, Const<1>, ArrayStorage<f64, 2, 1>>, ) -> Result<Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, CameraModelError>
Source§fn jacobian_point(
&self,
p_cam: &Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
) -> <FThetaCamera as CameraModel>::PointJacobian
fn jacobian_point( &self, p_cam: &Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, ) -> <FThetaCamera as CameraModel>::PointJacobian
Source§fn jacobian_intrinsics(
&self,
p_cam: &Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
) -> <FThetaCamera as CameraModel>::IntrinsicJacobian
fn jacobian_intrinsics( &self, p_cam: &Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, ) -> <FThetaCamera as CameraModel>::IntrinsicJacobian
Source§fn validate_params(&self) -> Result<(), CameraModelError>
fn validate_params(&self) -> Result<(), CameraModelError>
Source§fn get_pinhole_params(&self) -> PinholeParams
fn get_pinhole_params(&self) -> PinholeParams
Source§fn get_distortion(&self) -> DistortionModel
fn get_distortion(&self) -> DistortionModel
Source§fn get_model_name(&self) -> &'static str
fn get_model_name(&self) -> &'static str
Source§fn jacobian_pose(
&self,
p_world: &Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
pose: &SE3,
) -> (Self::PointJacobian, Matrix<f64, Const<3>, Const<6>, ArrayStorage<f64, 3, 6>>)
fn jacobian_pose( &self, p_world: &Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>, pose: &SE3, ) -> (Self::PointJacobian, Matrix<f64, Const<3>, Const<6>, ArrayStorage<f64, 3, 6>>)
Source§impl Clone for FThetaCamera
impl Clone for FThetaCamera
Source§fn clone(&self) -> FThetaCamera
fn clone(&self) -> FThetaCamera
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 FThetaCamera
impl Debug for FThetaCamera
Source§impl PartialEq for FThetaCamera
impl PartialEq for FThetaCamera
Source§fn eq(&self, other: &FThetaCamera) -> bool
fn eq(&self, other: &FThetaCamera) -> bool
self and other values to be equal, and is used by ==.Source§impl TryFrom<&[f64]> for FThetaCamera
impl TryFrom<&[f64]> for FThetaCamera
Source§type Error = CameraModelError
type Error = CameraModelError
Source§fn try_from(
params: &[f64],
) -> Result<FThetaCamera, <FThetaCamera as TryFrom<&[f64]>>::Error>
fn try_from( params: &[f64], ) -> Result<FThetaCamera, <FThetaCamera as TryFrom<&[f64]>>::Error>
impl Copy for FThetaCamera
impl StructuralPartialEq for FThetaCamera
Auto Trait Implementations§
impl Freeze for FThetaCamera
impl RefUnwindSafe for FThetaCamera
impl Send for FThetaCamera
impl Sync for FThetaCamera
impl Unpin for FThetaCamera
impl UnsafeUnpin for FThetaCamera
impl UnwindSafe for FThetaCamera
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> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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
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.