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

18
LINES

< > BotCompany Repo | #1006343 // ocr_mergeOverlappingY_plusPercent

JavaX fragment (include)

1  
static L<Rect> ocr_mergeOverlappingY_plusPercent(L<Rect> l, float percent) {
2  
  l = cloneList(l);
3  
  bool change;
4  
  do {
5  
    change = false;
6  
    for i over l:
7  
      for (int j = i+1; j < l(l); j++) {
8  
        Range a = growRangeInPercent(rectYRange(l.get(i)), percent);
9  
        Range b = growRangeInPercent(rectYRange(l.get(j)), percent);
10  
        if (rangesOverlap(a, b)) {
11  
          l.set(i, mergeRects(l.get(i), l.get(j)));
12  
          l.remove(j--);
13  
          change = true;
14  
        }
15  
      }
16  
  } while (change);
17  
  ret l;
18  
}

Author comment

Began life as a copy of #1006336

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: #1006343
Snippet name: ocr_mergeOverlappingY_plusPercent
Eternal ID of this version: #1006343/1
Text MD5: f73a1c883a399c56e592bd3b4fe51785
Author: stefan
Category: javax / ocr
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-28 23:07:05
Source code size: 538 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 491 / 491
Referenced in: [show references]