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

13
LINES

< > BotCompany Repo | #1027324 // bwFoldImage_withHalfCorners [dev.] - convolution image including partial matches where center of pattern is still in frame

JavaX fragment (include)

1  
static BWImage bwFoldImage_withHalfCorners(BWImage big, BWImage pat) {
2  
  int wp = pat.getWidth(), hp = pat.getHeight();
3  
  int w = big.getWidth(), h = big.getHeight();
4  
  BWImage out = new(w, h+);
5  
  for (int y = 0; y < h; y++)
6  
    for (int x = 0; x < w; x++)
7  
      out.setPixel(x, y, bwImageSectionsSimilarity2_partial(big, pat,
8  
        x, y,
9  
        max(0, wp/2-x), max(0, hp/2-y),
10  
        min(wp, w+wp-x), min(hp, h+hp-y),
11  
        0));
12  
  ret out;
13  
}

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: #1027324
Snippet name: bwFoldImage_withHalfCorners [dev.] - convolution image including partial matches where center of pattern is still in frame
Eternal ID of this version: #1027324/1
Text MD5: 76ef4b47becbf90e5a43e3a315b6b1e9
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:06:43
Source code size: 460 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 140 / 181
Referenced in: [show references]