// white = certain (either completely black or completely white) // black = uncertain (exactly 50% gray) static double g22pixelCertainty(double pixel) { ret absdiff(pixel, 0.5)*2; }