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

27
LINES

< > BotCompany Repo | #1006217 // Try to find URL area in browser [works for me]

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

Libraryless. Click here for Pure Java version (4355L/30K/102K).

!752

// static for extraction by Performance Collector
static RGBImage img;
static L<Rect> clips;
static Rect bestClip;

p {
  img = rgbShootScreenHidingConsole();
  calc();
  showImage("Possible URL box", img.clip(bestClip));
}

svoid calc {
  Color color = Color.white;
  clips = areasColored(img, color);
  print(n(clips, "areas") + " found for color " + new RGB(color) + ": " + struct(clips));
  
  bestClip = bestAccordingTo(clips, f scoreClip);
}

static double scoreClip(Rect r) {
  double width = min(1, r.w/(double) img.w()*2);
  double top = r.y/(double) img.h();
  double height = r.h/(double) img.h();
  ret width-(top+height)*2; // thin, wide, high up
}

Author comment

Began life as a copy of #1006216

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1006217
Snippet name: Try to find URL area in browser [works for me]
Eternal ID of this version: #1006217/1
Text MD5: 60f1e789b198b67bfecd70bde234de69
Transpilation MD5: b659d42d0818a0540a7a64ca1ce1a26f
Author: stefan
Category: javax / ocr
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-23 17:31:33
Source code size: 693 bytes / 27 lines
Pitched / IR pitched: No / No
Views / Downloads: 471 / 783
Referenced in: [show references]