static L<Rect> ocr_vsplit(RGBImage img, bool[] split) { int w = img.w(), h = img.h(); int y1 = 0, y = 0; new L<Rect> l; while (y < h) { while (y < h && split[y]) y++; if (y > y1) { l.add(new Rect(0, y1, w, y-y1)); y1 = y; } while (y < h && !split[y]) y++; if (y > y1) { l.add(new Rect(0, y1, w, y-y1)); y1 = y; } } ret l; }
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: | #1006388 |
| Snippet name: | ocr_vsplit |
| Eternal ID of this version: | #1006388/1 |
| Text MD5: | 3508634ef85cfcedd8e16f38acf5986e |
| 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:54 |
| Source code size: | 400 bytes / 18 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 748 / 777 |
| Referenced in: | #1006390 - ocr_hsplit #1006654 - Standard functions list 2 (LIVE, continuation of #761) |