OpenALPR
This Cordova plugin adds support for the OpenALPR (Automatic License Plate Recognition) library, which provides support for retrieving the license plate from a picture.
Repo: https://github.com/iMicknl/cordova-plugin-openalpr
Installation
- Install the Cordova and Ionic Native plugins:
$ ionic cordova plugin add cordova-plugin-openalpr $ npm install --save @ionic-native/openalpr@4
- Add this plugin to your app's module
Supported platforms
- Android
- iOS
Usage
import { OpenALPR, OpenALPROptions, OpenALPRResult } from '@ionic-native/openalpr';
constructor(private openALPR: OpenALPR) { }
const scanOptions: OpenALPROptions = {
country: this.openALPR.Country.EU,
amount: 3
}
// To get imageData, you can use the @ionic-native/camera module for example. It works with DestinationType.FILE_URI and DATA_URL
this.openALPR.scan(imageData, scanOptions)
.then((res: [OpenALPRResult]) => console.log(res))
.catch((error: Error) => console.error(error));
Instance Members
Country
scan(imageData, options)
This function does something
Param | Type | Details |
---|---|---|
imageData |
any
|
Base64 encoding of the image data or the image file URI |
options |
OpenALPROptions
|
Options to pass to the OpenALPR scanner |
Returns: Promise<any>
Returns a promise that resolves when something happens