the problem of Bow algorithm [closed]
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
i guess, you should blame the matcher. can you try, if you get consistent results with the BFMatcher ?
I have tried it,you are right. I am extremely grateful to you for your help,than you!!!!
uff, reminds me to change some of my code, too ;(
thanks a lot. it troubled me the whole afternoon.