I am trying to implement KAZE and A-KAZE using Python and OpenCV for Feature Detection and Description on an aerial image.
What is the code?
Also, what descriptor should go along with it for Feature Matching?
I am trying to implement KAZE and A-KAZE using Python and OpenCV for Feature Detection and Description on an aerial image.
What is the code?
Also, what descriptor should go along with it for Feature Matching?
KAZE, as well as some previous state-of-the-art methods such asSIFTandSURF, are Local Feature Descriptors, and in some ways, it shows better performance in both detection and description compared toSIFTdescriptor.A-KAZE, on the other hand, is a Local Binary Descriptor and presents excellent results in terms of speed and performance compared to state-of-the-art methods such as Local Feature Descriptors:SIFT,SURF, andKAZE, and compared to Local Binary Descriptors:ORB, andBRISK.Responding to your question, both of them can go along with it for Feature Matching, although,
A-KAZEdescriptor do not fit appropriately in smaller patches (e.g., smallest images — 32x32 patch), that is, in order to avoid the return of keypoints without descriptors,A-KAZEnormally remove the keypoints.Therefore, the choice between
KAZEandA-KAZEdepends on the context of your application. But, a prioriA-KAZEhas a better performance thanKAZE.In this example, I will show you Feature Detection and Matching with
A-KAZEthrough theFLANNalgorithm using Python and OpenCV.First, load the input image and the image that will be used for training.
In this example, we are using those images:
image1:image2:Note that when importing the images, we use the
flags = cv.IMREAD_GRAYSCALEparameter, because in OpenCV the default color mode setting is BGR. Therefore, to work with Descriptors, we need to convert the color mode pattern from BGR to grayscale.Now we will use the
A-KAZEalgorithm:The features detected by the
A-KAZEalgorithm can be combined to find objects or patterns that are similar between different images.Now we will use the
FLANNalgorithm:And the output will be:
To perform the same example with the
KAZEdescriptor, just initialize this descriptor, changing:To:
To learn more about Detection, Description, and Feature Matching techniques, Local Feature Descriptors, Local Binary Descriptors, and algorithms for Feature Matching, I recommend the following repositories on GitHub: