cout<<"\n This program demonstrates how to detect compute and match ORB BRISK and AKAZE descriptors \n"
"Usage: \n"
" ./matchmethod_orb_akaze_brisk <image1(../data/basketball1.png as default)> <image2(../data/basketball2.png as default)>\n"
"Press a key when image window is active to change algorithm or descriptor";
}
intmain(void)
intmain(intargc,char*argv[])
{
vector<String>typeDesc;
vector<String>typeAlgoMatch;
vector<String>fileName;
help();
// This descriptor are going to be detect and compute
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
// This algorithm would be used to match descriptors see http://docs.opencv.org/trunk/db/d39/classcv_1_1DescriptorMatcher.html#ab5dc5036569ecc8d47565007fa518257
typeAlgoMatch.push_back("BruteForce");
typeAlgoMatch.push_back("BruteForce-L1");
typeAlgoMatch.push_back("BruteForce-Hamming");
typeAlgoMatch.push_back("BruteForce-Hamming(2)");
if(argc==1)
{
fileName.push_back("../data/basketball1.png");
fileName.push_back("../data/basketball2.png");
}
elseif(argc==3)
{
fileName.push_back(argv[1]);
fileName.push_back(argv[2]);
}
else
{
help();
return(0);
}
Matimg1=imread(fileName[0],IMREAD_GRAYSCALE);
Matimg2=imread(fileName[1],IMREAD_GRAYSCALE);
if(img1.rows*img1.cols<=0)
{
cout<<"Image "<<fileName[0]<<" is empty or cannot be found\n";
return(0);
}
if(img2.rows*img2.cols<=0)
{
cout<<"Image "<<fileName[1]<<" is empty or cannot be found\n";