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

28
LINES

< > BotCompany Repo | #1032170 // IIPadded - padded IIntegralImage [abandoned - use iiPad instead]

JavaX fragment (include)

sclass IIPadded extends Meta implements IIntegralImage {
  int w, h;
  Rect innerRect;
  RGB paddingColor = RGB(Color.black);
  IIntegralImage inner;
  
  *(IIntegralImage *inner, int *w, int *h, int innerX1, int innerX2) {
    innerRect = rect(innerX1, innerX2, inner.getWidth(), inner.getHeight());
  }
  
  public int getWidth() { ret w; }
  public int getHeight() { ret h; }

  // get pixel sum from 0, 0 through x, y (inclusively)
  public double getIntegralValue(int x, int y, int channel) {
    int pad = paddingColor.getInt(channel);
    if (y < innerY1)
      if (x < innerX1)
        ret pad*(x+1)*(y+1);
      else
        ret pad*(x+1)
    if (x < splitPoint)
      ret a->getIntegralValue(x, y, channel);
    else ret
      a->getIntegralValue(splitPoint, y, channel)
        + b->getIntegralValue(x-splitPoint, y, channel);
  }
}

Author comment

Began life as a copy of #1031964

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032170
Snippet name: IIPadded - padded IIntegralImage [abandoned - use iiPad instead]
Eternal ID of this version: #1032170/3
Text MD5: 5f3662b367dc752e9293a6ddcd101cb5
Author: stefan
Category: javax / image recognition
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-17 14:52:24
Source code size: 870 bytes / 28 lines
Pitched / IR pitched: No / No
Views / Downloads: 83 / 98
Version history: 2 change(s)
Referenced in: [show references]