Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

detail::FeaturesMatcher

how to use detail::FeaturesMatcher ?

vector<mat> vec_im; Mat im1= imread("001_001.PNG"); Mat im2= imread("001_002.PNG"); vec_im.push_back(im1); vec_im.push_back(im2);

int64 t = getTickCount();
Ptr<FeaturesFinder> finder;
finder = new SurfFeaturesFinder();

vector<ImageFeatures> vec_features;

for(int i=0;i<vec_im.size();++i)
{
    ImageFeatures t;
    (*finder)(vec_im[i],t);
    t.img_idx = i;
    vec_features.push_back(t);
}
finder->collectGarbage(); //?

vector<CPair> vec_pairs;
int k=0;
for(int i=0;i<vec_features.size();++i)
{
    ++k;
    for(int j=k;j<vec_features.size();++j)
    {
        Ptr<FeaturesMatcher> matcher;
        MatchesInfo matches;
        (*matcher)(vec_features[i],vec_features[j],matches); //don't work!
        CPair t;
        t.first= i;
        t.second= j;
        vec_pairs.push_back(t);
    }
}

detail::FeaturesMatcher

how to use detail::FeaturesMatcher ?

vector<mat>

vector<Mat> vec_im;
    Mat im1= imread("001_001.PNG");
    Mat im2= imread("001_002.PNG");
    vec_im.push_back(im1);
    vec_im.push_back(im2);

vec_im.push_back(im2);

    int64 t = getTickCount();
 Ptr<FeaturesFinder> finder;
 finder = new SurfFeaturesFinder();

 vector<ImageFeatures> vec_features;

 for(int i=0;i<vec_im.size();++i)
 {
     ImageFeatures t;
     (*finder)(vec_im[i],t);
     t.img_idx = i;
     vec_features.push_back(t);
 }
 finder->collectGarbage(); //?

 vector<CPair> vec_pairs;
 int k=0;
 for(int i=0;i<vec_features.size();++i)
 {
     ++k;
     for(int j=k;j<vec_features.size();++j)
     {
         Ptr<FeaturesMatcher> matcher;
         MatchesInfo matches;
         (*matcher)(vec_features[i],vec_features[j],matches); //don't work!
         CPair t;
         t.first= i;
         t.second= j;
         vec_pairs.push_back(t);
     }
 }