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

34
LINES

< > BotCompany Repo | #1004065 // Test Character Finding (Eye)

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Uses 5262K of libraries. Click here for Pure Java version (1092L/8K/27K).

!752

lib 1003956 // TinyBrain sources from 2015-2-16

import eyedev._14.LineFinder;
import eyedev._09.Segment;
import eyedev._09.FlexibleSegmenter;
import prophecy.common.image.BWImage;

p {
  BWImage img = new BWImage(loadImg("#1004061"));
  
  new L<Segment> allSegments;
  
  // find lines
  L<Segment> lines = new LineFinder().segment(img);
  allSegments.addAll(lines);
  
  // find characters
  new FlexibleSegmenter lineSegmenter;
  //lineSegmenter.setThreshold(0.75f);
  for (Segment line : lines) {
    List<Segment> letters = lineSegmenter.segment(line.segmentImage);
    //MarkLine baseLine = lineSegmenter.getMarkLine(MarkLine.Type.base);
    //MarkLine topLine = lineSegmenter.getMarkLine(MarkLine.Type.top);
    for (Segment letter : letters)
      letter.boundingBox.translate(line.boundingBox.x, line.boundingBox.y);
    allSegments.addAll(letters);
  }

  final L<Rectangle> rects = collect(allSegments, "boundingBox");
  //psl(rects);
  tbShowImageAndRects(img, rects);
}

Author comment

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: 549 / 593
Referenced in: [show references]