Struct opencv::core::KeyPoint

source ·
pub struct KeyPoint { /* private fields */ }
Expand description

Data structure for salient point detectors.

The class instance stores a keypoint, i.e. a point feature found by one of many available keypoint detectors, such as Harris corner detector, #FAST, %StarDetector, %SURF, %SIFT etc.

The keypoint is characterized by the 2D position, scale (proportional to the diameter of the neighborhood that needs to be taken into account), orientation and some other parameters. The keypoint neighborhood is then analyzed by another algorithm that builds a descriptor (usually represented as a feature vector). The keypoints representing the same object in different images can then be matched using %KDTree or another method.

Implementations§

source§

impl KeyPoint

source

pub fn default() -> Result<KeyPoint>

the default constructor

source

pub fn new_point( pt: Point2f, size: f32, angle: f32, response: f32, octave: i32, class_id: i32 ) -> Result<KeyPoint>

Parameters
  • pt: x & y coordinates of the keypoint
  • size: keypoint diameter
  • angle: keypoint orientation
  • response: keypoint detector response on the keypoint (that is, strength of the keypoint)
  • octave: pyramid octave in which the keypoint has been detected
  • class_id: object id
C++ default parameters
  • angle: -1
  • response: 0
  • octave: 0
  • class_id: -1
source

pub fn new_coords( x: f32, y: f32, size: f32, angle: f32, response: f32, octave: i32, class_id: i32 ) -> Result<KeyPoint>

Parameters
  • x: x-coordinate of the keypoint
  • y: y-coordinate of the keypoint
  • size: keypoint diameter
  • angle: keypoint orientation
  • response: keypoint detector response on the keypoint (that is, strength of the keypoint)
  • octave: pyramid octave in which the keypoint has been detected
  • class_id: object id
C++ default parameters
  • angle: -1
  • response: 0
  • octave: 0
  • class_id: -1
source

pub fn convert( keypoints: &Vector<KeyPoint>, points2f: &mut Vector<Point2f>, keypoint_indexes: &Vector<i32> ) -> Result<()>

This method converts vector of keypoints to vector of points or the reverse, where each keypoint is assigned the same size and the same orientation.

Parameters
  • keypoints: Keypoints obtained from any feature detection algorithm like SIFT/SURF/ORB
  • points2f: Array of (x,y) coordinates of each keypoint
  • keypointIndexes: Array of indexes of keypoints to be converted to points. (Acts like a mask to convert only specified keypoints)
C++ default parameters
  • keypoint_indexes: std::vector()
source

pub fn convert_to( points2f: &Vector<Point2f>, keypoints: &mut Vector<KeyPoint>, size: f32, response: f32, octave: i32, class_id: i32 ) -> Result<()>

This method converts vector of keypoints to vector of points or the reverse, where each keypoint is assigned the same size and the same orientation.

Parameters
  • keypoints: Keypoints obtained from any feature detection algorithm like SIFT/SURF/ORB
  • points2f: Array of (x,y) coordinates of each keypoint
  • keypointIndexes: Array of indexes of keypoints to be converted to points. (Acts like a mask to convert only specified keypoints)
Overloaded parameters
  • points2f: Array of (x,y) coordinates of each keypoint
  • keypoints: Keypoints obtained from any feature detection algorithm like SIFT/SURF/ORB
  • size: keypoint diameter
  • response: keypoint detector response on the keypoint (that is, strength of the keypoint)
  • octave: pyramid octave in which the keypoint has been detected
  • class_id: object id
C++ default parameters
  • size: 1
  • response: 1
  • octave: 0
  • class_id: -1
source

pub fn overlap(kp1: &KeyPoint, kp2: &KeyPoint) -> Result<f32>

This method computes overlap for pair of keypoints. Overlap is the ratio between area of keypoint regions’ intersection and area of keypoint regions’ union (considering keypoint region as circle). If they don’t overlap, we get zero. If they coincide at same location with same size, we get 1.

Parameters
  • kp1: First keypoint
  • kp2: Second keypoint

Trait Implementations§

source§

impl Boxed for KeyPoint

source§

unsafe fn from_raw(ptr: *mut c_void) -> Self

Wrap the specified raw pointer Read more
source§

fn into_raw(self) -> *mut c_void

Return an the underlying raw pointer while consuming this wrapper. Read more
source§

fn as_raw(&self) -> *const c_void

Return the underlying raw pointer. Read more
source§

fn as_raw_mut(&mut self) -> *mut c_void

Return the underlying mutable raw pointer Read more
source§

impl Clone for KeyPoint

source§

fn clone(&self) -> Self

Returns a copy 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 Drop for KeyPoint

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<Elliptic_KeyPoint> for KeyPoint

source§

fn from(s: Elliptic_KeyPoint) -> Self

Converts to this type from the input type.
source§

impl KeyPointTrait for KeyPoint

source§

fn as_raw_mut_KeyPoint(&mut self) -> *mut c_void

source§

fn set_pt(&mut self, val: Point2f)

coordinates of the keypoints
source§

fn set_size(&mut self, val: f32)

diameter of the meaningful keypoint neighborhood
source§

fn set_angle(&mut self, val: f32)

computed orientation of the keypoint (-1 if not applicable); it’s in [0,360) degrees and measured relative to image coordinate system, ie in clockwise.
source§

fn set_response(&mut self, val: f32)

the response by which the most strong keypoints have been selected. Can be used for the further sorting or subsampling
source§

fn set_octave(&mut self, val: i32)

octave (pyramid layer) from which the keypoint has been extracted
source§

fn set_class_id(&mut self, val: i32)

object class (if the keypoints need to be clustered by an object they belong to)
source§

impl KeyPointTraitConst for KeyPoint

source§

fn as_raw_KeyPoint(&self) -> *const c_void

source§

fn pt(&self) -> Point2f

coordinates of the keypoints
source§

fn size(&self) -> f32

diameter of the meaningful keypoint neighborhood
source§

fn angle(&self) -> f32

computed orientation of the keypoint (-1 if not applicable); it’s in [0,360) degrees and measured relative to image coordinate system, ie in clockwise.
source§

fn response(&self) -> f32

the response by which the most strong keypoints have been selected. Can be used for the further sorting or subsampling
source§

fn octave(&self) -> i32

octave (pyramid layer) from which the keypoint has been extracted
source§

fn class_id(&self) -> i32

object class (if the keypoints need to be clustered by an object they belong to)
source§

fn hash(&self) -> Result<size_t>

source§

impl Send for KeyPoint

source§

impl VectorElement for KeyPointwhere Vector<KeyPoint>: VectorExtern<KeyPoint>,

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.