//		outputImage =	ConvertBufferedImage.convertTo(binary8, null);
public static BufferedImage boofCVBinarization(BufferedImage image, int threshold) {
		GrayU8 input8 = ConvertBufferedImage.convertFrom(image,(GrayU8)null);
		GrayF32 input32 = ConvertBufferedImage.convertFromSingle(image, null, GrayF32.class);
		GrayU8 binary8 = new GrayU8(input8.getWidth(), input8.getHeight());
//		GrayF32 binary32 = new GrayF32(input8.getWidth(), input8.getHeight());
		boolean down = false;
		ThresholdImageOps.threshold(input8, binary8, threshold, down);
//		GThresholdImageOps.threshold(input32, binary8, threshold, down);
		BufferedImage outputImage = null;
//		outputImage =	ConvertBufferedImage.convertTo(binary8, null);
		boolean invert = false;
		outputImage = VisualizeBinaryData.renderBinary(binary8, invert, null);
		// 
//		outputImage = ImageUtil.removeAlpha(outputImage);
//		outputImage = ImageUtil.convertRGB(outputImage, 
//				new int[] {0x0d0d0d}, new int[] {0xffffff});
		return outputImage;
	}
// GThresholdImageOps.threshold(input32, binary8, threshold, down);
BufferedImage outputImage = null;
// outputImage = ConvertBufferedImage.convertTo(binary8, null);
boolean invert = false;
outputImage = VisualizeBinaryData.renderBinary(binary8, invert, null);
public static BufferedImage boofCVBinarization(BufferedImage image, int threshold) {
GrayU8 input8 = ConvertBufferedImage.convertFrom(image,(GrayU8)null);
GrayF32 input32 = ConvertBufferedImage.convertFromSingle(image, null, GrayF32.class);
GrayU8 binary8 = new GrayU8(input8.getWidth(), input8.getHeight());
// GrayF32 binary32 = new GrayF32(input8.getWidth(), input8.getHeight());
boolean down = false;
ThresholdImageOps.threshold(input8, binary8, threshold, down);
// GThresholdImageOps.threshold(input32, binary8, threshold, down);
BufferedImage outputImage = null;
// outputImage = ConvertBufferedImage.convertTo(binary8, null);
boolean invert = false;
outputImage = VisualizeBinaryData.renderBinary(binary8, invert, null);
//
// outputImage = ImageUtil.removeAlpha(outputImage);
// outputImage = ImageUtil.convertRGB(outputImage,
// new int[] {0x0d0d0d}, new int[] {0xffffff});
return outputImage;
}
public static BufferedImage boofCVBinarization(BufferedImage image, int threshold) {
GrayU8 input8 = ConvertBufferedImage.convertFrom(image,(GrayU8)null);
GrayF32 input32 = ConvertBufferedImage.convertFromSingle(image, null, GrayF32.class);
GrayU8 binary8 = new GrayU8(input8.getWidth(), input8.getHeight());
// GrayF32 binary32 = new GrayF32(input8.getWidth(), input8.getHeight());
boolean down = false;
ThresholdImageOps.threshold(input8, binary8, threshold, down);
// GThresholdImageOps.threshold(input32, binary8, threshold, down);
BufferedImage outputImage = null;
// outputImage = ConvertBufferedImage.convertTo(binary8, null);
boolean invert = false;
outputImage = VisualizeBinaryData.renderBinary(binary8, invert, null);
//
// outputImage = ImageUtil.removeAlpha(outputImage);
// outputImage = ImageUtil.convertRGB(outputImage,
// new int[] {0x0d0d0d}, new int[] {0xffffff});
return outputImage;
}