WebOCR/src/main/java/org/webocr/web/controller/OCRController.java
/**
     * Crop the selection of the image, save it on to the disk and feed it to
     * the OCR Handle.
     * 
     * @param img Image to be processed.
     * @param s Selection to crop.
     * @return
     */
Crop the selection of the image, save it on to the disk and feed it to
the OCR Handle.

@param img Image to be processed.
@param s Selection to crop.
@return
Crop the selection of the image save it on to the disk and feed it to the OCR Handle . @param img Image to be processed . @param s Selection to crop . @return
private String doOCR(BufferedImage img, SelectionData s) {
	BufferedImage selection = ImageUtil.cropImage(img, s.getX(), s.getY(), s.getWidth(), s.getHeight());
	selection = ImageUtil.upscaleImage(selection);
	selection = ImageUtil.sharpenImage(selection);
	String ocrData = null;
	try {
	    File file = ImageUtil.writeToTempFile(selection);
	    ocrData = OCRHandle.processImage(file.getAbsolutePath());
	    System.out.println(ocrData + "\n");
	} catch (IOException e) {
	    System.err.println("Cannot write to file.\n" + e.getLocalizedMessage());
	}
	return ocrData;
    }
private String doOCR ( BufferedImage img , SelectionData s ) { BufferedImage selection = ImageUtil . cropImage ( img , s . getX ( ) , s . getY ( ) , s . getWidth ( ) , s . getHeight ( ) ) ; selection = ImageUtil . upscaleImage ( selection ) ; selection = ImageUtil . sharpenImage ( selection ) ; String ocrData = null ; try { File file = ImageUtil . writeToTempFile ( selection ) ; ocrData = OCRHandle . processImage ( file . getAbsolutePath ( ) ) ; System . out . println ( ocrData + "\n" ) ; } catch ( IOException e ) { System . err . println ( "Cannot write to file.\n" + e . getLocalizedMessage ( ) ) ; } return ocrData ; }
Crop the selection of the image, save it on to the disk and feed it to
 the OCR Handle.
Crop the selection of the image save it on to the disk and feed it to the OCR Handle .
// Apply an up scale. // Apply a sharpening effect.