Uses 5262K of libraries. Click here for Pure Java version (1092L/8K/27K).
1 | !752 |
2 | |
3 | lib 1003956 // TinyBrain sources from 2015-2-16 |
4 | |
5 | import eyedev._14.LineFinder; |
6 | import eyedev._09.Segment; |
7 | import eyedev._09.FlexibleSegmenter; |
8 | import prophecy.common.image.BWImage; |
9 | |
10 | p { |
11 | BWImage img = new BWImage(loadImg("#1004061")); |
12 | |
13 | new L<Segment> allSegments; |
14 | |
15 | // find lines |
16 | L<Segment> lines = new LineFinder().segment(img); |
17 | allSegments.addAll(lines); |
18 | |
19 | // find characters |
20 | new FlexibleSegmenter lineSegmenter; |
21 | //lineSegmenter.setThreshold(0.75f); |
22 | for (Segment line : lines) { |
23 | List<Segment> letters = lineSegmenter.segment(line.segmentImage); |
24 | //MarkLine baseLine = lineSegmenter.getMarkLine(MarkLine.Type.base); |
25 | //MarkLine topLine = lineSegmenter.getMarkLine(MarkLine.Type.top); |
26 | for (Segment letter : letters) |
27 | letter.boundingBox.translate(line.boundingBox.x, line.boundingBox.y); |
28 | allSegments.addAll(letters); |
29 | } |
30 | |
31 | final L<Rectangle> rects = collect(allSegments, "boundingBox"); |
32 | //psl(rects); |
33 | tbShowImageAndRects(img, rects); |
34 | } |
Began life as a copy of #1004063
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1004065 |
Snippet name: | Test Character Finding (Eye) |
Eternal ID of this version: | #1004065/1 |
Text MD5: | 2426ecf3dd5a83b62b021eb3771f41ed |
Transpilation MD5: | c687eceb79fa6d4492170346fcd62e8f |
Author: | stefan |
Category: | javax / ocr |
Type: | JavaX source code |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-08-05 14:01:43 |
Source code size: | 1022 bytes / 34 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 551 / 596 |
Referenced in: | [show references] |