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

11
LINES

< > BotCompany Repo | #1006583 // ocr_walkInDirection - randomWalk

JavaX fragment (include)

1  
static int ocr_walkInDirection(RGBImage img, int x, int y, int dx, int dy, float tolerance) {
2  
  int length = 0;
3  
  int w = img.w(), h = img.h();
4  
  RGB rgb = img.getPixel(x, y);
5  
  while (x >= 0 && x < w && y >= 0 && y < h && rgbDiff(x, y) <= tolerance) {
6  
    ++length;
7  
    x += dx;
8  
    y += dy;
9  
  }
10  
  ret length;
11  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006583
Snippet name: ocr_walkInDirection - randomWalk
Eternal ID of this version: #1006583/1
Text MD5: 12e7c73b282f3603497501eeed36d33a
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-01-19 00:03:29
Source code size: 322 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 441 / 467
Referenced in: [show references]