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

Editing Snippet ID: #1033567
Snippet name:
Category, Type:
Content:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
static BufferedImage grayImageFromIBWIntegralImage(IBWIntegralImage 
img) {
  int w = img.getWidth(), h = img.getHeight();
  byte[] pixels = new[w*h];
  int i = 0;
  for y to h:
    for x to w: {
      int pixel = img.getPixelBrightness(x, y);
      ifdef grayImageFromIBWIntegralImage_debug
        if (x == 0 && y == 0) print(+pixel);
      endifdef
      pixels[i++] = clampToUByte(pixel;
    }
  ret newGrayBufferedImage(w, h, pixels);
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Comment:
Public (visible to everyone):
Created: 2021-11-03 18:00:03

This page without fancy editor.