1 | sclass IIPadded extends Meta implements IIntegralImage {
|
2 | int w, h; |
3 | Rect innerRect; |
4 | RGB paddingColor = RGB(Color.black); |
5 | IIntegralImage inner; |
6 | |
7 | *(IIntegralImage *inner, int *w, int *h, int innerX1, int innerX2) {
|
8 | innerRect = rect(innerX1, innerX2, inner.getWidth(), inner.getHeight()); |
9 | } |
10 | |
11 | public int getWidth() { ret w; }
|
12 | public int getHeight() { ret h; }
|
13 | |
14 | // get pixel sum from 0, 0 through x, y (inclusively) |
15 | public double getIntegralValue(int x, int y, int channel) {
|
16 | int pad = paddingColor.getInt(channel); |
17 | if (y < innerY1) |
18 | if (x < innerX1) |
19 | ret pad*(x+1)*(y+1); |
20 | else |
21 | ret pad*(x+1) |
22 | if (x < splitPoint) |
23 | ret a->getIntegralValue(x, y, channel); |
24 | else ret |
25 | a->getIntegralValue(splitPoint, y, channel) |
26 | + b->getIntegralValue(x-splitPoint, y, channel); |
27 | } |
28 | } |
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: | 440 / 459 |
| Version history: | 2 change(s) |
| Referenced in: | [show references] |