On 31 Oct 2008, at 2:21 pm, Pierce Freeman wrote:

Hi everyone. I am wondering if there is some way to compare two images in Cocoa, and then somehow spit out a percent of how similar they are. The only way I could think of is comparing every pixel, but this seems like it would take a long time, and even so I have no idea how to go about doing that.


It's non-trivial. Comparing each pixel doesn't really work. You could have two identical images but if one was shifted by just 1 pixel, you'd have almost no match even though to the eye they'd look the same. You can compare images for equality this way, but not similarity (i.e. if they are absolutely identical in every way you can tell, but the smallest difference means no match at all).

Researchers have been looking into this sort of thing for years. There are ways to do it, but it requires some pretty heavy lifting in terms of breaking down an image into "features" then finding whether those same features can be found in the second image, regardless of how those features might have been transformed in size, position or angle. You can then come up with a figure for the number of feature matches and how these are different, and so arrive at a figure for the overall similarity of the two images. So, it can be done but you'll need to look at some serious academic papers to get a flavour for what's involved - it's almost verging on AI.

Good luck ;-)

cheers, Graham


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to