Package com.geniusscansdk.ocr
Class OcrProcessor
- java.lang.Object
-
- com.geniusscansdk.ocr.OcrProcessor
-
public final class OcrProcessor extends java.lang.Object
Class that allows running OCR on an image file.
-
-
Constructor Summary
Constructors Constructor Description OcrProcessor(android.content.Context context, OcrConfiguration configuration, OCREngineProgressListener progressListener)
Creates an OCRProcessor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OcrResult
processImage(java.io.File imageFile)
Perform OCR on an image.
-
-
-
Constructor Detail
-
OcrProcessor
public OcrProcessor(android.content.Context context, OcrConfiguration configuration, OCREngineProgressListener progressListener)
Creates an OCRProcessor- Parameters:
context
- used to create temporary files for preprocessingconfiguration
- OCR configurationprogressListener
- reporting OCR progress
-
-
Method Detail
-
processImage
public OcrResult processImage(java.io.File imageFile) throws OcrException, com.geniusscansdk.core.LicenseException, com.geniusscansdk.core.ProcessingException
Perform OCR on an image. This will take care of filtering the image for optimal OCR. For optimal results it's recommended that you provide a properly cropped document without distortion.- Parameters:
imageFile
- image on which OCR should be applied- Returns:
- an object containing the detected text and its layout information
- Throws:
OcrException
- if OCR failedcom.geniusscansdk.core.LicenseException
- if license is not valid anymorecom.geniusscansdk.core.ProcessingException
- if there is an error during preprocessing
-
-