Feature descriptor extractors

Descriptors describe local image regions and are invariant to image transformations such as rotation, scale or translation. They provide a measure and distance function for a small patch around an interest point. Therefore, whenever the similarity between two image patches needs to be estimated, we compute their descriptors and measure their distance. In OpenCV, the basic Mat type is used to represent a collection of descriptors, where each row is a keypoint descriptor.

There are the following two possibilities to use a feature descriptor extractor:

  • The DescriptorExtractor common interface
  • The algorithm class directly

(See the following diagram where the descriptors used in this chapter are indicated in red color.)

The common interface allows us to switch easily between different algorithms. This can be very useful when choosing an algorithm to solve a problem, as the results of each algorithm can be compared with no effort. On the other hand, depending on the algorithm, there are several parameters that can be tweaked only using its class.

Feature descriptor extractors

2D feature descriptors in OpenCV

The Ptr<DescriptorExtractor> DescriptorExtractor::create(const String& descriptorExtractorType) function creates a new descriptor extractor of the selected type. Descriptors can be grouped in two families: float and binary. Float descriptors store float values in a vector; this can lead to a high memory usage. On the other hand, binary descriptors store binary strings, thus enabling faster processing times and a reduced memory footprint. The current implementation supports the following types:

  • SIFT: This implementation supports the float descriptor
  • SURF: This implementation supports the float descriptor
  • BRIEF: This implementation supports the binary descriptor
  • BRISK: This implementation supports the binary descriptor
  • ORB: This implementation supports the binary descriptor
  • FREAK: This implementation supports the binary descriptor
  • KAZE: This implementation supports the binary descriptor (new in OpenCV 3.0)
  • AKAZE: This implementation supports the binary descriptor (new in OpenCV 3.0)

The other important function of DescriptorExtractor is void DescriptorExtractor::compute(InputArray image, vector<KeyPoint>& keypoints, OutputArray descriptors), which computes the descriptors for a set of keypoints detected in an image on the previous step. There is a variant of the function that accepts an image set.

Tip

Note that it is possible to mix feature detectors and descriptor extractors from different algorithms. However, it is recommended that you use both methods from the same algorithm, as they should fit better together.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset