Ask Your Question

VizGhar's profile - activity

2014-04-23 12:13:00 -0600 received badge  Supporter (source)
2014-04-15 14:32:15 -0600 received badge  Scholar (source)
2014-04-15 14:32:08 -0600 commented answer Print histogram values for image in BOW

Sorry for later response. Many thanks, Just one more question... I want values that shows visual word frequencies (first word occured n-times) not normalized values. Can you tell me how to do it?

2014-04-10 11:56:12 -0600 asked a question Print histogram values for image in BOW

Hi.

I'm working on Bag of words program. I have extracted descriptors for each image via SiftFeatureDetector and SiftDescriptorExtractor into BOWKMeansTrainer as follows:

featureDetector->detect(image, keypoints);
descriptorExtractor->compute(image, keypoints, descriptors);
bowTrainer.add(descriptors);

and runs BOWKMeansTrainer::cluster() and BOWImgDescriptorExtractor::setVocabulary() after. Then I want to see how does the histograms computed via BOWImgDescriptorExtractor looks like for some of the images (reduced code):

bowDE->compute(image, keypoints, histogram);
for (int i = 0; i < histogram.cols; i++)
    cout << histogram.at<unsigned>(0, i) << ",";

Result looks like:

{[0,997286537,988897929,1001720295,0,0,1014063753,0, ...]}

(rows=1, cols=count_of_visual_words) So there are either zeros or really huge numbers. Maybe I didn't understand something. How can I correctly print histogram values for given image?