Poker-AI.org Poker AI and Botting Discussion Forum 2013-04-03T19:44:35+00:00 http://poker-ai.org/phpbb/feed.php?f=26&t=2418 2013-04-03T19:44:35+00:00 2013-04-03T19:44:35+00:00 http://poker-ai.org/phpbb/viewtopic.php?t=2418&p=3635#p3635 <![CDATA[Re: Screen Scraping]]>
Time with Subimage: 0.429ms per iteration
Time without Subimage: 0.227ms per iteration

Turns out without aero taking screenshots is way faster and smaller screenshots are faster than cropping images out of a single bigger screenshot. Definitelly something to check if your scraper is slow.

Statistics: Posted by HontoNiBaka — Wed Apr 03, 2013 7:44 pm


]]>
2013-04-03T04:54:18+00:00 2013-04-03T04:54:18+00:00 http://poker-ai.org/phpbb/viewtopic.php?t=2418&p=3630#p3630 <![CDATA[Re: Screen Scrapping]]>
Code:
public class Main {

   /**
    * @param args
    */
   public static void main(String[] args) {
      Robot r;
      try {
         for(int i = 0; i < 1000000; i++){
            int b = i*i;
            System.out.println(i);
         }
         r = new Robot();
         System.out.println("Start");
         long startTime = System.currentTimeMillis();
         for(int i = 0; i < 1000; i++){
            Color c = r.getPixelColor(100, 100);
         }
         System.out.println("Time: " + (System.currentTimeMillis() - startTime)*0.001 + "ms per iteration");
      } catch (AWTException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
      }
   }
}


Time: 22.141000000000002ms per iteration


Code:
public class Main {

   /**
    * @param args
    */
   public static void main(String[] args) {
      Robot r;
      try {
         for(int i = 0; i < 1000000; i++){
            int b = i*i;
            System.out.println(i);
         }
         r = new Robot();
         System.out.println("Start");
         long startTime = System.currentTimeMillis();
         for(int i = 0; i < 1000; i++){
            BufferedImage image = r.createScreenCapture(new Rectangle(600, 400));
            image.getSubimage(0,0,20,20);
            image.getSubimage(0,0,20,20);
            image.getSubimage(0,0,20,20);
         }
         System.out.println("Time with Subimage: " + (System.currentTimeMillis() - startTime)*0.001 + "ms per iteration");
         startTime = System.currentTimeMillis();
         for(int i = 0; i < 1000; i++){
            r.createScreenCapture(new Rectangle(20, 20));
            r.createScreenCapture(new Rectangle(20, 20));
            r.createScreenCapture(new Rectangle(20, 20));
         }
         System.out.println("Time without Subimage: " + (System.currentTimeMillis() - startTime)*0.001  + "ms per iteration");
      } catch (AWTException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
      }
   }

Time with Subimage: 21.661ms per iteration
Time without Subimage: 87.92ms per iteration


The results are a little strange, but I think we can see, that its better to take a bigger screenshot in java and to process that image, instead of taking many small screenshots as many do.

Checking for changed pixels with getPixelColor() Also has no benefits over just taking a screenshot.

Statistics: Posted by HontoNiBaka — Wed Apr 03, 2013 4:54 am


]]>
2013-04-01T04:12:33+00:00 2013-04-01T04:12:33+00:00 http://poker-ai.org/phpbb/viewtopic.php?t=2418&p=3603#p3603 <![CDATA[Re: Screen Scrapping]]> Statistics: Posted by HontoNiBaka — Mon Apr 01, 2013 4:12 am


]]>
2013-03-20T04:25:08+00:00 2013-03-20T04:25:08+00:00 http://poker-ai.org/phpbb/viewtopic.php?t=2418&p=3425#p3425 <![CDATA[Re: Screen Scrapping]]> Statistics: Posted by proud2bBot — Wed Mar 20, 2013 4:25 am


]]>
2013-03-20T04:02:58+00:00 2013-03-20T04:02:58+00:00 http://poker-ai.org/phpbb/viewtopic.php?t=2418&p=3424#p3424 <![CDATA[Re: Screen Scrapping]]>
Ive a few open scraping programs, they dont seem to work that well so far. I will probably implement it myself too. I know there is something in the openholdem forum, maybe I should check it out, but I wonder if its easy to detect.

Ive read, that most people only do the scraping, if its their turn, but you will probably still need the screenshot every few ms, so you at least can check if the buttons are there, I wonder if there is a faster way to know, when to scrap.

Statistics: Posted by HontoNiBaka — Wed Mar 20, 2013 4:02 am


]]>
2013-03-20T03:23:54+00:00 2013-03-20T03:23:54+00:00 http://poker-ai.org/phpbb/viewtopic.php?t=2418&p=3422#p3422 <![CDATA[Re: Screen Scrapping]]> Statistics: Posted by proud2bBot — Wed Mar 20, 2013 3:23 am


]]>
2013-04-03T04:55:24+00:00 2013-03-20T01:48:19+00:00 http://poker-ai.org/phpbb/viewtopic.php?t=2418&p=3421#p3421 <![CDATA[Screen Scraping]]> Statistics: Posted by HontoNiBaka — Wed Mar 20, 2013 1:48 am


]]>