Ask Your Question
0

Global image feature implementation

asked 2013-03-14 14:14:29 -0600

Shin gravatar image

Is there any OpenCV implementation of a global image features detector?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2013-03-14 14:47:08 -0600

Your question is kinda vague but, some of the possibilities are:

  • Using the color histogram or the grayscale histogram of an image and match that between images
  • You could use a histogram of oriented gradients by defining gradient directions and match that
  • You could define edges
  • ...

So basically what you want to do is template matching. For that you first define a global descriptor of an image - http://docs.opencv.org/modules/imgproc/doc/histograms.html - http://docs.opencv.org/modules/imgproc/doc/feature_detection.html

Then you match the result of your references with the input images and use a distance metric between both. Best match has closest distance, meaning it is the most equal one.

Google template based matching, you will find tons of examples.

edit flag offensive delete link more

Comments

@StevenPuttemans : Thank you for your answer. I'd like to use a global descriptor for a color image in combination with a global descriptor for a depth image (from which i can get a point cloud) and combine them in a single descriptor vector. My ultimate goal is to feed the descriptor vectors to a support vector machine. For this task, i want the descriptor to be scale and rotation invariant. Any suggestion?

Shin gravatar imageShin ( 2013-03-14 16:33:16 -0600 )edit
1

Good luck with that, there is no existance of a global scale and rotation invariant descriptor. That is why they created local descriptors, because the change in information locally is much smaller than globally. If you really want the global approach with the invariances, you could do a brute force approach, rotating your image over range of angles, then scaling your image over preset range, and apply color histogram based matching. But as I said, the reason why research went on with local feature matchers is this exact point!

StevenPuttemans gravatar imageStevenPuttemans ( 2013-03-15 03:30:35 -0600 )edit
1

answered 2013-03-15 03:55:36 -0600

Guanta gravatar image

updated 2013-03-15 03:56:27 -0600

As Steven pointed out OpenCV doesn't have a global image descriptor. However you can use the local descriptors to form a local one. Please have a look at a previous answer by me at: http://answers.opencv.org/question/8677/image-comparison-with-a-database/#8686 , where you'll find more information how to achieve that. Good luck!

edit flag offensive delete link more

Comments

Guanta, just in an addition to your answer, this is indeed the best way to go, but there are still global descriptors available. Creating a simple intensity histogram of a grayscale image is in fact a global descriptor. Doing this for the RGB images, will get you a color histogram, which is also a global descriptor. However, these global descriptors can be used as local features descriptors also.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-03-15 04:08:48 -0600 )edit
1

Hehe, you are right :) ! I haven't thought about such 'simple' descriptors.

Guanta gravatar imageGuanta ( 2013-03-15 06:29:13 -0600 )edit

Probably since researchers gave up using these techniques like 20 years ago ... global features are only helpfull to further improve local feature detections in select regions.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-03-15 06:42:40 -0600 )edit

@Guanta: Thank you for your answer. Actually the BoW approach using local features was my first thought but I haven't found examples on how to use BoW with multiple kind of features. I'm sorry to ask but could you provide minimal sample code?

Shin gravatar imageShin ( 2013-03-15 07:10:35 -0600 )edit
2

There exist already an example: samples/cpp/bagofwords_classification.cpp . Hope that helps you.

Guanta gravatar imageGuanta ( 2013-03-15 11:24:03 -0600 )edit

@Guanta: thank you. I have seen that example, but i am interested in mixing different kinds of features, combining descriptors from, say, sift AND surf, in single vectors and then getting bow descriptors. Is this approach feasible or i'm saying something wrong ?

Shin gravatar imageShin ( 2013-03-15 11:50:18 -0600 )edit
1

It perfectly possible.

  • Take a feature point.
  • Then apply SIFT descriptor.
  • Store it in a vector.
  • Apply SURF descriptor.
  • Store it behind the SIFT part in the vector.
  • Use the vector for BoW approach.

However, this seams overkill and will slow down the process drastically. Especially since you will need much more storage space for your description vectors.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-03-15 14:35:14 -0600 )edit
1

There exist three other ways to use multiple features in BoW: You can omit the merging of the features but build multiple codebooks for both features and then either compute one descriptor by e.g. a weighted k-means or compute multiple independent histograms (=bow-descriptor) and merge them. Or third: Use the multiple histograms for independent classification and merge the classification results. For Stevens and my first approach the following paper may be interesting for you: http://icmll.buaa.edu.cn/members/jing.yu/YuanYuQinWan.pdf

Guanta gravatar imageGuanta ( 2013-03-16 08:09:36 -0600 )edit

Question Tools

Stats

Asked: 2013-03-14 14:14:29 -0600

Seen: 4,052 times

Last updated: Mar 15 '13