Sign in to follow this  
Followers 0
Chuuy

Something Better Then PixelChecksum?

10 posts in this topic

I'm making a program that reads 42 different spots of the monitor. Now, each spot is basically a number with a color in the background. So, I need to be able to read the number along with the color. There are 5 colors, and an unlimited amount of numbers. However, usually they don't go above 100, so let's say the max was 100. That means that if I was trying to read a specific spot of the board, the program would have to compare 500 different images and return the vale of what the actual image is. Now, sometimes it has to read more then 1 spot in a span of 30 seconds. Sometimes it'll go up to 30 spots, sometimes 42. I'm not sure the computer can do all of that within 30 seconds.

The other problem is, I don't want to have to Print Screen 42 x 5 x 100 = 21,000 different .bmp's.

So, I was wondering if there's a simpler solution to this. Is there some sort of software out there that can read a number and the general background color?

Thanks, Chuy.

Share this post


Link to post
Share on other sites



Look at prospeed

EDIT: and next time don't make double posts

Whoops, sorry about the double post. I guess my internet lagged or something.

But thanks, I'll check it out.

Share this post


Link to post
Share on other sites

Look at prospeed

EDIT: and next time don't make double posts

Sorry, but how is this supposed to help me? I downloaded it and watched a demo of a bunch of special effects, but I don't understand how that helps me read data from my screen.

Share this post


Link to post
Share on other sites

You don't specify how large your area is. It doesn't matter, however, PixelCheckSum can do a checksum of your entire Desktop numerous times within a single second. Run the following script to see how many times you can do your entire Desktop:

Local $hTimer = TimerInit()
Local $i = 0
While TimerDiff($hTimer) <= 1000    ; One second
    PixelChecksum(0, 0, @DesktopWidth, @DesktopHeight)
    $i += 1
WEnd

Local Const $sResult = StringFormat("Performed %d checksums at %dx%d in 1 second.\n", $i, @DesktopWidth, @DesktopHeight)
ConsoleWrite($sResult)
MsgBox(4096, "", $sResult)

My results:

Performed 13 checksums at 1920x1080 in 1 second.

That means it would take less than 4 seconds for me to do 42 checksums of the entire Desktop. With the size images I suspect you are dealing with, you're likely to be bottlenecked by AutoIt's general slowness as opposed to PixelCheckSum() itself. Even by those standards, I can still check a 750x750 well over 42 times per second.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

You don't specify how large your area is. It doesn't matter, however, PixelCheckSum can do a checksum of your entire Desktop numerous times within a single second. Run the following script to see how many times you can do your entire Desktop:

Local $hTimer = TimerInit()
Local $i = 0
While TimerDiff($hTimer) <= 1000    ; One second
    PixelChecksum(0, 0, @DesktopWidth, @DesktopHeight)
    $i += 1
WEnd

Local Const $sResult = StringFormat("Performed %d checksums at %dx%d in 1 second.\n", $i, @DesktopWidth, @DesktopHeight)
ConsoleWrite($sResult)
MsgBox(4096, "", $sResult)

My results:

Performed 13 checksums at 1920x1080 in 1 second.

That means it would take less than 4 seconds for me to do 42 checksums of the entire Desktop. With the size images I suspect you are dealing with, you're likely to be bottlenecked by AutoIt's general slowness as opposed to PixelCheckSum() itself. Even by those standards, I can still check a 750x750 well over 42 times per second.

Actually, I'm dealing with a rectangle of 6x10. So I performed 25,746 checksums in a second. However, that still doesn't solve the issue of me needing to take 21,000 different .bmp's to compare the checksums to. :( Edited by Chuuy

Share this post


Link to post
Share on other sites

You only need need the check sums of 500 images which can be stored in an array and then compare each of those in 42 different locations.


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites

You only need need the check sums of 500 images which can be stored in an array and then compare each of those in 42 different locations.

Yeah, this is what I'm going to try to do. I'll be surprised if everything matches up though.

Anyway, new thing:

I have this code in Pascal, however, it calls some functions that I don't have. So I'm recreating the functions (this OCR stuff) in AutoIt. Is there someway I can make a .dll with AutoIt so that I can call functions in the .dll with Pascal?

Thanks, Chuuy.

Share this post


Link to post
Share on other sites

Sorry, but how is this supposed to help me? I downloaded it and watched a demo of a bunch of special effects, but I don't understand how that helps me read data from my screen.

Sorry for not being clear.

My idea was to use _ScreenCapture_Capture() to get desired bitmaps and then LoadFileImage,InitFX,CompareBytes from Prospeed.

I used this princip in some of my projects successfuly.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

I have this code in Pascal, however, it calls some functions that I don't have. So I'm recreating the functions (this OCR stuff) in AutoIt. Is there someway I can make a .dll with AutoIt so that I can call functions in the .dll with Pascal?

You can't create DLL in Autoit but you can call DLL functions from DLL created in any other programming language (Also Pascal).

Look at DllCall()

Edited by Zedna

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