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

19
LINES

< > BotCompany Repo | #1019596 // bwIntegralImage_sumRect - sum of rectangle brightness over integral image

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (11379L/65K).

static int bwIntegralImage_sumRect(BWIntegralImage img, int x1, int y1, int x2, int y2) {
  int bottomLeft  = img.getIIValue(x1-1, y2-1);
  int bottomRight = img.getIIValue(x2-1, y2-1);
  int topLeft     = img.getIIValue(x1-1, y1-1);
  int topRight    = img.getIIValue(x2-1, y1-1);
  ret bottomRight+topLeft-topRight-bottomLeft;
}

meta-for int in int, dbl {

  static int bwIntegralImage_sumRect(IBWIntegralImage img, int x1, int y1, int x2, int y2) {
    int bottomLeft  = img.getIIValue(x1-1, y2-1);
    int bottomRight = img.getIIValue(x2-1, y2-1);
    int topLeft     = img.getIIValue(x1-1, y1-1);
    int topRight    = img.getIIValue(x2-1, y1-1);
    ret bottomRight+topLeft-topRight-bottomLeft;
  }
  
}

Author comment

Began life as a copy of #1019591

download  show line numbers  debug dex  old transpilations   

Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019596
Snippet name: bwIntegralImage_sumRect - sum of rectangle brightness over integral image
Eternal ID of this version: #1019596/6
Text MD5: 13b356e8d2932f0d7f407dff29d42293
Transpilation MD5: dee72c32145ba9668c9da4de4d94717d
Author: stefan
Category: javax / ocr
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-11-03 18:35:57
Source code size: 728 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 359 / 500
Version history: 5 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1026934 - bwContrastQuadtree_minOfArea [OK]