1 | static L<Rect> ocr_hsplit(RGBImage img, bool[] split) {
|
2 | int w = img.w(), h = img.h(); |
3 | int x1 = 0, x = 0; |
4 | new L<Rect> l; |
5 | while (x < w) {
|
6 | while (x < w && split[x]) x++; |
7 | if (x > x1) {
|
8 | l.add(new Rect(x1, 0, x-x1, h)); |
9 | x1 = x; |
10 | } |
11 | while (x < w && !split[x]) x++; |
12 | if (x > x1) {
|
13 | l.add(new Rect(x1, 0, x-x1, h)); |
14 | x1 = x; |
15 | } |
16 | } |
17 | ret l; |
18 | } |
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: | 729 / 753 |
| Referenced in: | [show references] |