1 | static float wideBlack_maxBrightness = 0.1f; |
2 | |
3 | static Range wideBlack(RGBImage img, int x, int y) { |
4 | int w = img.w(); |
5 | int x1 = x, x2 = x; |
6 | while (x1 > 0 && img.getPixel(x1-1, y).getBrightness() < wideBlack_maxBrightness) --x1; |
7 | while (x2 < w && img.getPixel(x2, y).getBrightness() < wideBlack_maxBrightness) ++x2; |
8 | ret new Range(x1, x2); |
9 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1006382 |
Snippet name: | wideBlack |
Eternal ID of this version: | #1006382/1 |
Text MD5: | 76a827c20dd45512614a50ca9a5a1882 |
Author: | stefan |
Category: | javax / ocr |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-12-30 00:14:11 |
Source code size: | 352 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 563 / 577 |
Referenced in: | [show references] |