Keypoint

class Keypoint

The Keypoint class is the base class that stores various information of a keypoint, which includes

  • Vec2f coords_ is the position of the keypoint;
  • unsigned int index_ is the image index that the specific keypoint is detected;
  • Vec3i color_ is the color information of the keypoint;
  • double scale_ is the scale of the keypoint;
  • double orientation_ is the orientation of the keypoint;
const Vec2f &coords() const;
Vec2f& coords();
const unsigned int& index() const;
unsigned int& index();
const Vec3i& color() const;
Vec3i& color();
const double& scale() const;
double& scale();
const int has_scale() const;
const double& orientation() const;
double& orientation();
const int has_orientation() const;

methods to retrieve information of a keypoint.

Detector

class Detector

The Detector class is the base class of various feature detection algorithms, which must be extended to implement the specific detectors. open3DCV uses polymorphism so that the type of detector used is determined during run-time.

virtual int detect_keypoints(const Image& image, vector<Keypoint>& keypoints, int verbose = 0) = 0;

a pure virtual method that must be implemented in the sub-classes, which is responsible for feature detection.

SIFT detector

class Sift

The Sift class implements the SIFT detector. I use the amazing open source library VLFeat.

  • vl_sift_pix* data_ stores the image data, which is the data structure used by VLFeat, which is converted from the Image class;
  • VlSiftFilt* sift_filter_ is the SIFT filter, which implements the SIFT detector and descriptor;
  • Sift_Params is a class that is used to store the SIFT parameters
  • width_, height_, channel_ store image information.
int detect_keypoints(const Image& image, vector<Keypoint>& keypoint, int verbose = 0);

a wrapper method that uses the SIFT detector in VLFeat.

Descriptor

class Descriptor

The Descriptor class is the base class for feature description extraction algorithms, which must be extended by any description extractor.

virtual int extract_descriptor(const Image& image, const Keypoint& keypoint, Vecf& descriptor) = 0;
virtual int extract_descriptors(const Image& image, vector<Keypoint>& keypoints, vector<Vecf>& descriptors);

pure virtual methods that must be implemented in sub-classes, which are responsible for extracting descriptions.

SIFT descriptor

class Sift

int extract_descriptor(const Image& image, const Keypoint& keypoint, Vecf& descriptor);
int extract_descriptors(const Image& image, vector<Keypoint>& keypoints, vector<Vecf>& descriptors);

wrapper methods that use the SIFT descriptor to extract description(s) from feature(s).

void convert_root_sift(Vecf& descriptor);

method that converts the traditional SIFT descriptor to RootSIFT descriptor, which is proven to provide better matches in “Three things everyone should know to improve object retrieval” by Arandjelovic and Zisserman.