Jump to content
Sign in to follow this  
dennism

PixelChecksum useless unless looking for those pixels in EXACT same spot?

Recommended Posts

dennism

Ok, I remember using AI2 some years ago and remembered how well it seemed to work. So I started messing around trying to make a simple program

that would just read cards dealt to me in an online poker room. After reading a million and a half things on this forum it seems like what I need to do is

create some sort of OCR script but for awhile I thought I had figured out a system other than that that would work.

I figured out the exact pixels for each card and where it will eventually land, I assumed that if I could capture the color coded card symbol (A, J, 9, 3 etc..)

I would know both card and suit. So I had a checksum done on the location that they landed, and to simply capture of every card I had it display a splashscreen

with the checksum of each card that was dealt out. I compiled a list of approximately 15 when I decided to start coding them in, so I would be able to see it working as it

recognized some checksums and instead of returning an integer I would see exactly which card it was.

It was then that I realized that if I got the checksum of the card in position one, even thought it was a King of Diamonds, and the program was creating a checksum

on the EXACT same pixels (in a certain dimension not exact as in the exact same location), in the exact same pictures with the exact same colors.... returns different checksums! Now for those "in the know" your probably either saying

well duh idiot of course it does or your thinking, well you can do this to get around that...

Either way, the only real workaround that I can find for this is literally grinding out and finding the checksum for EVERY single card, but between your pocket cards (104 possible), and 5*52 cards that could come on the flop in any order its over 300 cards that I need to capture their checksum. This also means that once I have done that the program then needs to check EVERY single one which could bogg it down considerably.

If anyone knows of anything I can do to fix this plz let me know thanks. I have included the script that I have been working from!

test.au3

Share this post


Link to post
Share on other sites
dennism

Shameless bump, come on people its already on bottom of page two, someone knows what needs to be done here.

Share this post


Link to post
Share on other sites
Jon

As far as I know the checksum doesn't take position into account. So if the exact same area of colours is used it should be the same checksum. The problem may be that there is some transparency/alphablending going on which gives slightly different results?

Share this post


Link to post
Share on other sites
dennism

As far as I know the checksum doesn't take position into account. So if the exact same area of colours is used it should be the same checksum. The problem may be that there is some transparency/alphablending going on which gives slightly different results?

Well it doesn't make any sense, all backgrounds are white that its checking against. I also assume that every card is the same image I don't understand why they would take

the time to make slightly different cards. Additionally I don't try and read the card as a whole just the symbol like K or 9, then using a 4 colored deck that changes the K or the 9 into corresponding colors, green clubs, black spades, red hearts etc... Furthermore I am reading the same pixels each times the exact same ones, so if the card showed up once in that spot and I snatched its checksum then it came again it only makes sense that it would work again .... no?

Share this post


Link to post
Share on other sites
PsaltyDS

I don't understand why they would take the time to make slightly different cards...

To make it harder to write Bots against their game...?

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
dennism

To make it harder to write Bots against their game...?

:)

Lol that would make sense, but honestly If I knew more programming there any many other ways around it than AutoIT pixelchecksum....

Share this post


Link to post
Share on other sites
dennism

Try screen grabbing a few of the same cards and then see if they are actually identical (same to a bmp and file compare or something)

Ok ok maybe I havent been clear, let me show you check the example.. I only look at the number on the card. Im gonna go over the exact pixels that im scanning to make sure they are exactly the same on each card

post-23573-1179883535_thumb.jpg

Share this post


Link to post
Share on other sites
Automan Empire

The screen capture that you posted is a JPG file. That means it is encoded using a lossy compression. That would be enough reason for cards to have different checksums in different locations (if they are part of a larger JPG of the entire screen.

Try doing a screen capture and saving it in a lossless format, such as TIFF or BMP.

You are on the right track.

The important thing is to determine the exact locations that cards can be dealt to on the screen (or in the Window). Have your program compare them to a library of checksums for each card to determine what it is. You don't need all of each card, just the necessary part of the rank and the suit.


"I've seen your work in the past, and it's novice at best..." SmOke_N

Share this post


Link to post
Share on other sites
SmOke_N

The screen capture that you posted is a JPG file. That means it is encoded using a lossy compression. That would be enough reason for cards to have different checksums in different locations (if they are part of a larger JPG of the entire screen.

Try doing a screen capture and saving it in a lossless format, such as TIFF or BMP.

You are on the right track.

The important thing is to determine the exact locations that cards can be dealt to on the screen (or in the Window). Have your program compare them to a library of checksums for each card to determine what it is. You don't need all of each card, just the necessary part of the rank and the suit.

You really can't be serious giving this type of advice.

Know how and what Pixel Functions work on... JPG? ... Um No!... Tiff... Um No.... Bmp... hmm maybe you have something there.

I've seen your work in the past, and it's novice at best... to the OP... it's best to "know" what your working with, before you try working with something period. It's not AutoIt's fault, the sums never change, it's yours on how you gathered those sums to begin with period.


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.

Share this post


Link to post
Share on other sites
Automan Empire

Maybe we are talking past each other here! This is the same topic that you replied to in this thread...

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

What is different about that one?

I know how to use PixelCheckSum. "Novice at best". Fair enough, but my program works! I realize that it is also possible to evaluate the merits of code by other factors such as speed of execution, elegance, and structure. But when it comes to online poker assistant programs, the only significant factor is the rate of return. Mine is up 1400% from the initial buyin, with no rebuys.

My point was that when creating and testing AI scripts that work with dynamic online programs, it is sometimes useful to use a screen capture to work out the positions and PixelCheckSums on a static display rather than a constantly changing one. But if one uses a lossy compression format such as JPG, the checksums will not match. Of course, once it is working...

Anyway, I agree with your point about the OP.

Edited by Automan Empire

"I've seen your work in the past, and it's novice at best..." SmOke_N

Share this post


Link to post
Share on other sites
SmOke_N

Maybe we are talking past each other here! This is the same topic that you replied to in this thread...

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

What is different about that one?

What did I say different there, then what I said above?

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.

Share this post


Link to post
Share on other sites
dennism

In the end I was making a mistake in the places I was searching, the coordinates were just slightly off.

But as you'll see in my other post, that after I solved this problem and spent all night writing a major script to recognize every god damn card.....Since then it was even evolved by a friend who is a much better programmer than I, he used proper formats and calculations to get a unique number that was more accurate than the checksum. But then I tried it on another computer and of course, it didn't do one god damn thing. And now I realized the reason it did nothing is because it was seeing the colors of the cards slightly different on each computer, and thus the checksum is useless.

(Refer to: http://www.autoitscript.com/forum/index.php?showtopic=46616)

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  

×