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

18
LINES

< > BotCompany Repo | #1006390 // ocr_hsplit

JavaX fragment (include)

static L<Rect> ocr_hsplit(RGBImage img, bool[] split) {
  int w = img.w(), h = img.h();
  int x1 = 0, x = 0;
  new L<Rect> l;
  while (x < w) {
    while (x < w && split[x]) x++;
    if (x > x1) {
      l.add(new Rect(x1, 0, x-x1, h));
      x1 = x;
    }
    while (x < w && !split[x]) x++;
    if (x > x1) {
      l.add(new Rect(x1, 0, x-x1, h));
      x1 = x;
    }
  }
  ret l;
}

Author comment

Began life as a copy of #1006388

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: #1006390
Snippet name: ocr_hsplit
Eternal ID of this version: #1006390/1
Text MD5: c9e884efce3c4cfdaf61af03d79a2f74
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-29 23:49:50
Source code size: 400 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 532 / 538
Referenced in: [show references]