Libraryless. Click here for Pure Java version (2595L/16K).
| 1 | static int[] ocr_leftProfile(BWImage img, double stopAtRatio) {
 | 
| 2 | int stopAt = min(img.getWidth()-1, iround(img.getWidth()*stopAtRatio)), h = img.getHeight(); | 
| 3 | int[] out = new int[h]; | 
| 4 |   for y to h: {
 | 
| 5 | int x = 0; | 
| 6 | while (x <= stopAt && img.getPixel(x, y) > 0.5f) ++x; | 
| 7 | out[y] = x; | 
| 8 | } | 
| 9 | ret out; | 
| 10 | } | 
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: | 416 / 528 | 
| Version history: | 3 change(s) | 
| Referenced in: | [show references] |