OCRNeuralNetwork/src/com/conordevilly/ocr/imageprocessing/ImageProcessor.java
public static ArrayList<BufferedImage> extractIndivChar(BufferedImage input){
		ArrayList<BufferedImage> ret = new ArrayList<BufferedImage>();
		boolean pixFound;
		boolean prev = true; //Images should have marginal whitespace removed => for first col: pixFound == true
		int lastX = 0;

		//Go through each column
		for(int i = 0; i < input.getWidth(); i++){
			pixFound = false;

			//Scan the column and see if a black pixel is found
			for(int j = 0; j < input.getHeight(); j++){
				pixFound = (pixelAt(input, i, j)) ? true : pixFound;
			}

			//If a pixel is found, but none has been found in the previous col, make a new subimg
			if((pixFound == true) && (pixFound != prev)){
				ret.add(input.getSubimage(lastX, 0, (i - lastX), input.getHeight()));
				lastX = i;
			}

			prev = pixFound;
		}
		
		//Add the remaining character to the list
		ret.add(input.getSubimage(lastX, 0, (input.getWidth() - lastX), input.getHeight()));
		
		return ret;
	}
/*
	 * Character extraction algorithm:
	 * Scan each column.
	 * If a pixel exists in a column, set pixFound = true
	 * Once a row has been scanned, set prev = pixFound
	 * If a pixel had been found, but none was found in the row before that, it means that an entire character has been scanned
	 * If that is the case, create a subimage of the character scanned and add it to the list
	 */
Character extraction algorithm:
Scan each column.
If a pixel exists in a column, set pixFound = true
Once a row has been scanned, set prev = pixFound
If a pixel had been found, but none was found in the row before that, it means that an entire character has been scanned
If that is the case, create a subimage of the character scanned and add it to the list
Character extraction algorithm : Scan each column . If a pixel exists in a column set pixFound = true Once a row has been scanned set prev = pixFound If a pixel had been found but none was found in the row before that it means that an entire character has been scanned If that is the case create a subimage of the character scanned and add it to the list
public static ArrayList<BufferedImage> extractIndivChar(BufferedImage input){
		ArrayList<BufferedImage> ret = new ArrayList<BufferedImage>();
		boolean pixFound;
		boolean prev = true; 
		int lastX = 0;
		for(int i = 0; i < input.getWidth(); i++){
			pixFound = false;
			for(int j = 0; j < input.getHeight(); j++){
				pixFound = (pixelAt(input, i, j)) ? true : pixFound;
			}
			if((pixFound == true) && (pixFound != prev)){
				ret.add(input.getSubimage(lastX, 0, (i - lastX), input.getHeight()));
				lastX = i;
			}
			prev = pixFound;
		}
		ret.add(input.getSubimage(lastX, 0, (input.getWidth() - lastX), input.getHeight()));
		return ret;
	}
public static ArrayList < BufferedImage > extractIndivChar ( BufferedImage input ) { ArrayList < BufferedImage > ret = new ArrayList < BufferedImage > ( ) ; boolean pixFound ; boolean prev = true ; int lastX = 0 ; for ( int i = 0 ; i < input . getWidth ( ) ; i ++ ) { pixFound = false ; for ( int j = 0 ; j < input . getHeight ( ) ; j ++ ) { pixFound = ( pixelAt ( input , i , j ) ) ? true : pixFound ; } if ( ( pixFound == true ) && ( pixFound != prev ) ) { ret . add ( input . getSubimage ( lastX , 0 , ( i - lastX ) , input . getHeight ( ) ) ) ; lastX = i ; } prev = pixFound ; } ret . add ( input . getSubimage ( lastX , 0 , ( input . getWidth ( ) - lastX ) , input . getHeight ( ) ) ) ; return ret ; }
Character extraction algorithm:
 Scan each column.
Character extraction algorithm : Scan each column .
//Images should have marginal whitespace removed => for first col: pixFound == true //Go through each column //Scan the column and see if a black pixel is found //If a pixel is found, but none has been found in the previous col, make a new subimg //Add the remaining character to the list