OcrProcessor

class OcrProcessor(context: Context, configuration: OcrConfiguration, progressListener: OcrProcessor.ProgressListener? = null)

Class that allows running OCR on an image file.

Parameters

context

used to create temporary files for preprocessing

configuration

OCR configuration

progressListener

reporting OCR progress

Constructors

Link copied to clipboard
constructor(context: Context, configuration: OcrConfiguration, progressListener: OcrProcessor.ProgressListener? = null)

Types

Link copied to clipboard

Functions

Link copied to clipboard

Preload models required for OCR processing, if possible. There's no guarantee that the models will be available when an image is processed for OCR (for example if no Internet connection is available), but it's still recommended to preload them as soon as the list of languages is known.

Link copied to clipboard
fun processImage(imageFile: File): OcrResult

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.