0.0.1 • Published 6 months ago

@jcesarmobile/capacitor-ocr v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

@jcesarmobile/capacitor-ocr

Capacitor plugin for Optical Character Recognition (OCR). It does in device text recognition. On iOS it uses Vision framework provided by Apple. On Android it uses mlkit provided by Google. It has a dependency to com.google.mlkit:text-recognition, default version is 16.0.1, but can be configured with a textRecognitionVersion variable in your variables.gradle file.

Install

npm install @jcesarmobile/capacitor-ocr
npx cap sync

Example

An example app is available in example-app folder.

API

process(...)

process(options: { image: string; }) => Promise<RecognitionResults>

Process the text on the provided image. Only file urls (as the ones returned by Camera plugin) are supported at the moment.

ParamType
options{ image: string; }

Returns: Promise<RecognitionResults>


Interfaces

RecognitionResults

PropTypeDescriptionSince
resultsRecognitionResult[]List of recognized texts1.0.0

RecognitionResult

PropTypeDescriptionSince
textstringThe recognized text.1.0.0
confidencenumberThe confidence of the recognized text.1.0.0