Ask Your Question

martin_zx's profile - activity

2017-05-09 06:10:17 -0600 commented question the problem of Bow algorithm

thanks a lot. it troubled me the whole afternoon.

2017-05-09 05:38:49 -0600 commented question the problem of Bow algorithm

I have tried it,you are right. I am extremely grateful to you for your help,than you!!!!

2017-05-09 04:39:29 -0600 received badge  Student (source)
2017-05-09 04:13:08 -0600 asked a question the problem of Bow algorithm
 for(i=0;i<3;i++)
     for(j=0;j<3;j++)     
{
       Mat dictionary;
       Mat cfile=("lema.jpg", CV_LOAD_IMAGE_GRAYSCALE)
    float f=0;
    float ID=0;
    float * value = new float[2];
    FileStorage fs("dictionary_k2000.yml", FileStorage::READ); 
    fs["vocabulary"] >> dictionary;
    fs.release();
    Ptr<DescriptorMatcher> matcher(new FlannBasedMatcher);
    Ptr<FeatureDetector> detector(new SiftFeatureDetector());
    Ptr<DescriptorExtractor> extractor(new SiftDescriptorExtractor);
    BOWImgDescriptorExtractor bowDE(extractor,matcher);
    bowDE.setVocabulary(dictionary);
    vector<KeyPoint> keyPoints; 
    detector->detect(cfile, keyPoints ); 
    Mat imageDescriptor; 
    bowDE.compute( cfile, keyPoints, imageDescriptor );  
}

the imageDescriptor gotten in each loop is different, two parameters of bowDE.compute "cfile" and "keyPoints" are the same , why ? how to solve this problem