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

10
LINES

< > BotCompany Repo | #1024733 // ocr_leftProfile

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2595L/16K).

static int[] ocr_leftProfile(BWImage img, double stopAtRatio) {
  int stopAt = min(img.getWidth()-1, iround(img.getWidth()*stopAtRatio)), h = img.getHeight();
  int[] out = new int[h];
  for y to h: {
    int x = 0;
    while (x <= stopAt && img.getPixel(x, y) > 0.5f) ++x;
    out[y] = x;
  }
  ret out;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1024733
Snippet name: ocr_leftProfile
Eternal ID of this version: #1024733/4
Text MD5: ff6e68d4141d20729ff56307fe28f61a
Transpilation MD5: 5571ed4fafe9d7f729614250d061677c
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-24 15:25:20
Source code size: 315 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 200 / 272
Version history: 3 change(s)
Referenced in: [show references]