Poker-AI.org

Poker AI and Botting Discussion Forum
It is currently Mon Nov 13, 2023 2:58 pm

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Sat Jul 20, 2013 7:25 pm 
Offline
Junior Member

Joined: Sat Jul 06, 2013 5:37 pm
Posts: 11
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.


Top
 Profile  
 
PostPosted: Sat Jul 20, 2013 8:51 pm 
Offline
Junior Member

Joined: Thu May 02, 2013 2:25 pm
Posts: 30
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.


Top
 Profile  
 
PostPosted: Sun Jul 21, 2013 12:14 am 
Offline
Junior Member

Joined: Sat Jul 06, 2013 5:37 pm
Posts: 11
So is there another solution to get the cards other than just scraping? :x :?: :?: :?:


Top
 Profile  
 
PostPosted: Sun Jul 21, 2013 4:11 am 
Offline
Veteran Member

Joined: Mon Mar 04, 2013 9:40 pm
Posts: 269
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.


Top
 Profile  
 
PostPosted: Sun Jul 21, 2013 3:11 pm 
Offline
Junior Member

Joined: Sun Mar 10, 2013 10:30 am
Posts: 20
You can use Open Holdem and fuzzy font. You can handle noise in the image with the radius control.


Top
 Profile  
 
PostPosted: Tue Aug 06, 2013 11:00 pm 
Offline
New Member

Joined: Tue Aug 06, 2013 10:39 pm
Posts: 7
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.


Top
 Profile  
 
PostPosted: Wed Aug 07, 2013 11:48 am 
Offline
Junior Member

Joined: Sat Aug 03, 2013 8:21 pm
Posts: 18
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.


Top
 Profile  
 
PostPosted: Sat Aug 31, 2013 4:21 pm 
Offline
Veteran Member

Joined: Wed Mar 20, 2013 1:43 am
Posts: 267
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.


Top
 Profile  
 
PostPosted: Sat Sep 14, 2013 11:52 pm 
Offline
New Member

Joined: Sat Sep 14, 2013 9:19 pm
Posts: 1
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group