Struct sophus_sensor::camera::Camera
source · pub struct Camera<S: IsScalar<BATCH>, const DISTORT: usize, const PARAMS: usize, const BATCH: usize, Distort: IsCameraDistortionImpl<S, DISTORT, PARAMS, BATCH>, Proj: IsProjection<S, BATCH>> { /* private fields */ }Expand description
A generic camera model
Implementations§
source§impl<S: IsScalar<BATCH>, const DISTORT: usize, const PARAMS: usize, const BATCH: usize, Distort: IsCameraDistortionImpl<S, DISTORT, PARAMS, BATCH>, Proj: IsProjection<S, BATCH>> Camera<S, DISTORT, PARAMS, BATCH, Distort, Proj>
impl<S: IsScalar<BATCH>, const DISTORT: usize, const PARAMS: usize, const BATCH: usize, Distort: IsCameraDistortionImpl<S, DISTORT, PARAMS, BATCH>, Proj: IsProjection<S, BATCH>> Camera<S, DISTORT, PARAMS, BATCH, Distort, Proj>
sourcepub fn from_params_and_size(params: &S::Vector<PARAMS>, size: ImageSize) -> Self
pub fn from_params_and_size(params: &S::Vector<PARAMS>, size: ImageSize) -> Self
Creates a new camera from parameters and image size
sourcepub fn image_size(&self) -> ImageSize
pub fn image_size(&self) -> ImageSize
Returns the image size
sourcepub fn distort(
&self,
proj_point_in_camera_z1_plane: &S::Vector<2>,
) -> S::Vector<2>
pub fn distort( &self, proj_point_in_camera_z1_plane: &S::Vector<2>, ) -> S::Vector<2>
Distortion - maps a point in the camera z=1 plane to a distorted point
sourcepub fn undistort(&self, pixel: &S::Vector<2>) -> S::Vector<2>
pub fn undistort(&self, pixel: &S::Vector<2>) -> S::Vector<2>
Undistortion - maps a distorted pixel to a point in the camera z=1 plane
sourcepub fn dx_distort_x(
&self,
proj_point_in_camera_z1_plane: &S::Vector<2>,
) -> S::Matrix<2, 2>
pub fn dx_distort_x( &self, proj_point_in_camera_z1_plane: &S::Vector<2>, ) -> S::Matrix<2, 2>
Derivative of the distortion w.r.t. the point in the camera z=1 plane
sourcepub fn cam_proj(&self, point_in_camera: &S::Vector<3>) -> S::Vector<2>
pub fn cam_proj(&self, point_in_camera: &S::Vector<3>) -> S::Vector<2>
Projects a 3D point in the camera frame to a pixel in the image
sourcepub fn cam_unproj(&self, point_in_camera: &S::Vector<2>) -> S::Vector<3>
pub fn cam_unproj(&self, point_in_camera: &S::Vector<2>) -> S::Vector<3>
Unprojects a pixel in the image to a 3D point in the camera frame - assuming z=1
sourcepub fn cam_unproj_with_z(
&self,
point_in_camera: &S::Vector<2>,
z: S,
) -> S::Vector<3>
pub fn cam_unproj_with_z( &self, point_in_camera: &S::Vector<2>, z: S, ) -> S::Vector<3>
Unprojects a pixel in the image to a 3D point in the camera frame
sourcepub fn set_params(&mut self, params: &S::Vector<PARAMS>)
pub fn set_params(&mut self, params: &S::Vector<PARAMS>)
Sets the camera parameters
sourcepub fn params_examples() -> Vec<S::Vector<PARAMS>>
pub fn params_examples() -> Vec<S::Vector<PARAMS>>
Examples of valid parameters
sourcepub fn invalid_params_examples() -> Vec<S::Vector<PARAMS>>
pub fn invalid_params_examples() -> Vec<S::Vector<PARAMS>>
Examples of invalid parameters
Trait Implementations§
source§impl<S: Clone + IsScalar<BATCH>, const DISTORT: usize, const PARAMS: usize, const BATCH: usize, Distort: Clone + IsCameraDistortionImpl<S, DISTORT, PARAMS, BATCH>, Proj: Clone + IsProjection<S, BATCH>> Clone for Camera<S, DISTORT, PARAMS, BATCH, Distort, Proj>
impl<S: Clone + IsScalar<BATCH>, const DISTORT: usize, const PARAMS: usize, const BATCH: usize, Distort: Clone + IsCameraDistortionImpl<S, DISTORT, PARAMS, BATCH>, Proj: Clone + IsProjection<S, BATCH>> Clone for Camera<S, DISTORT, PARAMS, BATCH, Distort, Proj>
source§impl<S: Debug + IsScalar<BATCH>, const DISTORT: usize, const PARAMS: usize, const BATCH: usize, Distort: Debug + IsCameraDistortionImpl<S, DISTORT, PARAMS, BATCH>, Proj: Debug + IsProjection<S, BATCH>> Debug for Camera<S, DISTORT, PARAMS, BATCH, Distort, Proj>
impl<S: Debug + IsScalar<BATCH>, const DISTORT: usize, const PARAMS: usize, const BATCH: usize, Distort: Debug + IsCameraDistortionImpl<S, DISTORT, PARAMS, BATCH>, Proj: Debug + IsProjection<S, BATCH>> Debug for Camera<S, DISTORT, PARAMS, BATCH, Distort, Proj>
source§impl<S: IsScalar<BATCH>, const DISTORT: usize, const PARAMS: usize, const BATCH: usize, Distort: IsCameraDistortionImpl<S, DISTORT, PARAMS, BATCH>, Proj: IsProjection<S, BATCH>> Default for Camera<S, DISTORT, PARAMS, BATCH, Distort, Proj>
impl<S: IsScalar<BATCH>, const DISTORT: usize, const PARAMS: usize, const BATCH: usize, Distort: IsCameraDistortionImpl<S, DISTORT, PARAMS, BATCH>, Proj: IsProjection<S, BATCH>> Default for Camera<S, DISTORT, PARAMS, BATCH, Distort, Proj>
impl<S: Copy + IsScalar<BATCH>, const DISTORT: usize, const PARAMS: usize, const BATCH: usize, Distort: Copy + IsCameraDistortionImpl<S, DISTORT, PARAMS, BATCH>, Proj: Copy + IsProjection<S, BATCH>> Copy for Camera<S, DISTORT, PARAMS, BATCH, Distort, Proj>
Auto Trait Implementations§
impl<S, const DISTORT: usize, const PARAMS: usize, const BATCH: usize, Distort, Proj> Freeze for Camera<S, DISTORT, PARAMS, BATCH, Distort, Proj>
impl<S, const DISTORT: usize, const PARAMS: usize, const BATCH: usize, Distort, Proj> RefUnwindSafe for Camera<S, DISTORT, PARAMS, BATCH, Distort, Proj>where
<S as IsScalar<BATCH>>::Vector<PARAMS>: RefUnwindSafe,
Distort: RefUnwindSafe,
Proj: RefUnwindSafe,
impl<S, const DISTORT: usize, const PARAMS: usize, const BATCH: usize, Distort, Proj> Send for Camera<S, DISTORT, PARAMS, BATCH, Distort, Proj>
impl<S, const DISTORT: usize, const PARAMS: usize, const BATCH: usize, Distort, Proj> Sync for Camera<S, DISTORT, PARAMS, BATCH, Distort, Proj>
impl<S, const DISTORT: usize, const PARAMS: usize, const BATCH: usize, Distort, Proj> Unpin for Camera<S, DISTORT, PARAMS, BATCH, Distort, Proj>
impl<S, const DISTORT: usize, const PARAMS: usize, const BATCH: usize, Distort, Proj> UnwindSafe for Camera<S, DISTORT, PARAMS, BATCH, Distort, Proj>
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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.