Try to include comment from @eduardo and @berak

Akaze descriptor with DESCRIPTOR_KAZE_UPRIGHT added
This commit is contained in:
laurentBerger 2015-05-07 22:48:13 +02:00
parent cfcef3ec98
commit 966d50762d

View File

@ -21,8 +21,8 @@ int main(int argc, char *argv[])
vector<String> typeAlgoMatch;
vector<String> fileName;
help();
system("cd");
// This descriptor are going to be detect and compute
typeDesc.push_back("AKAZE-DESCRIPTOR_KAZE_UPRIGHT"); // see http://docs.opencv.org/trunk/d8/d30/classcv_1_1AKAZE.html
typeDesc.push_back("AKAZE"); // see http://docs.opencv.org/trunk/d8/d30/classcv_1_1AKAZE.html
typeDesc.push_back("ORB"); // see http://docs.opencv.org/trunk/de/dbf/classcv_1_1BRISK.html
typeDesc.push_back("BRISK"); // see http://docs.opencv.org/trunk/db/d95/classcv_1_1ORB.html
@ -74,6 +74,9 @@ int main(int argc, char *argv[])
// Descriptor for img1 and img2
Mat descImg1, descImg2;
vector<String>::iterator itMatcher = typeAlgoMatch.end();
if (*itDesc == "AKAZE-DESCRIPTOR_KAZE_UPRIGHT"){
b = AKAZE::create(AKAZE::DESCRIPTOR_KAZE_UPRIGHT);
}
if (*itDesc == "AKAZE"){
b = AKAZE::create();
}
@ -93,6 +96,14 @@ int main(int argc, char *argv[])
// Match method loop
for (itMatcher = typeAlgoMatch.begin(); itMatcher != typeAlgoMatch.end(); itMatcher++){
descriptorMatcher = DescriptorMatcher::create(*itMatcher);
if ((*itMatcher == "BruteForce-Hamming" || *itMatcher == "BruteForce-Hamming(2)") && (b->descriptorType() == CV_32F || b->defaultNorm() <= NORM_L2SQR) )
{
cout << "**************************************************************************\n";
cout << "It's strange. You should use Hamming distance only for a binary descriptor\n";
cout << "**************************************************************************\n";
}
try
{
descriptorMatcher->match(descImg1, descImg2, matches, Mat());
// Keep best matches only to have a nice drawing.
// We sort distance between descriptor matches
@ -131,6 +142,11 @@ int main(int argc, char *argv[])
desMethCmp.push_back(cumSumDist2);
waitKey();
}
catch (Exception& e)
{
desMethCmp.push_back(-1);
}
}
}
catch (Exception& e)
{
@ -139,11 +155,12 @@ int main(int argc, char *argv[])
{
cout << "Matcher : " << *itMatcher << "\n";
}
cout<<e.msg<<endl;
cout << e.msg << endl;
}
}
int i=0;
cout << "Cumulative distance between keypoint match for different algorithm and feature detector \n\t";
cout << "We cannot say which is the best but we can say results are differents! \n\t";
for (vector<String>::iterator itMatcher = typeAlgoMatch.begin(); itMatcher != typeAlgoMatch.end(); itMatcher++)
{
cout<<*itMatcher<<"\t";