Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

29
LINES

< > BotCompany Repo | #1006798 // Find Possible Motion [prelude]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (2175L/15K/49K).

!7

p {
  RGBImage a = null, b = rgbShootScreen();
  repeat {
    sleep(500);
    time {
      a = b;
      b = rgbShootScreen();
      
      print("*");
      compare(a, b);
    }
  }
}

svoid compare(RGBImage a, RGBImage b) {
  new HashSet<Pt> deltas;
  for tries to 10: {
    Rect r = randomScreenRect(50, 50);
    RGBImage clip = a.clip(r);
    if (rgbInnerPrecision(clip) >= 0.5f) {
      Rect r2 = rgbSearchPrecise(b, clip);
      if (r2 != null)
        deltas.add(new Pt(r2.x-r.x, r2.y-r.y));
    }
  }
  print("Deltas: " + deltas);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006798
Snippet name: Find Possible Motion [prelude]
Eternal ID of this version: #1006798/8
Text MD5: d5ee50848d8700793e9bdae117088f11
Transpilation MD5: 48df5f722c9e8de46fbb80ea36e5c71d
Author: stefan
Category: javax / ocr
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-02-05 03:34:32
Source code size: 571 bytes / 29 lines
Pitched / IR pitched: No / No
Views / Downloads: 412 / 478
Version history: 7 change(s)
Referenced in: [show references]