OCRNeuralNetwork/src/com/conordevilly/ocr/imageprocessing/ImageProcessor.java
public static BufferedImage binarise(BufferedImage input){
		//Create a new canvas only allowing black / white
		BufferedImage blackWhiteImg = new BufferedImage(input.getWidth(), input.getHeight(), BufferedImage.TYPE_BYTE_BINARY);
		//Paint the existing image
		Graphics g2d = blackWhiteImg.createGraphics();
		g2d.drawImage(input, 0, 0, null);
		g2d.dispose();
		return blackWhiteImg;
	}
//Convert an image to black & white
Convert an image to black & white
Convert an image to black & white
public static BufferedImage binarise(BufferedImage input){
		BufferedImage blackWhiteImg = new BufferedImage(input.getWidth(), input.getHeight(), BufferedImage.TYPE_BYTE_BINARY);
		Graphics g2d = blackWhiteImg.createGraphics();
		g2d.drawImage(input, 0, 0, null);
		g2d.dispose();
		return blackWhiteImg;
	}
public static BufferedImage binarise ( BufferedImage input ) { BufferedImage blackWhiteImg = new BufferedImage ( input . getWidth ( ) , input . getHeight ( ) , BufferedImage . TYPE_BYTE_BINARY ) ; Graphics g2d = blackWhiteImg . createGraphics ( ) ; g2d . drawImage ( input , 0 , 0 , null ) ; g2d . dispose ( ) ; return blackWhiteImg ; }
Convert an image to black & white
Convert an image to black & white
//Create a new canvas only allowing black / white //Paint the existing image