Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Internet Gambling > Software
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-29-2006, 03:21 AM
IFlushedTheNuts IFlushedTheNuts is offline
Junior Member
 
Join Date: Aug 2006
Posts: 19
Default How do these programs read the board?

Hello,

I was wondering how programs like Calculatem Pro, Poker Indicator, ... are able to read the table (pocket cards, flop/turn/river cards, which players are still in the hand, pot size, etc.). I can image two options:

- analysis of network packets: this seems very difficult, since the connection is encrypted;
- screen capturing/analysis: this seems also very difficult to do.

Do you guys have an idea? Is there a library somewhere which is able to read the table?

Thanks a lot all.

PS: I'm a software developer, so I don't mind tech talk [img]/images/graemlins/smile.gif[/img]
Reply With Quote
  #2  
Old 08-29-2006, 02:34 PM
revg revg is offline
Junior Member
 
Join Date: Aug 2006
Posts: 12
Default Re: How do these programs read the board?

Most of them use screen capturing. It's actually quite simple using an euclidean distance algorithm along with a threshold for doing a pixel by pixel comparison of two images. If the images are >96% the same then its a match.

You can detect flop, hole cards, turn, river, betting, pot size etc..

The hardest part is reading the text. For this you need to have some type of OCR algorithm to get the screen names, stack sizes, bet amounts etc... OR you can do what I did and read this type of information from the textbox that tells you what is happening, or by poking through the poker softwares memory.

So basically I have combined hand history text scraping with screen scraping to create a holdem odds calc among other things.

Oh and I used a combination of c++ and c# to code all my stuff. I have a c++ app that does the memory reading stuff and then sends the info cross-process to my c# app for processing.

Cheers
Reply With Quote
  #3  
Old 08-29-2006, 02:38 PM
AngryEgyptian AngryEgyptian is offline
Senior Member
 
Join Date: Sep 2005
Posts: 131
Default Re: How do these programs read the board?

Man you definately did that the hard way.
Reply With Quote
  #4  
Old 08-29-2006, 02:45 PM
jukofyork jukofyork is offline
Senior Member
 
Join Date: Sep 2004
Location: Leeds, UK.
Posts: 2,551
Default Re: How do these programs read the board?

[ QUOTE ]
- analysis of network packets: this seems very difficult, since the connection is encrypted;

[/ QUOTE ]
This is alot easier than it seems. The fact that it is encrypted doesnt really mean a great deal. The application still has to decrypt it somewhere internally and if you can get in right after the call to SSL_read() you can (in theory) get the plaintext too.

[ QUOTE ]
- screen capturing/analysis: this seems also very difficult to do.

[/ QUOTE ]
This is very easy too. As the other poster mentioned, simple template matching code using some kind of distance metric (ie: nearest neighbour classification) will work very well (even for the strings, as they all use the same font - no need for OCR). The resizeed tables will not cause problems either, as the scale factor can be deduced from the new window dimensions and a reduced size template used.

If the sites were to start moving stuff around then you would need to use convolution based methods and if they were to change the images and/or font you may have to use a more advanced classifier than a basic nearest neighbour classifier.

Juk [img]/images/graemlins/smile.gif[/img]
Reply With Quote
  #5  
Old 08-29-2006, 03:49 PM
revg revg is offline
Junior Member
 
Join Date: Aug 2006
Posts: 12
Default Re: How do these programs read the board?

Ah... good point about using the image comparison routine to grab the text. For whatever reason I didn't even think of that.

Hey btw, Juk are you a coder by day? I am and I find myself so bored with the stuff I have to do at work that I make projects for myself on my spare times such as holdem odds calcs, bots, etc...

cheers buddy
Reply With Quote
  #6  
Old 08-30-2006, 12:08 AM
captainwan captainwan is offline
Senior Member
 
Join Date: Nov 2005
Posts: 128
Default Re: How do these programs read the board?

is it possible to do screen scrapping using autohotkey?
Reply With Quote
  #7  
Old 08-30-2006, 02:07 AM
CASSHERN CASSHERN is offline
Senior Member
 
Join Date: Jun 2005
Location: Montreal
Posts: 459
Default Re: How do these programs read the board?

[ QUOTE ]
is it possible to do screen scrapping using autohotkey?

[/ QUOTE ]

check recent messages ... I believe there was a thread about that a few days ago [img]/images/graemlins/crazy.gif[/img]
Reply With Quote
  #8  
Old 08-30-2006, 11:49 AM
MrMoo MrMoo is offline
Senior Member
 
Join Date: Sep 2004
Location: Las Vegas
Posts: 750
Default Re: How do these programs read the board?

Yes but it's not perfect. It depends on what you're trying to scan.

I got image recognition working for blackjack on Planetluck. But I also tried with Starluck and it won't work. On Starluck the cards are too small. A red six gets recognized as a red eight. You can fiddle with it but the changes usually just cause more problems with other cards.
Reply With Quote
  #9  
Old 08-31-2006, 10:47 AM
reservoir reservoir is offline
Member
 
Join Date: Jan 2006
Location: Philadelphia, PA, USA
Posts: 43
Default Re: How do these programs read the board?

I am a programmer, but I don't have any experience with screen capturing. If someone wanted to work together to make some sort of program i'd really be interested. Let me know
Reply With Quote
  #10  
Old 08-31-2006, 11:35 AM
MrMoo MrMoo is offline
Senior Member
 
Join Date: Sep 2004
Location: Las Vegas
Posts: 750
Default Re: How do these programs read the board?

It depends on the language your using.

For AutoHotKey, play around with the ImageSearch function. AutoHotKey works great for a lot of poker applications buts it's usefulness as a full blown programming language quickly become apparent.

For Java, I believe you should look into the Robots class. You can do sectional screen captures, convert to RGB values and compare.

For other languages, I couldn't tell you. I'm too lazy to spend my time learning.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:25 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.