How to quickly compare bitmaps?

Widget

Well-Known Member
Licensed User
Longtime User
I'm not sure this can be done quickly. But I have a couple dozen small bitmaps of the same dimension and I'd like to know if they contain roughly the same image. Let's say someone takes a picture of the sky and it is grey because it is overcast. I have another picture that is also of the same overcast sky. I'd like to be able to do an XOR on both bitmaps and determine if there are only a few differences, or many differences.

Now of course I could go through each bitmap pixel by pixel, but that would be incredibly slow. I'm wondering if I could load each bitmap into an binary array so I could quickly perform an XOR operations on the two? A low number of non-zero elements tells me how similar the images are.

Any idea'rs?:confused:

Widget
 

NeoTechni

Well-Known Member
Licensed User
Longtime User
When i made a program to check for motion on a webcam i only checked 1 pixel per 16x16 pixel block (the 16 was of course a variable)

i got it to run quite fast on a pc but you wouldnt need it to run realtime

it would return a smaller greyscale image where the darker the pixel the more change there was between the colors rgb values
 
Upvote 0

Widget

Well-Known Member
Licensed User
Longtime User
NeoTechni,
That should speed things up a bit. Thanks.;)

I may even try using OutputStream.InitializeToBytesArray on images that pass the random pixel check of yours.

Widget
 
Upvote 0
Top