我想比较两个图像以找到相同的图像。
I want to compare two images to find that is same image or not.
在window7(C#)中,我可以使用getpixel()方法并提取位图颜色,这很容易比较图像。
In window7(C#), I can use the getpixel() method and extract bitmap color, that's very easy to compare images.
但在window8(c#), WriteableBitmap aa = new WriteableBitmap(a.PixelWidth,a.PixelHeight); Stream stream = aa.PixelBuffer.AsStream();
but in window8(c#), WriteableBitmap aa = new WriteableBitmap(a.PixelWidth, a.PixelHeight); Stream stream = aa.PixelBuffer.AsStream();
如果我使用这些代码,我可以知道图像大小,但我不知道如何找到颜色代码。 .so我无法比较不同的图像...
If i use those code, i can know the image size but i don't know how can i find the color code..so i can't compare the different images...
我该怎么办?
推荐答案
PixelBuffer包含BRGA顺序中每个像素的颜色。您可以比较每个位图的流,看它们是否相同。
The PixelBuffer contains the colors for each pixel in BRGA order. You can compare the streams for each bitmap to see if they are the same.
- Rob
更多推荐
如何从图像中提取位图代码?
发布评论