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

9
LINES

< > BotCompany Repo | #1006386 // blackHigh

JavaX fragment (include)

static float blackHigh_maxBrightness = 0.1f;

static Range blackHigh(RGBImage img, int x, int y) {
  int h = img.h();
  int y1 = y, y2 = y;
  while (y1 > 0 && img.getPixel(x, y1-1).getBrightness() < blackHigh_maxBrightness) --y1;
  while (y2 < h && img.getPixel(x, y2).getBrightness() < blackHigh_maxBrightness) ++y2;
  ret new Range(y1, y2);
}

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: 498 / 527
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)