Sign in to follow this  
Followers 0
bahkoo

Masked Pixel Checksum

3 posts in this topic

I would like to create a function that works much like the GetPixelChecksum with one important difference: to perform the checksum only on pixels that match the specified color.

For example, I am trying to get the checksum on character and digit images that are always a single color but appear on various textured backgrounds. I want to get a checksum for a rectangle containing that character or digit, (which is a single color) ignoring all other colors that appear in that rectangle (because these are part of the background). The result will be that I can compare these characters regardless of the background they appear on (unless the background happens to contain a pixel of the same color).

To now, I have created a nested loop to loop through each pixel in a given rectangle, get each pixel and check if is the required color. Once found though, I don't know what to do with the result in order to create a unique checksum.

Getting each pixel individually like this does seem quite slow compared to the GetPixelChecksum. Anyone have ideas for optimizing the speed?

Also, how can I create a checksum based off all the (x,y) coordinates that succesfully match the criteria?

Thanks

Share this post


Link to post
Share on other sites



The request has been asked before, and been said that it would be too difficult to impliment. And the alternatives, because with the current implementation you can't do a PixleCheckSum by specific color, are going to obviously be slower unless you write your own method in a lower level language.

This is one alternative and you would base your own values.

http://www.autoitscript.com/forum/index.ph...c=36013&hl=

The other suggestion would be, that most use the "specific" color to act as an OCR, try looking that up ("OCR") in the Example Scripts section of the forums.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Looks good. Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0