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

15
LINES

< > BotCompany Repo | #1027323 // bwFoldImage_withCorners2 - full convolution image including all partial matches [dev.]

JavaX fragment (include)

// minW/minH = how much of pattern has to be inside image
static BWImage bwFoldImage_withCorners2(BWImage big, BWImage pat, int minW, int minH) {
  int wp = pat.getWidth(), hp = pat.getHeight();
  int cutX = wp-minW, cutY = hp-minH;
  int w = big.getWidth(), h = big.getHeight();
  BWImage out = new(w-wp+minX*2, h-hp+minY*2);
  for (int y = cutX; y < h+min; y++)
    for (int x = cutY; x < w+wp; x++)
      out.setPixel(x, y, bwImageSectionsSimilarity2_partial(big, pat,
        x, y,
        max(0, wp-x), max(0, hp-y),
        min(wp, w+wp-x), min(hp, h+hp-y),
        0));
  ret out;
}

Author comment

Began life as a copy of #1027321

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

-
Snippet ID: #1027323
Snippet name: bwFoldImage_withCorners2 - full convolution image including all partial matches [dev.]
Eternal ID of this version: #1027323/1
Text MD5: f4986069ff8b9929d81ffc157f341141
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-03-04 16:05:24
Source code size: 603 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 182 / 209
Referenced in: