OCRNeuralNetwork/src/com/conordevilly/ocr/imageprocessing/ImageProcessor.java
public static ArrayList<Integer> convertToNumbers(BufferedImage input){
		ArrayList<Integer> ret = new ArrayList<Integer>();
		//Go through the image pixel by pixel
		for(int i = 0; i < input.getWidth(); i++){
			for(int j = 0; j < input.getHeight(); j++){
				//If the pixel is black, add a one to the list. Else add a 0
				ret.add((pixelAt(input, i, j)) ? 1 : 0);
			}
		}
		return ret;
	}
//Takes an image as input and returns an arraylist of integers. If a given pixel is black, its representation in the array list is a 1. Else its a 0.
Takes an image as input and returns an arraylist of integers. If a given pixel is black, its representation in the array list is a 1. Else its a 0.
Takes an image as input and returns an arraylist of integers . If a given pixel is black its representation in the array list is a 1 . Else its a 0 .
public static ArrayList<Integer> convertToNumbers(BufferedImage input){
		ArrayList<Integer> ret = new ArrayList<Integer>();
		for(int i = 0; i < input.getWidth(); i++){
			for(int j = 0; j < input.getHeight(); j++){
				ret.add((pixelAt(input, i, j)) ? 1 : 0);
			}
		}
		return ret;
	}
public static ArrayList < Integer > convertToNumbers ( BufferedImage input ) { ArrayList < Integer > ret = new ArrayList < Integer > ( ) ; for ( int i = 0 ; i < input . getWidth ( ) ; i ++ ) { for ( int j = 0 ; j < input . getHeight ( ) ; j ++ ) { ret . add ( ( pixelAt ( input , i , j ) ) ? 1 : 0 ) ; } } return ret ; }
Takes an image as input and returns an arraylist of integers.
Takes an image as input and returns an arraylist of integers .
//Go through the image pixel by pixel //If the pixel is black, add a one to the list. Else add a 0