code: public static void removePointNoise(GrayU8 input, GrayU8 output) {
  		for (int y = 0; y < input.height; y++) {
  			for (int x = 0; x < input.width; x++) {
  				int num = 0;
  				if (getF(input, x - 1, y + 1)) num++;
  				if (getF(input, x, y + 1)) num++;
  				if (getF(input, x + 1, y + 1)) num++;
  				if (getF(input, x + 1, y)) num++;
  				if (getF(input, x + 1, y - 1)) num++;
  				if (getF(input, x, y - 1)) num++;
  				if (getF(input, x - 1, y - 1)) num++;
  				if (getF(input, x - 1, y)) num++;
  
  				if (num < 2)
  					output.set(x, y, 0);
  				else if (num > 6)
  					output.set(x, y, 1);
  				else
  					output.set(x, y, input.get(x, y));
  			}
  		}
  	}
docs: Binary operation which is designed to remove small bits of spurious noise.  An 8-neighborhood is used.
  If a pixel is connected to less than 2 neighbors then its value zero.  If connected to more than 6 then
  its value is one.  Otherwise it retains its original value.
  
  @param input  Input image. Not modified.
  @param output If not null, the output image.  If null a new image is declared and returned.  Modified.
  @return Output image.