Class cv::KeyPoint#
Data structure for salient point detectors. View details
#include <opencv2/core/types.hpp>Collaboration diagram for cv::KeyPoint:
Detailed 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.
Constructor & Destructor Documentation#
KeyPoint()#
Python:
the default constructor
KeyPoint()#
cv::KeyPoint::KeyPoint(
float x,
float y,
float size,
float angle = -1,
float response = 0,
int octave = 0,
int class_id = -1 )
Python:
Parameters
x— x-coordinate of the keypointy— y-coordinate of the keypointsize— keypoint diameterangle— keypoint orientationresponse— keypoint detector response on the keypoint (that is, strength of the keypoint)octave— pyramid octave in which the keypoint has been detectedclass_id— object id
KeyPoint()#
cv::KeyPoint::KeyPoint(
Point2f pt,
float size,
float angle = -1,
float response = 0,
int octave = 0,
int class_id = -1 )
Python:
Parameters
pt— x & y coordinates of the keypointsize— keypoint diameterangle— keypoint orientationresponse— keypoint detector response on the keypoint (that is, strength of the keypoint)octave— pyramid octave in which the keypoint has been detectedclass_id— object id
Member Function Documentation#
hash()#
size_t cv::KeyPoint::hash()
convert()#
static void cv::KeyPoint::convert(
const std::vector< KeyPoint > & keypoints,
std::vector< Point2f > & points2f,
const std::vector< int > & keypointIndexes = std::vector< int >() )
Python:
cv.KeyPoint.convert(keypoints[, keypointIndexes]) -> points2f
cv.KeyPoint.convert(points2f[, size[, response[, octave[, class_id]]]]) -> keypoints
cv.KeyPoint_convert(keypoints[, keypointIndexes]) -> points2f
cv.KeyPoint_convert(points2f[, size[, response[, octave[, class_id]]]]) -> keypoints
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/ORBpoints2f— Array of (x,y) coordinates of each keypointkeypointIndexes— Array of indexes of keypoints to be converted to points. (Acts like a mask to convert only specified keypoints)
convert()#
static void cv::KeyPoint::convert(
const std::vector< Point2f > & points2f,
std::vector< KeyPoint > & keypoints,
float size = 1,
float response = 1,
int octave = 0,
int class_id = -1 )
Python:
cv.KeyPoint.convert(keypoints[, keypointIndexes]) -> points2f
cv.KeyPoint.convert(points2f[, size[, response[, octave[, class_id]]]]) -> keypoints
cv.KeyPoint_convert(keypoints[, keypointIndexes]) -> points2f
cv.KeyPoint_convert(points2f[, size[, response[, octave[, class_id]]]]) -> keypoints
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Parameters
points2f— Array of (x,y) coordinates of each keypointkeypoints— Keypoints obtained from any feature detection algorithm like SIFT/SURF/ORBsize— keypoint diameterresponse— keypoint detector response on the keypoint (that is, strength of the keypoint)octave— pyramid octave in which the keypoint has been detectedclass_id— object id
overlap()#
static float cv::KeyPoint::overlap(
const KeyPoint & kp1,
const KeyPoint & kp2 )
Python:
cv.KeyPoint.overlap(kp1, kp2) -> retval
cv.KeyPoint_overlap(kp1, kp2) -> retval
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 keypointkp2— Second keypoint
Member Data Documentation#
angle#
float cv::KeyPoint::angle
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.
class_id#
int cv::KeyPoint::class_id
object class (if the keypoints need to be clustered by an object they belong to)
octave#
int cv::KeyPoint::octave
octave (pyramid layer) from which the keypoint has been extracted
pt#
Point2f cv::KeyPoint::pt
coordinates of the keypoints
response#
float cv::KeyPoint::response
the response by which the most strong keypoints have been selected. Can be used for the further sorting or subsampling
size#
float cv::KeyPoint::size
diameter of the meaningful keypoint neighborhood
Source file#
The documentation for this class was generated from the following file:
opencv2/core/types.hpp