Detects keypoints and computes their descriptors
[keypoints, descriptors] = obj.detectAndCompute(img)
[...] = obj.detectAndCompute(..., 'OptionName',optionValue, ...)
Input
- img Image, input 8-bit grayscale image.
Output
- keypoints The detected keypoints. A 1-by-N structure array
with the following fields:
- pt coordinates of the keypoint
[x,y]
- size diameter of the meaningful keypoint neighborhood
- angle computed orientation of the keypoint (-1 if not
applicable); it's in [0,360) degrees and measured relative
to image coordinate system (y-axis is directed downward),
i.e in clockwise.
- response the response by which the most strong keypoints
have been selected. Can be used for further sorting or
subsampling.
- octave octave (pyramid layer) from which the keypoint
has been extracted.
- class_id object class (if the keypoints need to be
clustered by an object they belong to).
- descriptors Computed descriptors. Output concatenated
vectors of descriptors. Each descriptor is a 128-element
vector, as returned by cv.AffineFeature2D.descriptorSize, so
the total size of descriptors will be
numel(keypoints) * obj.descriptorSize()
. A matrix of size
N-by-128 of class single
, one row per keypoint.
Options
- Mask optional mask specifying where to look for keypoints.
Not set by default.
- Keypoints If passed, then the method will use the provided
vector of keypoints instead of detecting them, and the
algorithm just computes their descriptors.