Ask Your Question
1

measure similarity between two image

asked 2015-03-22 15:23:41 -0500

danielistyo gravatar image

I would like to measure similarity between training data image and my testing data image. I don't want an exact match comparison, because the aspect could be slightly different or many different (some element could be at a slightly different location). And the result is similarity level. is there any function in OpenCV to solve it ?

I think my question like text recognition when it find comparison between all of letter from database.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
6

answered 2015-03-23 00:56:25 -0500

tomnjerry gravatar image

In OpenCV, there are few feature matching and template matching. For feature matching, there are SURF, SIFT, FAST and so on detector. You can use this to detect, describe and then match the image. After that, you can use the specific index to find number of match between the two images.

There are quite a few methods that could possibly help you:

Cross Correlation - a simple metrics which you can use for comparison of image areas. It's more robust than the simple euclidean distance but doesn't work on transformed images and you will again need a threshold.

Histogram comparison - if you use normalized histograms, this method works well and is not affected by affine transforms. The problem is determining the correct threshold. It is also very sensitive to color changes (brightness, contrast etc).

Detectors of salient points/areas - such as MSER (Maximally Stable Extremal Regions), SURF or SIFT. These are very robust algorithms and they might be too complicated for your simple task. Good thing is that you do not have to have an exact area with only one icon, these detectors are powerful enough to find the right match.

Refer: Local invariant feature detectors

edit flag offensive delete link more

Comments

Noteworty!

sturkmen gravatar imagesturkmen ( 2015-09-01 15:49:37 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-03-22 15:23:41 -0500

Seen: 6,515 times

Last updated: Mar 23 '15