brokedid
brokedid

Reputation: 899

Compare Image with a Photo of the Image

I've a Problem to solve, but couldn't find a solution.

I need to compare a original image with a photo of the same image, and the function should return true if the photos are equal or false if the photos are not equal.

The photo can also have another size as the original image, and also if the photo contains only a part of the original it should detect the original.

Can I use normal face detection library's or do you have a better solution to solve this problem?

Thanks

Upvotes: 4

Views: 756

Answers (1)

Sean
Sean

Reputation: 76

There are several ways you could approach this problem. If you are looking to see if images are EXACTLY the same. You could go after the file. Using an md5 comparison you can help determine to see if it's the exact same file. Now this won't work for ACTUALLY comparing them.

If you want to actually compare the contents of the pictures you have, I suggest taking a look at PHP's gd library.

After some googling around I found a nice blog entry here about comparing the similarity of images. It's a good read.

A good method to start off with when comparing photos with GD is making the images the same size. The size should be reasonable so I'd say somewhere around 16x16. You should then consider RGB values, shapes, etc.

Some other libraries I should point you to are libpuzzle and imagemagick. Both of which make it pretty easy for comparing images in PHP. The documentation is pretty bad though so it may require a lot more googling and actual testing. Good luck!

Upvotes: 3

Related Questions