Convert Image to Text using Java
Perform OCR on an Image
Aspose.OCR for Java provides the following methods to perform OCR operation on images.
- RecognizePage: Recognizing text on some page, It detects where is the paragraph or header and recognizes each of the text segments.
- RecognizeLine: Perform OCR operation on the image containing a single line.
Performing OCR on an image of a page
Aspose.OCR provides the RecognizePage method that detects where the header or paragraph is and recognizes each text segment. The RecognizePage method takes the image path as a parameter and returns the recognized text. The following code snippet demonstrates the use of the RecognizePage method to perform OCR on an image.
Performing OCR on a Buffered image
The RecognizePage overloaded method takes the buffered image as a parameter and returns the recognized text. The following code snippet demonstrates the use of the RecognizePage method to perform OCR on a buffered image.
Performing OCR on an image of a line
The following code snippet demonstrates the use of the RecognizeLine method to perform OCR operation on the image containing a single line.