[][src]Struct opencv::core::KeyPoint

#[repr(C)]pub struct KeyPoint {
    pub pt: Point2f,
    pub size: f32,
    pub angle: f32,
    pub response: f32,
    pub octave: i32,
    pub class_id: i32,
}

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.

Fields

pt: Point2f

coordinates of the keypoints

size: f32

diameter of the meaningful keypoint neighborhood

angle: 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.

response: f32

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

octave: i32

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

class_id: i32

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

Implementations

impl KeyPoint[src]

pub fn default() -> Result<KeyPoint>[src]

the default constructor

pub fn new_point(
    _pt: Point2f,
    _size: f32,
    _angle: f32,
    _response: f32,
    _octave: i32,
    _class_id: i32
) -> Result<KeyPoint>
[src]

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

pub fn new_coords(
    x: f32,
    y: f32,
    _size: f32,
    _angle: f32,
    _response: f32,
    _octave: i32,
    _class_id: i32
) -> Result<KeyPoint>
[src]

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

pub fn hash(self) -> Result<size_t>[src]

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

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()

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

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

pub fn overlap(kp1: KeyPoint, kp2: KeyPoint) -> Result<f32>[src]

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

impl Clone for KeyPoint[src]

impl Copy for KeyPoint[src]

impl Debug for KeyPoint[src]

impl PartialEq<KeyPoint> for KeyPoint[src]

impl StructuralPartialEq for KeyPoint[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.