有没有办法确定两个图像在Objective-C中是否几乎相同? [英] Is there a way to identify if two images are nearly identical in Objective-C?

查看:117
本文介绍了有没有办法确定两个图像在Objective-C中是否几乎相同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设您有两张图片:

这些图片几乎完全相同,除了一些不同颜色的像素。 在Objective-C中是否有一种原生方式来识别两张图片是否几乎相同?如果没有,还有另一种方法吗

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?

推荐答案

在计算机视觉和图像处理方面几乎相同的定义可能因应用程序而异,因此计算相似性/身份的方法也会因手头的问题而异。

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.

我建议你迭代两个图像和XOR像素值(如果它们相同,结果将为零)。

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

这篇关于有没有办法确定两个图像在Objective-C中是否几乎相同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆