see the dictionary content from Bag of Words
Hi,
Is it possible to see the dictionary content as visual words from a bow? I found interest points and descriptors of a group of images and clustered them. Now I have a dictionary of visual words which is zero and ones. My question is that is there any way to see the visual words like a piece of image?
Any help would be appreciated.
what exactly did you cluster there ? SIFT descriptors ? did you expect something like this ?
I used SIFT to find interest points and descriptor and Kmean to cluster them. Yes exactly like that picture. Is it possible?
But I think the picture shows before clustering. I also want to see how they clustered!
unfortunately, descriptors are not images, but a kind of histogram.
so maybe you could draw a curve, or a barchart (like in the link above) for the 128 values
(each row in your dictionary Mat corresponds to a SIFT descriptor)
this looks interesting, too:
taken from here
Thanks a lot @berak for the comment
I have an xml file of keypoints and descriptors of 93 images. the file looks like this:
And I also could have 93 pictures like this one: http://vgg.fiit.stuba.sk/wp-uploads/2... Each circle is an unclustered word now (correct?) But the question is that how could I create such histogram from those numbers? It seems complex to me!! Any idea?
the circles are a visualization of the keypoints (position, orientation and response, i guess), not of the descriptors at those places. iirc, there's a drawKeypoints() function for that already builtin. but again, you won't have any kp for your clusters (they're interpolated, right ?)
no real idea for the descriptors, though i personally like that 4x4 square with 8 orientation bins inside. i'm just afraid, that its some work to achieve it, and that it will get quite cluttered, if you have many.
Thanks @berak for your time. exactly drawKeypoints() could draw a circle of keypoints. Each circle is a visualization of the keypoint and when we are talking about BoW each circle is a word, for the dictionary we are going to make later. And of course they are unclustered and before clustering. Am I right or totally wrong :-| I think if I could figure out how data were stored in descriptors it might be possible and helpful to draw a histogram at this level (before clustering) for each image. Do you have any idea how data were stored as descriptors? We already know that each descriptor is a histogram of 4*4 window in 8 direction. But how those 128 element were saved? Next I should find a way to figure out can I see how data were clustered?!....