Class OcrProcessor


  • public final class OcrProcessor
    extends java.lang.Object
    Class that allows running OCR on an image file.
    • Constructor Detail

      • OcrProcessor

        public OcrProcessor​(android.content.Context context,
                            OcrConfiguration configuration,
                            OCREngineProgressListener progressListener)
        Creates an OCRProcessor
        Parameters:
        context - used to create temporary files for preprocessing
        configuration - OCR configuration
        progressListener - 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 failed
        com.geniusscansdk.core.LicenseException - if license is not valid anymore
        com.geniusscansdk.core.ProcessingException - if there is an error during preprocessing