Skip to main content

NormalizedKeyPoint

Struct NormalizedKeyPoint 

Source
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

Source

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.

Source

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.

Source

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.

Source

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>>§

Source

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));
Source

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);
Source

pub fn stride(&self) -> usize

👎Deprecated: This methods is no longer significant and will always return 1.

The stride of this point. This is the number of buffer element separating each component of this point.

Source

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);
Source

pub unsafe fn get_unchecked(&self, i: usize) -> &N

Gets a reference to i-th element of this point without bound-checking.

Source

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));
Source

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.

Source

pub unsafe fn swap_unchecked(&mut self, i1: usize, i2: usize)

Swaps two entries without bound-checking.

Source

pub fn inf(&self, other: &Point<N, D>) -> Point<N, D>

Computes the infimum (aka. componentwise min) of two points.

Source

pub fn sup(&self, other: &Point<N, D>) -> Point<N, D>

Computes the supremum (aka. componentwise max) of two points.

Source

pub fn inf_sup(&self, other: &Point<N, D>) -> (Point<N, D>, Point<N, D>)

Computes the (infimum, supremum) of two points.

Source

pub fn xx(&self) -> Point<N, U2>

Builds a new point from components of self.

Source

pub fn xxx(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn xy(&self) -> Point<N, U2>

Builds a new point from components of self.

Source

pub fn yx(&self) -> Point<N, U2>

Builds a new point from components of self.

Source

pub fn yy(&self) -> Point<N, U2>

Builds a new point from components of self.

Source

pub fn xxy(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn xyx(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn xyy(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn yxx(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn yxy(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn yyx(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn yyy(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn xz(&self) -> Point<N, U2>

Builds a new point from components of self.

Source

pub fn yz(&self) -> Point<N, U2>

Builds a new point from components of self.

Source

pub fn zx(&self) -> Point<N, U2>

Builds a new point from components of self.

Source

pub fn zy(&self) -> Point<N, U2>

Builds a new point from components of self.

Source

pub fn zz(&self) -> Point<N, U2>

Builds a new point from components of self.

Source

pub fn xxz(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn xyz(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn xzx(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn xzy(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn xzz(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn yxz(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn yyz(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn yzx(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn yzy(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn yzz(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn zxx(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn zxy(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn zxz(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn zyx(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn zyy(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn zyz(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn zzx(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn zzy(&self) -> Point<N, U3>

Builds a new point from components of self.

Source

pub fn zzz(&self) -> Point<N, U3>

Builds a new point from components of self.

Trait Implementations§

Source§

impl AsMut<Point<f64, U2>> for NormalizedKeyPoint

Source§

fn as_mut(&mut self) -> &mut Point2<f64>

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsRef<Point<f64, U2>> for NormalizedKeyPoint

Source§

fn as_ref(&self) -> &Point2<f64>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Bearing for NormalizedKeyPoint

Source§

fn bearing_unnormalized(&self) -> Vector3<f64>

Returns the unnormalized bearing which has direction point towards the direction that the signal entered the camera’s center. The magnitude of this vector is unknown. Use this if you are sure that you do not need a normalized bearing. This may be faster.
Source§

fn from_bearing_vector(bearing: Vector3<f64>) -> Self

Converts a bearing vector back into this bearing type. Read more
Source§

fn bearing( &self, ) -> Unit<Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3>>::Buffer>>

Returns a unit vector of the direction that the projection created by the feature projects out of the optical center of the camera. This is defined as the the position delta of the feature from the optical center of the camera.
Source§

fn from_bearing_unit_vector( bearing: Unit<Matrix<f64, U3, U1, <DefaultAllocator as Allocator<f64, U3>>::Buffer>>, ) -> Self
where Self: Sized,

Converts a bearing unit vector back into this bearing type. Read more
Source§

impl Clone for NormalizedKeyPoint

Source§

fn clone(&self) -> NormalizedKeyPoint

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for NormalizedKeyPoint

Source§

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

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

impl Deref for NormalizedKeyPoint

Source§

type Target = Point<f64, U2>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for NormalizedKeyPoint

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl From<NormalizedKeyPoint> for Point2<f64>

Source§

fn from(original: NormalizedKeyPoint) -> Self

Converts to this type from the input type.
Source§

impl From<Point<f64, U2>> for NormalizedKeyPoint

Source§

fn from(original: Point2<f64>) -> NormalizedKeyPoint

Converts to this type from the input type.
Source§

impl PartialEq for NormalizedKeyPoint

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 PartialOrd for NormalizedKeyPoint

Source§

fn partial_cmp(&self, other: &NormalizedKeyPoint) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for NormalizedKeyPoint

Source§

impl StructuralPartialEq for NormalizedKeyPoint

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: Copy + PartialEq + Debug + Any,

Source§

fn inlined_clone(&self) -> T

Performance hack: Clone doesn’t get inlined for Copy types in debug mode, so make it inline anyway.
Source§

fn is<T>() -> bool
where T: Scalar,

Tests if Self the same as the type T Read more
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