static int ocr_walkInDirection(RGBImage img, int x, int y, int dx, int dy, float tolerance) { int length = 0; int w = img.w(), h = img.h(); RGB rgb = img.getPixel(x, y); while (x >= 0 && x < w && y >= 0 && y < h && rgbDiff(x, y) <= tolerance) { ++length; x += dx; y += dy; } ret length; }
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: | 730 / 762 |
| Referenced in: | [show references] |