pub struct NormalizedKeyPoint(pub Point2<f64>);Expand description
A point in normalized image coordinates. This keypoint has been corrected for distortion and normalized based on the camrea intrinsic matrix. Please note that the intrinsic matrix accounts for the natural focal length and any magnification to the image. Ultimately, the key points must be represented by their position on the camera sensor and normalized to the focal length of the camera.
Tuple Fields§
§0: Point2<f64>Implementations§
Source§impl NormalizedKeyPoint
impl NormalizedKeyPoint
Sourcepub fn from_camera_point(point: CameraPoint) -> Option<Self>
pub fn from_camera_point(point: CameraPoint) -> Option<Self>
Tries to convert the CameraPoint into a NormalizedKeyPoint, but it may fail
in extreme conditions, in which case None is returned.
Sourcepub fn with_depth(self, depth: f64) -> CameraPoint
pub fn with_depth(self, depth: f64) -> CameraPoint
Conceptually appends a 1.0 component to the normalized keypoint to create
a CameraPoint on the virtual image plane and then multiplies
the point by depth. This z/depth component must be the depth of
the keypoint in the direction the camera is pointing from the
camera’s optical center.
The depth is computed as the dot product of the unit camera norm
with the vector that represents the position delta of the point from
the camera.
Sourcepub fn with_distance(self, distance: f64) -> CameraPoint
pub fn with_distance(self, distance: f64) -> CameraPoint
Projects the keypoint out to the CameraPoint that is
distance away from the optical center of the camera. This
distance is defined as the norm of the vector that represents
the position delta of the point from the camera.
Sourcepub fn virtual_image_point(self) -> Point3<f64>
pub fn virtual_image_point(self) -> Point3<f64>
Get the virtual image point as a Point3.
The virtual image point is the point that is formed on the virtual image plane at a depth 1.0 in front of the camera.
Methods from Deref<Target = Point2<f64>>§
Sourcepub fn to_homogeneous(
&self,
) -> Matrix<N, <D as DimNameAdd<U1>>::Output, U1, <DefaultAllocator as Allocator<N, <D as DimNameAdd<U1>>::Output>>::Buffer>
pub fn to_homogeneous( &self, ) -> Matrix<N, <D as DimNameAdd<U1>>::Output, U1, <DefaultAllocator as Allocator<N, <D as DimNameAdd<U1>>::Output>>::Buffer>
Converts this point into a vector in homogeneous coordinates, i.e., appends a 1 at the
end of it.
This is the same as .into().
§Example
let p = Point2::new(10.0, 20.0);
assert_eq!(p.to_homogeneous(), Vector3::new(10.0, 20.0, 1.0));
// This works in any dimension.
let p = Point3::new(10.0, 20.0, 30.0);
assert_eq!(p.to_homogeneous(), Vector4::new(10.0, 20.0, 30.0, 1.0));Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
The dimension of this point.
§Example
let p = Point2::new(1.0, 2.0);
assert_eq!(p.len(), 2);
// This works in any dimension.
let p = Point3::new(10.0, 20.0, 30.0);
assert_eq!(p.len(), 3);Sourcepub fn stride(&self) -> usize
👎Deprecated: This methods is no longer significant and will always return 1.
pub fn stride(&self) -> usize
The stride of this point. This is the number of buffer element separating each component of this point.
Sourcepub fn iter(
&self,
) -> MatrixIter<'_, N, D, U1, <DefaultAllocator as Allocator<N, D>>::Buffer>
pub fn iter( &self, ) -> MatrixIter<'_, N, D, U1, <DefaultAllocator as Allocator<N, D>>::Buffer>
Iterates through this point coordinates.
§Example
let p = Point3::new(1.0, 2.0, 3.0);
let mut it = p.iter().cloned();
assert_eq!(it.next(), Some(1.0));
assert_eq!(it.next(), Some(2.0));
assert_eq!(it.next(), Some(3.0));
assert_eq!(it.next(), None);Sourcepub unsafe fn get_unchecked(&self, i: usize) -> &N
pub unsafe fn get_unchecked(&self, i: usize) -> &N
Gets a reference to i-th element of this point without bound-checking.
Sourcepub fn iter_mut(
&mut self,
) -> MatrixIterMut<'_, N, D, U1, <DefaultAllocator as Allocator<N, D>>::Buffer>
pub fn iter_mut( &mut self, ) -> MatrixIterMut<'_, N, D, U1, <DefaultAllocator as Allocator<N, D>>::Buffer>
Mutably iterates through this point coordinates.
§Example
let mut p = Point3::new(1.0, 2.0, 3.0);
for e in p.iter_mut() {
*e *= 10.0;
}
assert_eq!(p, Point3::new(10.0, 20.0, 30.0));Sourcepub unsafe fn get_unchecked_mut(&mut self, i: usize) -> &mut N
pub unsafe fn get_unchecked_mut(&mut self, i: usize) -> &mut N
Gets a mutable reference to i-th element of this point without bound-checking.
Sourcepub unsafe fn swap_unchecked(&mut self, i1: usize, i2: usize)
pub unsafe fn swap_unchecked(&mut self, i1: usize, i2: usize)
Swaps two entries without bound-checking.
Sourcepub fn inf(&self, other: &Point<N, D>) -> Point<N, D>
pub fn inf(&self, other: &Point<N, D>) -> Point<N, D>
Computes the infimum (aka. componentwise min) of two points.
Sourcepub fn sup(&self, other: &Point<N, D>) -> Point<N, D>
pub fn sup(&self, other: &Point<N, D>) -> Point<N, D>
Computes the supremum (aka. componentwise max) of two points.
Trait Implementations§
Source§impl Bearing for NormalizedKeyPoint
impl Bearing for NormalizedKeyPoint
Source§fn bearing_unnormalized(&self) -> Vector3<f64>
fn bearing_unnormalized(&self) -> Vector3<f64>
Source§fn from_bearing_vector(bearing: Vector3<f64>) -> Self
fn from_bearing_vector(bearing: Vector3<f64>) -> Self
Source§fn bearing(
&self,
) -> Unit<Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3>>::Buffer>>
fn bearing( &self, ) -> Unit<Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3>>::Buffer>>
Source§impl Clone for NormalizedKeyPoint
impl Clone for NormalizedKeyPoint
Source§fn clone(&self) -> NormalizedKeyPoint
fn clone(&self) -> NormalizedKeyPoint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NormalizedKeyPoint
impl Debug for NormalizedKeyPoint
Source§impl Deref for NormalizedKeyPoint
impl Deref for NormalizedKeyPoint
Source§impl DerefMut for NormalizedKeyPoint
impl DerefMut for NormalizedKeyPoint
Source§impl From<NormalizedKeyPoint> for Point2<f64>
impl From<NormalizedKeyPoint> for Point2<f64>
Source§fn from(original: NormalizedKeyPoint) -> Self
fn from(original: NormalizedKeyPoint) -> Self
Source§impl PartialEq for NormalizedKeyPoint
impl PartialEq for NormalizedKeyPoint
Source§impl PartialOrd for NormalizedKeyPoint
impl PartialOrd for NormalizedKeyPoint
impl Copy for NormalizedKeyPoint
impl StructuralPartialEq for NormalizedKeyPoint
Auto Trait Implementations§
impl Freeze for NormalizedKeyPoint
impl RefUnwindSafe for NormalizedKeyPoint
impl Send for NormalizedKeyPoint
impl Sync for NormalizedKeyPoint
impl Unpin for NormalizedKeyPoint
impl UnsafeUnpin for NormalizedKeyPoint
impl UnwindSafe for NormalizedKeyPoint
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<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.