Computes the descriptors for a set of keypoints detected in an image or image set
[descriptors, keypoints] = extractor.compute(img, keypoints)
[descriptors, keypoints] = extractor.compute(imgs, keypoints)
Input
- img Image (first variant).
- imgs Image set (second variant), cell array of images.
- keypoints Input collection of keypoints. Keypoints for
which a descriptor cannot be computed are removed and the
remaining ones may be reordered. Sometimes new keypoints can
be added, for example: cv.SIFT duplicates keypoint with
several dominant orientations (for each orientation). In the
first variant, this is a struct-array of detected keypoints.
the second variant, it is a cell-array, where
keypoints{i}
is a set of keypoints detected in images{i}
(a struct-array
like before). Each keypoint is a struct 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).
Output
- descriptors Computed descriptors. In the second variant of
the method
descriptors{i}
are descriptors computed for a
keypoints{i}
. Row j
in descriptors
(or descriptors{i}
)
is the descriptor for j
-th keypoint.
- keypoints Optional output with possibly updated keypoints.