How can i verify two images using VB?
If any body knows. Please help me
Printable View
How can i verify two images using VB?
If any body knows. Please help me
First off, if your images are bigger than 32x32 don't expect to get real-time speed. You'll get maybe 5 times in a second, no more if you go to 100x100, and it gets worse after that. That's if you use GetPixel and SetPixelV to do your 'dirty work' >=). If you use pointers instead, you can get real-time framerates up to 400x400 images, at least with my computer's results. So, go to http://rookscape.com/vbgaming, and go to the 'Pointers for Faster Pixel Manipulation' link in the tutorials section. Good luck.
Now, to the actual method >=). For your images, all you'll need to do is find out if each member in the array is the same (pointer method). For any other method, you have to loop through the width and height of the image and check everything that way. Once again, we use an equal operator. You must consider it to have suceeded until it hits a part of the image that is different. So in pseudo-code: (pointer method)As you can see, my pseudo-code is very messy, but it will get the job done (once it is real code, that's just the basic algo.VB Code:
Open Image With Pointer Method Suceeded = True For I = Lbound(pointer array, 1) to Ubound(pointer array, 1) For J = Lbound(pointer array, 2) to Ubound(pointer array, 2) If pointer array(I,J) <> pointerarray2(I,J) then suceeded=false If not suceeded then exit for exit for end if next next
But will it be fullproof for Signature Verification?
It will have to be the exact same picture in order to pass, if you want to have pictures that are kind of the same, I suggest you do this:
1. Pixelate the image to maybe 6 pixels = 1 pixel. (average every 6x6 pixels and put that whole colour in the 6x6 square).
2. Check every 6x6 square against the other 6x6 square. If there is AMT or lower difference, make sure it passes. Otherwise, cancel the function and return false.
Keep going through some images until you find a suitable number for AMT. (eg. start at 30, if it passes, try setting it to 25, if it doesn't pass, set it higher (eg. 35))