Ask Your Question
0

Probability of two images matching?

asked 2016-11-14 18:41:02 -0600

Phteven gravatar image

Hello everyone.

I have tons of binary images and want to sort them according to their similarities of a template. So i load a template and one of the test images. then i want to compare both of them (they are all of same size) and as result have a value in percentage that the image is matching the template. Once i get this percentage value, i am already able to sort the test images, i just need a way to calculate the similarities. the opencv matching method (http://docs.opencv.org/2.4/doc/tutori...) doesnt seem to do the trick as far as i can see.

anyone suggestions?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2016-11-18 01:36:49 -0600

Phteven gravatar image

updated 2016-11-18 01:39:17 -0600

HU moments look promising but seem a bit "too much" for my cause.

I am using maximum boundary deviation (MBD, Hausdorff distance) which seems to be used in gesture detection systems and getting excellent results. It was easy and fast to implement and is independet of other steps (threading!) Note: if there are outliers, use the 2. last MBD value instead of the last. or the 3. last or ...

Source: Formula 15 of http://waset.org/publications/13743/t... Trajectory Guided Recognition of Hand Gestures having only Global Motions M.K. Bhuyan, P.K. Bora, and D. Ghosh

edit flag offensive delete link more
1

answered 2016-11-14 18:48:40 -0600

Tetragramm gravatar image

How exact a match? If they all have the same alignment, just do absdiff() then sum().

If you have to worry about mis-alignment errors and don't have too the same image with a different alignment, you can use the HU moments. They're translation, rotation and scale invariant, so that's what you have to look out for as far as similarities.

edit flag offensive delete link more

Comments

all templates show symmetrical (both axes) figures. the only way they differ from the test images is in line thickness and exact shape. i take a look into the hu moments they look promising. thank you

Phteven gravatar imagePhteven ( 2016-11-14 18:56:04 -0600 )edit

If they're symmetrical you should cut along the axes and just use one quarter. Much smaller data size and it'll likely work better.

Tetragramm gravatar imageTetragramm ( 2016-11-14 20:16:37 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-11-14 18:41:02 -0600

Seen: 653 times

Last updated: Nov 18 '16