OpenCV encapsulates some feature descriptor extraction algorithms, which enable users to solve the problem easily using a variety of algorithms. This chapter is used to compute the expression of the vector vectors expressed as a high-dimensional space. All the parts that implement the Vector feature description sub-extract inherit the Descriptorextractor interface. Descriptorextractor class Descriptorextractor
Abstract base class for calculating feature descriptors for image-critical points.
Class Cv_exports Descriptorextractor
{public
:
virtual ~descriptorextractor ();
void Compute (const mat& image, vector<keypoint>& keypoints,
mat& descriptors) const;
void Compute (const vector<mat>& images, vector<vector<keypoint> >& keypoints,
vector <Mat>& descriptors) const;
virtual void read (const filenode&);
virtual void Write (filestorage&) const;
virtual int descriptorsize () const = 0;
virtual int Descriptortype () const = 0;
Static ptr<descriptorextractor> Create (const string& descriptorextractortype);
Protected:
...
};
In this interface, a feature descriptor of a key point can be expressed as a dense (dense) vector of fixed dimensions. Most of the feature descriptors are calculated at each pixel in this pattern. The set of feature descriptors is expressed as Mat, where each row is a key feature descriptor. Descriptorextractor::compute
Computes the descriptor based on the detected image (the first case) or the key point (the detector) in the image set (the second case). C + +: void Descriptorextractor:: Compute (const mat& image, vector<keypoint>& keypoints, mat& DESCRI ptors) Const C + +: void Descriptorextractor:: Compute (const vector<mat>& images, Vector<vector<keypoi nt>>& keypoints, vector<mat>& descriptors) const parameters:image– image. images– image set.
:p Aram Keypoints: The characteristic key point of the input. The key point that cannot be computed by a feature descriptor is skipped. In addition some new feature key points are added, such as: SIFT adds several key points in the main direction of the feature. parameters:descriptors– the computational feature descriptor. In the second variant of the "method Descriptors[i] are descriptors computed for a keypoints[i] '. Row ' J is the keypoints (or keypoints[i]) are the descriptor for KeyPoint j-th KeyPoint. Descriptorextractor::read
Reads the object extracted from the feature description child from the file point. C + +: void Descriptorextractor:: Read (const filenode& fn) parameters:fn– read file point. Descriptorextractor::write
Writes the extracted object of the feature descriptor to the file. C + +: void Descriptorextractor:: Write (filestorage& FS) const parameters:fs– a file written by. Descriptorextractor::create
Creates a feature descriptor extraction based on the name. C + +: ptr<descriptorextractor> descriptorextractor:: Create (const string& descriptorextractortype) Paramete Rs:descriptorextractortype–descriptor Extractor type.
Existing implementations support the following types of feature descriptor extraction methods: "SIFT" –siftdescriptorextractor "SURF" –surfdescriptorextractor "ORB" – Orbdescriptorextractor "BRIEF" –briefdescriptorextractor
A combined format is also supported:descriptor Extractor adapter name ("opponent" –opponentcolordescriptorextractor) + Descriptor Extractor Name (click above) for example: "Opponentsift".