Skip to content

A fork of the capacitor-plugin-ml-kit-text-recognition library which exposes additional information such as bounding boxes back to the Capacitor Plugin

License

Notifications You must be signed in to change notification settings

alistairheath/capacitor-plugin-ml-kit-text-recognition

 
 

Repository files navigation

@pantrist/capacitor-plugin-ml-kit-text-recognition

npm version

Capacitor Wrapper for TextRecognition of Googles ML-Kit

Install

npm install @pantrist/capacitor-plugin-ml-kit-text-recognition
npx cap sync

Configuration

Android

Optional but recommended: You can configure your app to automatically download the ML model to the device after your app is installed from the Play Store. To do so, add the following declaration to your app's AndroidManifest.xml file:

<application ...>
  ...
  <meta-data
      android:name="com.google.mlkit.vision.DEPENDENCIES"
      android:value="ocr" />
  <!-- To use multiple models: android:value="ocr,model2,model3" -->
</application>

iOS

Nothing to do for iOS

Supported methods

Name Android iOS Web
detectText

API

detectText(...)

detectText(options: DetectImageOptions) => Promise<TextDetectionResult>

Tries to detect text from the given image

Param Type Description
options DetectImageOptions Options for the text detection

Returns: Promise<TextDetectionResult>


Interfaces

TextDetectionResult

Prop Type Description
text string Found text
lines string[] Parsed text by lines

DetectImageOptions

Prop Type Description
base64Image string The image to detect texts from

About

A fork of the capacitor-plugin-ml-kit-text-recognition library which exposes additional information such as bounding boxes back to the Capacitor Plugin

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 26.2%
  • Kotlin 19.2%
  • TypeScript 16.0%
  • Java 13.3%
  • Ruby 12.0%
  • Objective-C 7.9%
  • JavaScript 5.4%