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

17
LINES

< > BotCompany Repo | #1025228 // ii_averageBrightnessOfArea

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

Libraryless. Click here for Pure Java version (6746L/39K).

meta-for IIntegralImage in IIntegralImage, IntegralImage {
  static double ii_averageBrightnessOfArea(IIntegralImage img, int x1, int y1, int x2, int y2) {
    ret doubleRatio(img.rectSum(x1, y1, x2, y2), (x2-x1)*(y2-y1)*3);
  }
  
  static double ii_averageBrightnessOfArea(IIntegralImage img, int x1, int y1, int x2, int y2, int channel) {
    ret doubleRatio(img.rectSum(x1, y1, x2, y2, channel), (x2-x1)*(y2-y1));
  }
  
  static double ii_averageBrightnessOfArea(IIntegralImage img, Rect r) {
    ret ii_averageBrightnessOfArea(img, r.x, r.y, r.x2(), r.y2());
  }
  
  static double ii_averageBrightnessOfArea(IIntegralImage img, Rect r, int channel) {
    ret ii_averageBrightnessOfArea(img, r.x, r.y, r.x2(), r.y2(), channel);
  }
}

Author comment

Began life as a copy of #1019591

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1025228
Snippet name: ii_averageBrightnessOfArea
Eternal ID of this version: #1025228/9
Text MD5: 9dd10790ebd281843a0e7fea32cb401b
Transpilation MD5: f75a30de55a5c673745b09c896530f1b
Author: stefan
Category: javax / ocr
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-05 22:58:03
Source code size: 755 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 305 / 391
Version history: 8 change(s)
Referenced in: [show references]