视觉上比较两个图像

问题描述:

我希望能在一定阈值内检查两张图片是否相同。

I am wanting to be able to check to see if two images appear to be the same, within a certain threshold.

这两个图像是相同的眼睛,但有一个略有不同的颜色。我尝试了以下示例:

These two images are the same to the eye, but one has slightly different colors. I have tried the following example:

http://www.vb-helper.com/howto_net_image_compare_threshold.html

不幸的是,它似乎只是检测到图片是否相同。

Unfortunately, it only seems to detect when the images are identical. How can I determine if the images are the same within a certain threshold, with VB.NET?


  1. 将两张图片调整为相同尺寸,例如16x12或90x60(取决于您的阈值)。

  2. 将每个像素的颜色深度降低到4或8位(未调色) 。您可以为此使用posterize函数。

然后查看两个较小的图像是否重复。如果是这样,原件必须非常接近。

Then then see if the two smaller images are duplicates. If so, the originals must be pretty close.