7

I am relatively a newbie to computer vision and now currently doing a learning project on shape detection where I have a fixed region of interest(ROI) in all the images where the object is most likely present and I have to compare their shapes to give whether the object present in two input images are same or not.There are slight translational and scale changes and illumination changes.

I am trying to compare the shape of the object between two input images and trying to provide an output value describing their similarity. If the similarity is above a certain threshold, I can tell that the same object is present in both input images.

I have tried contours, but it does not give reliable results(thresholding either gives too many details or misses some vital details) and doesn't generalize well to all images. I am thinking of using global shape descriptors like HOG.

But I have problems with understanding the feature vector values from the HOG descriptor. How to compare HOG feature vectors(1D) for the two input images to find similarity without using SVM or machine learning? What is the best way to compare HOG feature vectors?

I don't understand how the distance measures work for comparing the future vectors. I want to understand the physical meaning of how distances are used to compare feature vectors and histograms? How to use them to compare HOG feature vectors?

Sakthi Geek
  • 391
  • 4
  • 10
  • 1
    What is the reason for downvoting this question? There is no reasonable answer to this question on HOG anywhere on the web as far as I searched. Further, the answers would be very helpful for newbies like me who want to work with shape descriptors. Kindly answer the question if you have knowledge in this subject. Thank you – Sakthi Geek Dec 18 '17 at 10:14

1 Answers1

6

Sorry, your question is actually hard to understand. I think you are going into wrong direction.

How to compare HOG feature vectors(1D) for the two input images to find similarity without using SVM or machine learning? 

SVM is tool for comparing a vector with a dictionary to find the rightest answer. For similarity, it is just the distance of the two image-represented vector. Do not overthinking, it will kill you

In your case, you use HOG feature as your image-represented vector. So calculate the Euclid distance between them. That value is there similarity.

You can see matlab pdist method to find a list of easy-to-used distance calculating method.

The problem lie down here is not how to compare feature vector, it is how to represent your image by single vector. A better image represent lead to better performance. For example: Bag-of-word, CNN, etc . There are ton of them, for newbie like you start with Bag-of-word.

Hope that help and welcome to Computer vision world

Vu Gia Truong
  • 1,022
  • 6
  • 14
  • Thanks Vu Gia Truong. The thing is I want to avoid using any learning methods as as that might be overkill and I don't have any training images. Is there any other way other than Euclidean distance to compare the HOG vectors through traditional image processing techniques? – Sakthi Geek Dec 20 '17 at 03:14
  • As far as my knowledge goes, Bag of Words is a machine learning based method used for text classification, Am i right? – Sakthi Geek Dec 20 '17 at 03:18
  • No you aren't. Bag-of-word was used to classified nearly everything before CNN came to the scene. it was the tradition method for classifying. Something like Bag-of-word is just help you find better image-represent vector. You use HOG feature as your image-represent vector so the distance between them is their similarity. There is other methods too, i added in the answer – Vu Gia Truong Dec 20 '17 at 04:07
  • Ok, Thanks. I will try BOW and other distance measures and check if it works for me. If possible, kindly upvote the question so that others who know some other approaches can share their ideas too. – Sakthi Geek Dec 20 '17 at 06:07
  • 1
    @SakthiGeek can share code for comparing HOG features. – Monk247uk Jun 02 '21 at 05:25