Ask Your Question
1

Is there a way of using ORB with BOW?

asked 2013-12-02 00:51:52 -0500

andrei.toader gravatar image

Hi all,

Someone happens to know a way of using BOWImgDescriptor with ORB?. Any solution is well received. I read the following link but no solution or workaround is provided. http://answers.opencv.org/question/17460/how-to-use-bag-of-words-example-with-brief/

Thanks in advance.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
4

answered 2013-12-02 08:35:32 -0500

Guanta gravatar image

The link you posted, gives one possibilty to solve the issue of binary descriptors by simple conversion to float (CV_32F) and relies on the fact that OpenCV's k-means algorithm can only deal with CV_32F and uses L2-distance for comparison. Thus, the binary descriptors may however also cluster in a wrong way (since actually you want to have a Hamming distance measure)!

Possibilities to circumvent this (however doesn't use the BOWImgDescriptor):

  • Use flann's k-means (HierarchicalClusteringIndexParams, see manual at http://www.cs.ubc.ca/research/flann/), it can deal with binary features, however also needs you to convert the data to float (maybe I am wrong with this), at least the output are means in float again, which you need to convert to binary then.
  • Code yourself a k-means which can deal with it or implement a k-medoids algorithm, like PAM, see http://en.wikipedia.org/wiki/K-medoids. K-means/median/medoids is not that complicated.
edit flag offensive delete link more

Comments

Good answer. I was thinking about modifying the K-Means some time ago, too, but for now I need a quick workaround. My thoughts were to dig a bit into Opencv and try to use my own implementations of K-Means and BOWImgDescriptor (or a way to modify what I need) but this will require too much time and what I did so far exceeds the Master thesis boundaries. I posted this message in the hope that maybe I missed something that can solve this problem quick.
However, good insight and thanks again.

andrei.toader gravatar imageandrei.toader ( 2013-12-02 10:04:23 -0500 )edit

You are welcome. One other note: flann is actually part of OpenCV (not the most recent version though), so maybe the change is not that dramatically, actually you only need to derive from the BoWTrainer class and implement the cluster() method, here you can just call flann. So maybe not too much work after all...

Guanta gravatar imageGuanta ( 2013-12-02 11:01:22 -0500 )edit

Thanks again. I will give it a thought these days when I will catch some time(working also).

andrei.toader gravatar imageandrei.toader ( 2013-12-02 15:16:45 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2013-12-02 00:51:52 -0500

Seen: 4,061 times

Last updated: Dec 02 '13