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

9
LINES

< > BotCompany Repo | #1006386 // blackHigh

JavaX fragment (include)

1  
static float blackHigh_maxBrightness = 0.1f;
2  
3  
static Range blackHigh(RGBImage img, int x, int y) {
4  
  int h = img.h();
5  
  int y1 = y, y2 = y;
6  
  while (y1 > 0 && img.getPixel(x, y1-1).getBrightness() < blackHigh_maxBrightness) --y1;
7  
  while (y2 < h && img.getPixel(x, y2).getBrightness() < blackHigh_maxBrightness) ++y2;
8  
  ret new Range(y1, y2);
9  
}

Author comment

Began life as a copy of #1006382

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: #1006386
Snippet name: blackHigh
Eternal ID of this version: #1006386/1
Text MD5: fe2873cc7eb8c18fd46db0069a332add
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:13:09
Source code size: 352 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 497 / 527
Referenced in: [show references]