Image.ComboFeature#

Image.ComboFeature(detector: str, descriptor: str, det_opts: dict[str, Any] | None = None, des_opts: dict[str, Any] | None = None, nfeat: int | None = None, id: str | int = 'image') → BaseFeature2D[source]#

Find features using one algorithm to detect and another to describe

Parameters:
  • detector – name of the detector, one of "FAST", "AGAST", "GFTT", "Harris", "SIFT", "ORB", "BRISK" or "AKAZE"

  • descriptor – name of the descriptor, one of "SIFT", "ORB", "BRISK", "AKAZE", "FREAK", "BRIEF", "DAISY", "LATCH", "LUCID" or "BOOST"

  • det_opts – options passed to the detector, defaults to None

  • des_opts – options passed to the descriptor, defaults to None

  • nfeat – keep at most this many of the strongest keypoints, defaults to None, which keeps all of them. A few can be lost, because a descriptor needs a margin of image around a keypoint

  • id – what to put in each keypoint’s id: "image" (the image id), "index" (0, 1, …) or an int, defaults to "image"

Raises:

ValueError – unknown detector or descriptor, a pair that cannot be combined, or a descriptor that needs a color image given a greyscale one

Returns:

set of 2D point features

Return type:

BaseFeature2D subclass

Detect keypoints with detector and describe each one with descriptor. Most detectors, such as FAST, find corners but give no description of them, and most descriptors, such as BRIEF, describe the image around a keypoint but do not find one. This method joins any detector to almost any descriptor. There are 8 detectors and 10 descriptors, which is 73 combinations that work out of 80:

descriptor

detector

FAST

AGAST

GFTT

Harris

SIFT

ORB

BRISK

AKAZE

SIFT

✓

✓

✓

✓

✔

✓

✓

✓

ORB

✓

✓

✓

✓

1

✔

✓

✓

BRISK

✓

✓

✓

✓

✓

✓

✔

✓

AKAZE

✔

FREAK

✓

✓

✓

✓

✓

✓

✓

✓

BRIEF

✓

✓

✓

✓

✓

✓

✓

✓

DAISY

✓

✓

✓

✓

✓

✓

✓

✓

LATCH

✓

✓

✓

✓

✓

✓

✓

✓

LUCID

2

2

2

2

2

2

2

2

BOOST

✓

✓

✓

✓

✓

✓

✓

✓

The columns are the detectors and the rows are the descriptors. In the table,

  • ✓ is a combination that works

  • ✔ is a combination that works, and is an algorithm that defines both a detector and a descriptor, for example SIFT

  • an empty cell is a combination that cannot be made. The AKAZE descriptor uses information that only the AKAZE detector records in its keypoints, so it cannot be used with another detector.

  1. The ORB descriptor reads a pyramid level from each keypoint, which the SIFT detector uses for something else. For SIFT keypoints it is set to the full resolution image, so the ORB descriptor ignores their scale and has no scale invariance.

  2. The LUCID descriptor describes a color patch, so it needs a color image.

A set of features can also provide the scale, orientation and strength (the detector’s response) of each keypoint. This depends on the detector, as in this table, where ✓ means that it does:

provides

detector

FAST

AGAST

GFTT

Harris

SIFT

ORB

BRISK

AKAZE

position

✓

✓

✓

✓

✓

✓

✓

✓

scale

✓

✓

✓

✓

orientation

3

3

3

3

✓

✓

✓

✓

strength

✓

✓

✓

✓

✓

✓

✓

✓

  1. The detector does not provide orientation, but the BRISK and FREAK descriptors compute orientation internally.

The result is a set of the class of the descriptor, for example BRIEFFeature, and can be matched with another set made with the same descriptor. The detector can differ, and the descriptors of the two sets must be of the same kind.

Examples

>>> from machinevisiontoolbox import Image
>>> img = Image.Read("eiffel-1.png")
>>> features = img.ComboFeature("FAST", "BRIEF", nfeat=500)
>>> print(features)
FAST+BRIEF features, 462 points
>>> len(features)
462
>>> features.descriptor.shape
(462, 32)

References

  • Comparison of the detectors and descriptors: Performance analysis of keypoint detectors and binary descriptors under varying degrees of photometric and geometric transformations. Shuvo Kumar Paul, Pourya Hoseini, Mircea Nicolescu and Monica Nicolescu. arXiv:2012.04135, 2020.

  • AGAST: Adaptive and generic corner detection based on the accelerated segment test. Elmar Mair, Gregory D. Hager, Darius Burschka, Michael Suppa and Gerhard Hirzinger. In European Conference on Computer Vision (ECCV), 2010.

  • AKAZE: Fast explicit diffusion for accelerated features in nonlinear scale spaces. Pablo F. Alcantarilla, Jesús Nuevo and Adrien Bartoli. IEEE Trans. Pattern Anal. Machine Intell., 34(7):1281–1298, 2011.

  • BOOST: Boosting binary keypoint descriptors. Tomasz Trzcinski, Mario Christoudias, Vincent Lepetit and Pascal Fua. In Computer Vision and Pattern Recognition (CVPR), 2013. Also: Learning image descriptors with boosting. Tomasz Trzcinski, Mario Christoudias and Vincent Lepetit. IEEE Trans. Pattern Anal. Machine Intell., 2013.

  • BRIEF: Binary robust independent elementary features. Michael Calonder, Vincent Lepetit, Christoph Strecha and Pascal Fua. In European Conference on Computer Vision (ECCV), pages 778–792, 2010.

  • BRISK: Binary robust invariant scalable keypoints. Stefan Leutenegger, Margarita Chli and Roland Yves Siegwart. In International Conference on Computer Vision (ICCV), pages 2548–2555, 2011.

  • DAISY: An efficient dense descriptor applied to wide baseline stereo. Engin Tola, Vincent Lepetit and Pascal Fua. IEEE Trans. Pattern Anal. Machine Intell., 32(5):815–830, May 2010.

  • FAST: Machine learning for high-speed corner detection. Edward Rosten and Tom Drummond. In European Conference on Computer Vision (ECCV), pages 430–443, 2006.

  • FREAK: Fast retina keypoint. Alexandre Alahi, Raphael Ortiz and Pierre Vandergheynst. In Computer Vision and Pattern Recognition (CVPR), pages 510–517, 2012.

  • GFTT: Good features to track. Jianbo Shi and Carlo Tomasi. In Computer Vision and Pattern Recognition (CVPR), pages 593–600, 1994.

  • Harris: A combined corner and edge detector. CG Harris and MJ Stephens. Proceedings of the Fourth Alvey Vision Conference, Manchester, pages 147–151, 1988.

  • LATCH: Learned arrangements of three patch codes. Gil Levi and Tal Hassner. arXiv:1501.03719, 2015.

  • LUCID: Locally uniform comparison image descriptor. Andrew Ziegler, Eric Christiansen, David Kriegman and Serge J. Belongie. In Advances in Neural Information Processing Systems (NIPS), 2012.

  • ORB: An efficient alternative to SIFT or SURF. Ethan Rublee, Vincent Rabaud, Kurt Konolige and Gary Bradski. In International Conference on Computer Vision (ICCV), pages 2564–2571, 2011.

  • SIFT: Distinctive image features from scale-invariant keypoints. David G. Lowe. Int. J. Comput. Vision, 60(2):91–110, November 2004.

Added in version 2.5.0.

See also

BOOSTFeature BRIEFFeature DAISYFeature FREAKFeature LATCHFeature LUCIDFeature