sbool iiSumRect_debug; static double iiSumRect(double[][] ii, Rect r) { if (r.y2() == 0 || r.x2() == 0) ret 0; double bottomLeft = r.x == 0 ? 0 : ii[r.y2()-1][r.x-1]; double bottomRight = ii[r.y2()-1][r.x2()-1]; double topLeft = r.x == 0 || r.y == 0 ? 0 : ii[r.y-1][r.x-1]; double topRight = r.y == 0 ? 0 : ii[r.y-1][r.x2()-1]; double result = bottomRight+topLeft-topRight-bottomLeft; if (iiSumRect_debug) printVars(+topLeft, +topRight, +bottomLeft, +bottomRight, +result); //ret bottomRight-topLeft-(topRight-topLeft)-(bottomLeft-topLeft); //ret bottomRight+topLeft-(topRight+bottomLeft); ret result; }
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: | #1009128 |
Snippet name: | iiSumRect - sum of rectangle brightness over integral image |
Eternal ID of this version: | #1009128/13 |
Text MD5: | 2614d6b4f061e8905d9b071a020848f0 |
Author: | stefan |
Category: | javax / ocr |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-07-06 01:08:52 |
Source code size: | 642 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 614 / 636 |
Version history: | 12 change(s) |
Referenced in: | [show references] |