Ask Your Question
0

How can i match KAZE descriptors?

asked 2015-03-23 13:37:02 -0500

matga gravatar image

updated 2015-03-24 02:55:04 -0500

Guanta gravatar image

I tried the demo codes with the AKAZE, and it worked well. But when i want to use KAZE, it gives back this error:

Assertion failed ((type == CV_8U && dtype == CV_32S) || dtype == CV_32F) in cv::batchDistance

I used this:

Ptr<KAZE> kaze = KAZE::create();
kaze->detectAndCompute(img1, noArray(), kpts1, desc1);
kaze->detectAndCompute(img2, noArray(), kpts2, desc2);

BFMatcher matcher(NORM_HAMMING);

And the code gives back error, if i use

matcher.match(desc1, desc2, matches);

or

matcher.knnMatch(desc1, desc2, nn_matches, 2);

Where matches is vector<dmatch> and nn_matches is vector< vector<DMatch> >

Can u tell me, how can i match KAZE descriptors?

edit retag flag offensive close merge delete

Comments

indeed, cerr << kaze->descriptorType() << endl; returns 5 (float). confusing.

so you can't use NORM_HAMMING, but have to use NORM_L2 or similar.

berak gravatar imageberak ( 2015-03-24 04:29:08 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-03-24 05:36:49 -0500

Guanta gravatar image

AKAZE != KAZE . AKAZE computes binary descriptors, thus you'll need HAMMING distance, in contrast to KAZE which computes float descriptors and can be compared with Euclidean distance as berak also commented. Note: both descriptors are also described in two different papers.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-03-23 13:37:02 -0500

Seen: 798 times

Last updated: Mar 24 '15