iosobjective-cimageimage-processing

Is there a way to identify if two images are nearly identical in Objective-C?


Say you have two images:

enter image description here

and

enter image description here

These pictures are nearly identical save for a few pixels that are different colors. Is there a native way in Objective-C to identify if two pictures are nearly identical? If not, is there another way to do it?


Solution

  • In computer vision and image processing the definition for nearly identical can vary a lot from application to application, therefore the method to calculate similarity/identity will also vary depending on the problem at hand.

    In your case it seems that the images have identical resolutions and you are just interested in the number of pixels that are different.

    I would suggest that you iterate over both images and XOR the pixel values (if they are identical, the result will be zero).