Poker-AI.org
http://poker-ai.org/phpbb/

IPoker scraping difficulties
http://poker-ai.org/phpbb/viewtopic.php?f=26&t=2535
Page 1 of 1

Author:  rocketboy [ Sat Jul 20, 2013 7:25 pm ]
Post subject:  IPoker scraping difficulties

I just finished 90% of my AI FLHU bot and i finally made to beat PA Sparbot and Vexbot with it after 89k hands but the problem is i cannot scrape cards from the iPoker room. Tryed all the ways possible to get the
cards but with no success. The following methods i used wich are in my knowledge area:
-tryed to get the text from the chat (it shows class Iexplore_server with no instance wich belongs to an IE app... but no text is returned so i cannot get this text even via AutoIt with IE_ functions)
-tryed to scrape the cards by single pixels like from the codingthewheel tutorial but with no success
-tryed to scrape the cards by pixel sum but the same with no success
-tryed to scrape the cards by custom pixels sum (this is my own function wich sums up only the common pixels) but returns different numbers only on 6 cards from the total of 52

Everytime i try to get a pixel sum of some card lets say '6s' i get a number now and later on when the card comes up again in a different slot has a different number. So it's impossible on ipoker to have a fixed pixel sum for a card like i did on other sites. Maybe they draw some random pixels on the images to make them this way.

Author:  PolarBear [ Sat Jul 20, 2013 8:51 pm ]
Post subject:  Re: IPoker scraping difficulties

As far as I remember (I coded iPoker scraper years ago) that's what they do - the cards rendered aren't always identical (probably due to antialiasing?). It's not impossible to deal with though.

Author:  rocketboy [ Sun Jul 21, 2013 12:14 am ]
Post subject:  Re: IPoker scraping difficulties

So is there another solution to get the cards other than just scraping? :x :?: :?: :?:

Author:  shalako [ Sun Jul 21, 2013 4:11 am ]
Post subject:  Re: IPoker scraping difficulties

if they are being rendered differently then what you can find their image files then your going to have to get the pixel hash codes from the table one card at a time. I had to do that for some site that I cannot remember the name of now.

Author:  LOLWorld [ Sun Jul 21, 2013 3:11 pm ]
Post subject:  Re: IPoker scraping difficulties

You can use Open Holdem and fuzzy font. You can handle noise in the image with the radius control.

Author:  MerlinsBeard [ Tue Aug 06, 2013 11:00 pm ]
Post subject:  Re: IPoker scraping difficulties

I never did it on iPoker specifically but I gave my scraper the rectangle to look in. (Slightly larger than the actual number). I convert to monotone and trim all the sides. I trim the sides by detecting the bounds of the number and simply create a new array from this.
Then rather than comparing this to a database, I upscale the image. Iirc it's a 4x4 grid (actually it may be 8x8 I can't remember exactly what it is). And then I compare this image to my database of upscaled ones. I find this works pretty well.

Ofcourse it also depends on how you then proceed to compare the image to your database. I think a NN is probably OTT for this since the letters are clear (not like a CAPTCHA). I think a simplistic but efficient way is to compare pixel by pixel with each letter in the database, making sure that your function keeps a record of the %match between the images. If it hits a 100% match it breaks out the loop & declares that card, otherwise it uses the highest percentage match. Although it's highly likely that you will always get a 100% match since it's the same font with no major noise.

One major problem (usually) with pixel by pixel comparison (perhaps not in the context of a pokersite screen scrape but w/e) is the speed. Using the upscaling method as mentioned above significantly increases the speed of your comparison aswell as the chance of a match.

In terms of figuring the suit. That's pretty easy. Use the 4 colour deck, and before you mess about converting to monotone and doing the comparison stuff, just test the pixel colour of the number.

Author:  AiWins [ Wed Aug 07, 2013 11:48 am ]
Post subject:  Re: IPoker scraping difficulties

There are a number of solutions if the cards are never the same. Assuming you are not using any form of modded client and can only read the screen to communicate with the software.

Look into DTMs, it's probably the best way. When I get home, I'll post my card reader. As far as computer intensity goes, it's not the best solution, but it's accurate and it's not slow at all, it's just 13 comparision checks.

Author:  HontoNiBaka [ Sat Aug 31, 2013 4:21 pm ]
Post subject:  Re: IPoker scraping difficulties

You could probably use DLL injection, but I dont know how it works.

You can also use custom cards. Just use cards, where each card looks completelly unique.
You can also use an algorithm, that uses the card characteristics, instead of a general purpose algorithm. For instance there are way to distinguish an 8 from a 9, just by looking at one pixel.
If you find 3-4 pixels, that are characteristic for a card, you can scrape them pretty easilly.

Author:  ItsJustBinary [ Sat Sep 14, 2013 11:52 pm ]
Post subject:  Re: IPoker scraping difficulties

Not sure if this helps but you can modify the image files used by the ipoker client once it is running. There are many table mods. Maybe you could modify the card images in order to be more useful. You have to update the files after the client is already running each time you start it, as it checks the files on startup, but not once the client is running it won't matter.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/