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

13
LINES

< > BotCompany Repo | #1027295 // bwLocalMaximaFilter

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

Libraryless. Click here for Pure Java version (5112L/33K).

static BWImage bwLocalMaximaFilter(BWImage img) {
  int w = img.getWidth(), h = img.getHeight();
  BWImage img2 = new(w, h);
  for y to h:
    for x to w:
      img2.setPixel(x, y,
        img.getPixel(x, y)-
        (img.getPixel(x, max(0, y-1)) +
        img.getPixel(max(0, x-1), y) +
        img.getPixel(min(w-1, x+1), y) +
        img.getPixel(x, min(h-1, y+1)))/4);
  ret img2;
}

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: #1027295
Snippet name: bwLocalMaximaFilter
Eternal ID of this version: #1027295/1
Text MD5: 204b7b5f7e3efd7b771de8120cc3bf1e
Transpilation MD5: 2880fd0f75bff6075aa8666c870cdc76
Author: stefan
Category: javax / images
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-29 23:55:07
Source code size: 398 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 180 / 257
Referenced in: [show references]