Ask Your Question
1

Comparing two images

asked 2016-11-28 09:57:23 -0600

Katie gravatar image

updated 2016-11-28 12:31:30 -0600

berak gravatar image

image description image description

I'm just getting started with OpenCV and I want to compare two similar images. I am trying to get a percentage back indicating their similarity. I am using sobel to filter out the horizontal lines and then i want to compare just the vertical lines in the image. I am using python and opencv3.0.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2016-11-28 11:13:51 -0600

Tetragramm gravatar image

Define similarity. That sounds flippant, but it's the true problem here. If you can define, in a mathematical sense what "similar" means, then it's easy to find the answer, and you don't need our help.

If you can't define what "similar" means, then nobody can help you, because there are far, far too many different ways of measuring that.

The simplest measure is to do an absdiff and sum the result, but this assumes they are perfectly aligned. It's possible to make images that appear identical, but are the worst possible match by this measure.

It would help if you can share a sample pair of images so we know what it is you're comparing. Then we could maybe make suggestions.

edit flag offensive delete link more

Comments

I revised my question. Is it clearer?

Katie gravatar imageKatie ( 2016-11-28 12:16:39 -0600 )edit

So yeah, those look to be identically aligned. Just do an absdiff and only the differences are left.

Tetragramm gravatar imageTetragramm ( 2016-11-28 12:39:29 -0600 )edit

Question Tools

3 followers

Stats

Asked: 2016-11-28 09:57:23 -0600

Seen: 1,758 times

Last updated: Nov 28 '16