1 | static byte[] ocr_rightProfile_scaledTo127(int n, double stopAtRatio, BWImage img) {
|
2 | int w = img.getWidth(), h = img.getHeight(); |
3 | int stopAt = min(w, iround(w*stopAtRatio)); |
4 | byte[] out = new byte[n]; |
5 | for y to n: {
|
6 | int realY = ifloor(y*h/n); |
7 | int x = 0; |
8 | while (x < stopAt && img.getPixel(w-1-x, realY) > 0.5f) ++x; |
9 | out[y] = (byte) iround(x*127.0/stopAt); |
10 | } |
11 | ret out; |
12 | } |
Began life as a copy of #1024735
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: | #1024736 |
| Snippet name: | ocr_rightProfile_scaledTo127 |
| Eternal ID of this version: | #1024736/1 |
| Text MD5: | 79cee06736cbe60ecec81684555b2090 |
| 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:37:49 |
| Source code size: | 404 bytes / 12 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 440 / 460 |
| Referenced in: | [show references] |