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)
        Creates an OCRProcessor
        Parameters:
        context - used to create temporary files for preprocessing
    • Method Detail

      • processImage

        public OcrResult processImage​(java.io.File imageFile,
                                      OcrConfiguration configuration,
                                      OCREngineProgressListener progressListener)
                               throws OcrException,
                                      java.io.IOException,
                                      com.thegrizzlylabs.geniusscan.sdk.core.LicenseException,
                                      com.thegrizzlylabs.geniusscan.sdk.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
        configuration - OCR configuration
        progressListener - reporting OCR progress
        Returns:
        an object containing the detected text and its layout information
        Throws:
        OcrException - if OCR failed
        java.io.IOException - if image cannot be read
        com.thegrizzlylabs.geniusscan.sdk.core.LicenseException - if license is not valid anymore
        com.thegrizzlylabs.geniusscan.sdk.core.ProcessingException - if there is an error during preprocessing