[英]pHash cross correlation of two white images is 0
我正在使用 Shipwreck.Phash 进行图像比较。 我刚刚认识到两个相同的白色图像返回的互相关为 0,尽管它应该返回 1。
哈希1:0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000
哈希2:0x000000000000000000000000000000000000000000000000000000000000000000000000000000000
互相关:0
我的代码:
static void Main(string[] args)
{
var firstImage = new Bitmap(@"Bilder\\hash1.JPG");
var secondImage = new Bitmap(@"Bilder\\hash1.JPG");
var hash = ImagePhash.ComputeDigest(firstImage.ToLuminanceImage());
var hash2 = ImagePhash.ComputeDigest(secondImage.ToLuminanceImage());
var score = ImagePhash.GetCrossCorrelation(hash, hash2);
Console.WriteLine(hash);
Console.WriteLine(hash2);
Console.WriteLine(score);
}
有人可以解释一下我的结果吗? 提前致谢。
给定图像: whiteImage
我直接询问了 Shipwreck 开发人员,这就是他们的回答:
由于互相关计算基于一种除法,因此不支持零向量。 所以 pHash 不支持单色图像。
从@Bagus Tesa 实现小提琴它正在工作,尽管它是 Shipwreck.Phash 的副本。 因此,我将 CrossCorrelation 方法从 NuGet 更改为他的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.