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

31
LINES

< > BotCompany Repo | #1005711 // Test horizontalAutoSplit + autoCrop

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

Libraryless. Click here for Pure Java version (4142L/27K/92K).

!752

static BWImage img;
static ImageSurface is2;
static float threshold = 0.99f; // for horizontalAutoSplit

p {
  img = loadBWImage("#1005702");
  update();
}

svoid update() {
  RGBImage vis = visualize().toRGB();
  if (is2 == null) {
    is2 = showZoomedImage(vis);
    addToWindowAndPack(is2, liveSliderZeroToOne(threshold/10000f*9999f, voidfunc(float x) {
      threshold = x*10000f/9999f;
      update();
    }));
  } else
    is2.setImage(vis);
}

static BWImage visualize() {
  BWImage im = new BWImage(img);
  for (Rect r : horizontalAutoSplit(img, threshold)) {
    r = autoCropOfBWImage(img, r);
    darkenBWImagePart(im, r);
  }
  ret im;
}

Author comment

Began life as a copy of #1005706

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1005711
Snippet name: Test horizontalAutoSplit + autoCrop
Eternal ID of this version: #1005711/1
Text MD5: 58c8dc171ddb86737d95f01a0500c8b6
Transpilation MD5: a04b2b178467681803c78420eafc9024
Author: stefan
Category: javax / ocr
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-04 20:32:51
Source code size: 684 bytes / 31 lines
Pitched / IR pitched: No / No
Views / Downloads: 488 / 545
Referenced in: #1005726 - Split text into characters with table of characters and MD5s