Giter VIP home page Giter VIP logo

imicknl / cordova-plugin-openalpr Goto Github PK

View Code? Open in Web Editor NEW
32.0 7.0 23.0 69.62 MB

This Cordova plugin adds support for the OpenALPR (Automatic License Plate Recognition) library, which provides support for retrieving the license plate from a picture.

License: MIT License

Objective-C 0.25% C 18.45% C++ 78.23% JavaScript 0.03% Objective-C++ 0.24% Java 2.80%
openalpr cordova-plugin plate-recognition cordova-openalpr-plugin

cordova-plugin-openalpr's Introduction

Cordova OpenALPR plugin

This Cordova plugin adds support for the OpenALPR (Automatic License Plate Recognition) library which provides support for retrieving the license plate from a picture. You can pass an image using Base64 or the file path to the OpenALPR plugin.

Supported platforms

The current master branch supports the following platforms:

  • iOS (>= 8)
  • Android (>= SDK 21)

Installation

This plugin requires Cordova 5.0+ and can be installed from the Cordova Plugin Registry. If you use Ionic 3 or Ionic 4, you should also install the @ionic-native binding.

cordova plugin add cordova-plugin-openalpr

npm install @ionic-native/openalpr

Examples

Ionic 1 / PhoneGap

This plugin defines a global cordova.plugins.OpenALPR object which provides an API for scanning license plates. It is possible to use the output of cordova-plugin-camera and pass it to the scan function of this plugin.

cordova.plugins.OpenALPR.scan(
  filepath,
  { country: "eu", amount: 3 },
  function(results) {
    console.log(results);
  },
  function(error) {
    console.log(error.code + ": " + error.message);
  }
);

Ionic 3

This plugin has a @ionic-native/openalpr binding available, which makes it easy to include it in your Ionic 3 project. You can use the output of @ionic-native/camera and pass it to the scan function of this plugin.

There is also an Ionic 3 example project available which shows the possible implementation of cordova-plugin-openalpr.

import { Camera, CameraOptions } from '@ionic-native/camera';
import { OpenALPR, OpenALPROptions, OpenALPRResult } from 'cordova-plugin-openalpr/native';

constructor(private camera: Camera, private openALPR: OpenALPR) {

}

const cameraOptions: CameraOptions = {
    quality: 100,
    destinationType: this.camera.DestinationType.FILE_URI,
    encodingType: this.camera.EncodingType.JPEG,
    mediaType: this.camera.MediaType.PICTURE,
    sourceType: this.camera.PictureSourceType.CAMERA
}

const scanOptions: OpenALPROptions = {
    country: this.openalpr.Country.EU,
    amount: 3
}

this.camera.getPicture(cameraOptions).then((imageData) => {
    this.openALPR.scan(imageData)
        .then((result: [OpenALPRResult]) => console.log(result[0].number))
        .catch((error: Error) => console.error(error));
});

This plugin is only supported on iOS / Android, however in order to speed up development you can make use of mocking and browser development.

Ionic 4

This plugin has a @ionic-native/openalpr binding available, which makes it easy to include it in your Ionic 4 project. You can use the output of @ionic-native/camera and pass it to the scan function of this plugin. (Check the code snippet for Ionic 3 for a reference).

There is also an Ionic 4 example project available which shows the possible implementation of cordova-plugin-openalpr.

Known Issues

Android: PictureSourceType.PHOTOLIBRARY isn't supported (yet)

In Android apps, passing the file uri from PictureSourceType.PHOTOLIBRARY isn't supported yet. This is because the photolibrary returns a different kind of path than the camera does. The cordova-plugin-filepath might provide a workaround for now but this has not been tested yet.

Notes

  • This project includes prebuilt OpenALPR libraries for iOS and Android, because the compilation of the OpenALPR framework requires a lot of effort and dependencies.
  • This project is not used in production anymore and won't be maintained actively. We can't guarantee that we can respond quickly to issues / pull requests, however we will keep an eye on the repository.

License

MIT, but keep in mind that OpenALPR itself is licensed under AGPL-3.0.

Credits

cordova-plugin-openalpr's People

Contributors

imicknl avatar melvinversluijs avatar singhc00 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-plugin-openalpr's Issues

Is it possible to use this in phonegap?

Hi there,

How would I implement this into PhoneGap?
Do I need to include the JS file in the Index.html?

I'm having trouble actually calling the function from my index.js file, it doesn't seem to do anything. No errors, no output.

dataURI instead of filePath

Hi there,

I am wondering if you tried and managed to pass a dataURI (base64) or a byte array to the OpenALPR.scan() function instead of a file path. I saw in the ALPR.java that it should be possible in general but could not manage to get it working.

What I have tried is following:

  • give a base64 dataURI as argument to OpenALPR.scan() and bypass if(imageExists) in OpenALPR.java
  • convert the handed over dataURI to byte array by import android.util.Base64; and then byte[] decoded = Base64.decode(dataURI, Base64.DEFAULT); inside of the scan() method
  • use the decoded variable here: 'results = alpr.recognize(decoded);'
  • rm / add platform

It seems to compile well but when I execute this I never get a positive result from OpenALPR. Do you have any idea how to get this working? I think this might be a useful functionality for the plugin as well as you can skip the file writing before recognizing.

Cheers
czery

Improve iOS support

  • Run APLR on background thread
  • Check if removing file:// from file path is necessary
  • Better error handling / callbacks
  • Don't hardcode country type (EU), but pass it through JS
  • Check for memory leaks
  • Add (unit) tests
  • Rewrite to modern Objective C syntax
  • Update openalpr.conf file to resolve Missing config value for runtime_dir issue

java.lang.UnsatisfiedLinkError: dlopen failed: library "libopenalprjni.so" not found

I get this error whenever I try to scan some images using OpenALPR.scan(result.value, scanOptions), it's worth nothing that the build gradle for the openalpr is this:

repositories {
    google()
    mavenCentral()
    flatDir{
        dirs 'src/main/libs', 'libs'
    }
}

dependencies {
    implementation fileTree(dir: 'src/main/libs', include: ['*.jar'])
    implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
    implementation "org.apache.cordova:framework:$cordovaAndroidVersion"
    // SUB-PROJECT DEPENDENCIES START
    implementation "androidx.core:core:1.6.+"
    // SUB-PROJECT DEPENDENCIES END
}

While my directory actually shows src/main/jniLibs/armeabi-v7a , changing the gradle to such did not appear to help however

using version 2.1.0 for this repo

Not working on arm64-v8a, x86 or x86_64 Android devices.

Hi,

I receive no error or response using Ionic 4, anyone else had an issue?

Ionic:

   ionic (Ionic CLI)             : 4.12.0 (.nvm/versions/node/v10.4.0/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.2.0
   @angular-devkit/build-angular : 0.13.8
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.3.8
   @ionic/angular-toolkit        : 1.4.1

Cordova:

   cordova (Cordova CLI) : 9.0.0 ([email protected])
   Cordova Platforms     : android 6.4.0
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.0.1, (and 12 other plugins)

System:

   Android SDK Tools : 26.1.1 (/Library/Android/sdk)
   NodeJS            : v10.4.0 (/.nvm/versions/node/v10.4.0/bin/node)
   npm               : 6.5.0
   OS                : macOS Mojave
public getText(imageData): Promise<any> {

    return new Promise<any>((resolve, reject) => {

      console.log("hit");

      this.openalpr.scan(imageData, this.openAlprOptions)
        .catch((err) => {

          console.error('not hit');
          reject(err)

        })
        .then((result) => 
        {
          console.log("not it");
          console.log(result);
          resolve(result);
        }
        );
    });
  }

Android armeabi-v7a issue?

So, I've started getting the below error on Google Play,

This release is not compliant with the Google Play 64-bit requirement.
The following APKs or App Bundles are available to 64-bit devices, but they only have 32-bit native code: [30000]
Include 64-bit and 32-bit native code in your app. Use the Android App Bundle publishing format to automatically ensure that each device architecture receives only the native code it needs. This avoids increasing the overall size of your app.

and I think it might be something related to the below,

> Task :app:extractReleaseNativeSymbolTables
Unable to extract native debug metadata from /Development/app/platforms/android/app/build/intermediates/merged_native_libs/release/out/lib/armeabi-v7a/libnativealpr.so because unable to locate the objcopy executable for the armeabi-v7a ABI.
Unable to extract native debug metadata from /Development/app/platforms/android/app/build/intermediates/merged_native_libs/release/out/lib/armeabi-v7a/libtess.so because unable to locate the objcopy executable for the armeabi-v7a ABI.
Unable to extract native debug metadata from /Development/app/platforms/android/app/build/intermediates/merged_native_libs/release/out/lib/armeabi-v7a/libopencv_java3.so because unable to locate the objcopy executable for the armeabi-v7a ABI.
Unable to extract native debug metadata from /Development/app/platforms/android/app/build/intermediates/merged_native_libs/release/out/lib/armeabi-v7a/libopenalprjni.so because unable to locate the objcopy executable for the armeabi-v7a ABI.
Unable to extract native debug metadata from /Development/app/platforms/android/app/build/intermediates/merged_native_libs/release/out/lib/armeabi-v7a/libjpgt.so because unable to locate the objcopy executable for the armeabi-v7a ABI.
Unable to extract native debug metadata from /Development/app/platforms/android/app/build/intermediates/merged_native_libs/release/out/lib/armeabi-v7a/liblept.so because unable to locate the objcopy executable for the armeabi-v7a ABI.
Unable to extract native debug metadata from /Development/app/platforms/android/app/build/intermediates/merged_native_libs/release/out/lib/armeabi-v7a/libpngt.so because unable to locate the objcopy executable for the armeabi-v7a ABI.

does anyone have any ideas on how to fix? Thanks.

opencv2/highgui/highgui.hpp' file not found

When I run ionic build ios I get the following error message:

/Plugins/cordova-plugin-openalpr/PlateScanner.h:12:10: fatal error: 'opencv2/highgui/highgui.hpp' file not found                 
#include "opencv2/highgui/highgui.hpp"  

Thanks

Unable to find Reg in Image

Hi

I am using the Telerik Platform and have successfully plugged in the Cordova control.

I have changed line 74 of the file OpenALPR.java to use the "gb" type of filtering however the array comes back empty?

1498467368998 1

Hope you have time to help

regards

Tom Williams

Always returning empty array

Hi,
I'm trying to use this plugin with Ionic 4. The issue is that the plugin returns always an empty array as result. I pass a base64 image to the scan method.

myMethod() {
      this.camera.getPicture({
        encodingType: this.camera.EncodingType.JPEG,
        mediaType: this.camera.MediaType.PICTURE,
        destinationType: this.camera.DestinationType.DATA_URL,
        allowEdit: false
      }).then((base64) => {
        this.processOpenALPR('data:image/jpeg;base64,' + base64);
      }).catch((error) => {
        alert('Unable to get picture from camera. See log.');
        console.error(error);
      });
}

  processOpenALPR(base64: string) {
    this.openAlpr.scan(base64, {
      country: this.openAlpr.Country.EU,
      amount: 3
    }).then((res: OpenALPRResult[]) => {
      console.log(res);
    }).catch(error => {
      alert('Error using OpenALPR. See log.');
      console.error(error);
    });
  }

This is my environment:

Ionic:

   Ionic CLI                     : 5.2.6 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.8.0
   @angular-devkit/build-angular : 0.801.3
   @angular-devkit/schematics    : 8.1.3
   @angular/cli                  : 8.1.3
   @ionic/angular-toolkit        : 2.0.0

Cordova:

   Cordova CLI       : 9.0.0 ([email protected])
   Cordova Platforms : android 8.0.0
   Cordova Plugins   : cordova-plugin-ionic 5.4.4, cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 14 other plugins)

Utility:

   cordova-res : 0.6.0
   native-run  : 0.2.8

System:

   NodeJS : v10.16.0 (/usr/local/bin/node)
   npm    : 6.9.0
   OS     : macOS Mojave
   Xcode  : Xcode 10.3 Build version 10G8

I'm using the 2.1.0 version of the pugin.

Not working no response no error

Ionic:

ionic (Ionic CLI) : 4.12.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.11.8
@angular-devkit/build-angular : 0.13.9
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.3.9
@ionic/angular-toolkit : 1.5.1

Cordova:

cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 7.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 3.0.0, (and 16 other plugins)

System:

ios-deploy : 1.9.4
ios-sim : 8.0.1
NodeJS : v10.15.1 (/usr/local/bin/node)
npm : 6.7.0
OS : macOS High Sierra
Xcode : Xcode 10.1 Build version 10B61

Example/Usage With Cordova-Plugin-Camera

I'm trying to get the OpenALPR.scan function to take the output of cordova-plugin-camera, but can't seem to get it working correctly. In the below code, this.testInfo = "Three"; is never hit, but it is also not being set to any error message. Do I need to transform the data from this.camera.getPicture somehow to pass it into the cordova.plugins.OpenALPR.scan() function?

CaptureReg(event) {

    //this.regNumber = "test reg";
    this.testInfo = "One";
    this.camera.getPicture(this.options).then((imageData) => {
      this.testInfo = "Two";
      cordova.plugins.OpenALPR.scan(imageData, function (data) {

          //Results      
          //this.testInfo = data;
          this.testInfo = "Three";
          console.log(data);

      }, function (error) {

        this.testInfo = error.code + ': ' + error.message;
        console.log(error.code + ': ' + error.message)
      });

      // imageData is either a base64 encoded string or a file URI
      // If it's base64:
      this.base64Image = 'data:image/jpeg;base64,' + imageData;
      
      console.log(this.base64Image);
     }, (err) => {
      // Handle error
      this.testInfo = err;
      console.log(err)
     });
    }

Ionic 4 support?

Anyone got this working on Ionic 4?

I'm taking the photo but the result of the scan is not returned.

Issue with Cordova Platforms : android 7.0.0

I'm trying to integrate the cordova-plugin-openalpr with an ionic project. I have installed ionic and cordova from the installation instructions. I started a new project with ionic start MyIonicProject tutorial and then built the project using ionic cordova build android.

I added your plugin using cordova plugin add cordova-plugin-openalpr and when I try to build again it throws the below error. I also tried adding the plugin with ionic cordova plugin add cordova-plugin-openalpr and got the same result.

This error seems to be an incompatibility with cordova-android 7.0.0, as a google of the error indicated that other people had this issue for different plugins because it was incompatible with cordova android 7.0.0.

`

cordova build android
cp: copyFileSync: could not write to dest file (code=ENOENT):C:\Users\Sonny\Documents\Code\ionic\TestALPR\platforms\android\res\xml\config.xml
Parsing C:\Users\Sonny\Documents\Code\ionic\TestALPR\platforms\android\res\xml\config.xml failed
(node:760) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'C:\Users\Sonny\Documents\Code\ionic\TestALPR\platforms\android\res\xml\config.xml'
at Object.fs.openSync (fs.js:663:18)
at Object.fs.readFileSync (fs.js:568:33)
at Object.parseElementtreeSync (C:\Users\Sonny\Documents\Code\ionic\TestALPR\platforms\android\cordova\node_modules\cordova-common\src\util\xml-helpers.js:180:27)
at new ConfigParser (C:\Users\Sonny\Documents\Code\ionic\TestALPR\platforms\android\cordova\node_modules\cordova-common\src\ConfigParser\ConfigParser.js:30:24)
at updateConfigFilesFrom (C:\Users\Sonny\Documents\Code\ionic\TestALPR\platforms\android\cordova\lib\prepare.js:106:18)
at Api.module.exports.prepare (C:\Users\Sonny\Documents\Code\ionic\TestALPR\platforms\android\cordova\lib\prepare.js:42:20)
at Api.prepare (C:\Users\Sonny\Documents\Code\ionic\TestALPR\platforms\android\cordova\Api.js:192:45)
at C:\Users\Sonny\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\prepare.js:106:36
at _fulfilled (C:\Users\Sonny\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:787:54)
at self.promiseDispatch.done (C:\Users\Sonny\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:816:30)
(node:760) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or
by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:760) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
`

Running ionic info gives:

cli packages: (C:\Users\Sonny\AppData\Roaming\npm\node_modules)
ionic/cli-utils : 1.19.1
ionic (Ionic CLI) : 3.19.1
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
ionic/app-scripts : 3.1.8
Cordova Platforms : android 7.0.0
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
Node : v9.5.0
npm : 5.6.0
OS : Windows 7
Environment Variables:
ANDROID_HOME : C:\Users\Sonny\AppData\Local\Android\sdk
Misc:
backend : pro

No rego recognized or error message - 0: No image found for given file path.

Hi there,

I am trying to wring a test app to use this plugin it it seems it does not work on Android device (did not have a chance to check on iOS yet). Here is more details about my environment and code:
Test device: Samsung Galaxy S8+ with Android 8.1
Android platform was added as

cordova platform add [email protected] (tried with 6.4.0, but result the same)

config.xml:

<?xml version='1.0' encoding='utf-8'?>
<widget id="au.com.test.test1234" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>Test app 1</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="[email protected]" href="http://somewebsite.com">
    </author>
    <content src="index.html" />
    <plugin name="cordova-plugin-whitelist" spec="1" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <allow-navigation href="*" />
    <platform name="android">
        <allow-intent href="market:*" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <preference name="Orientation" value="all" />
        <config-file parent="UIStatusBarHidden" platform="ios" target="*-Info.plist">
            <true />
        </config-file>
        <config-file parent="UIViewControllerBasedStatusBarAppearance" platform="ios" target="*-Info.plist">
            <false />
        </config-file>
    </platform>
    <plugin name="cordova-plugin-camera" spec="^4.0.2" />
    <plugin name="cordova-plugin-openalpr" spec="^2.0.0" />
    <plugin name="phonegap-plugin-barcodescanner" spec="^7.1.0">
        <variable name="ANDROID_SUPPORT_V4_VERSION" value="27.+" />
    </plugin>
    <engine name="ios" spec="^4.5.4" />
    <engine name="android" spec="^6.3.0" />
</widget>

I added the following code to reeivedEvent method in index.js:

try{
  navigator.camera.getPicture(function(filepath) {
    alert("filepath=" + filepath)
    try{
      cordova.plugins.OpenALPR.scan(filepath, { country: 'au', amount: 3 },
      function (results) {
           alert(results);
           alert(results.length);
       }, function (error) {
           alert(error.code + ': ' + error.message);
       });
    } catch (msg) {
      alert(msg);
    }
  }, function() {

  }, {
    quality: 60,
    destinationType: navigator.camera.DestinationType.FILE_URI, //DATA_URL
    encodingType: navigator.camera.EncodingType.JPEG,
    mediaType: navigator.camera.MediaType.PICTURE,
    sourceType: navigator.camera.PictureSourceType.CAMERA

  });

}catch(msg) {
  alert(msg);
}

When the code is executed I receive a error message like "0: No image found for given file path". I found the following in OpenALPR.java:

if (imagePath == null || imagePath.length() > 0 || new File(imagePath).isFile()) {
  //Otherwise return an error.
 returnError("No image found for given file path", callbackContext);
}

It seems if statement has an issue. you must check imagePath.length() == 0 instead of > 0. Is ti correct? If so, can you please upload the fix?

I've applied a fix and if statement works correctly now, success call back is called with empty array (if you look at my code the second alert() displays 0).

Can you please help me what is wrong with it? Why rego cannot be recognised? Does you plugin send any request to external servers (for example, using Cloud API) to recognise rego or everything is recognised inside plugin? I tried online demo on openalpr.com web side and it recognises my rego correctly.

Thanks in advance for any help.

Support for additional characters

Hi there,

thanks for your implementation of OpenALPR for Cordova. I am just getting into this stuff and recognized that some plates may not me correctly recognized as they are using special characters (e.g. German Umlaute Ä/Ö/Ü)

I saw that there is a line in the runtime_data/config/eu.conf where you can add 'postprocess_regex_letters'. I tried to edit this and rm/add the platform after that but it did not have any effect on the recognition. Are these config files precompiled into the traineddata? Can you point me to an idea how to add characters to the recognition?

Cheers
czery

TypeError cannot read property 'scan' of undefined

I get the error 'TypeError cannot read property 'scan' of undefined' when calling the openalpr plugin as follows

cordova.plugins.OpenALPR.scan(filepath, { country: 'eu', amount: 3 }, function (results) {
     console.log(results);
 }, function (error) {
     console.log(error.code + ': ' + error.message)
 });

installed using cordova plugin add cordova-plugin-openalpr
Android@~6.3.0

ionic3 usage example?

Hi, thanks for the effort you put to bring OpenALPR as Cordova plugin.

I'm having a problem using it with an Ionic 3 application. The given example is for Ionic 1, but now we are expect to import classes from packages, and I have no idea how to do it with OpenALPR. A short example or at least some directions, will be highly appreciated.

Improve Android support

  • Run APLR on background thread
  • Don't hardcode country type (EU), but pass it through JS
  • Check for memory leaks
  • Add (unit) tests
  • Check if OpenALPR libraries can be build on compile time
  • Add Cordova Plugin Camera's photolibrary support (Only Camera works as of now)

this.openalpr.scan is not a function / undefined

I am using Ionic 6 and when I run the scan function, I get the following error:

"TypeError: this.openalpr.scan is not a function. (In 'this.openalpr.scan(ce,this.openAlprOptions)', 'this.openalpr.scan' is undefined)"
Is this problem coming up because openalpr doesn't support Ionic versions above 4? Or is there something else causing the issue?

Thanks for the help in advance!

Library not supported

Hai there, this library not support for car plate from my country malaysia. Is there way to get myt.xml for my country?

Enable Bitcode for ios

I am using this plugin in ionic5 capacitor, but while building the project I am getting this error

capacitor-cordova-ios-plugins/sources/CordovaPluginOpenalpr/src/ios/lib/opencv2.framework/opencv2(matrix-86DBD15CF0D8AAA8.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64

openalpr.conf changes not being picked up when app built

Tweaking settings in

/plugins/cordova-plugin-openalpr/src/openalpr.conf

are not being picked up when cordova build ios is ran.

I'm getting 'runtime_dir is not defined' which initially encouraged me to add

runtime_dir = ${CMAKE_INSTALL_PREFIX}/share/openalpr/runtime_data

to the file based on another issue raised here, however that, and other tweaks I'm making in an effort to try and make the readings more accurate are having no effect on the plugin. I want to enable pattern matching to negate 1's being picked up as I's and having dug through the code I know what I need to know but it doesnt appear to taking the config info.

Scanning retunrs nothing

I pass image from the camera to scanning function form plugin and the function isn't returning nothing and there is no error.

I'm not able to use this plugin in ionic v4.

I got this error after installed the plugin and trying to make the build. Please suggest me some sulution.

Click to see full exception BUILD FAILED in 2s 27 actionable tasks: 5 executed, 22 up-to-date /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/gradlew: Command failed with exit code 1 Error output: /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:10: error: package com.openalpr.jni does not exist import com.openalpr.jni.Alpr; BUILD FAILED in 2s 27 actionable tasks: 5 executed, 22 up-to-date /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/gradlew: Command failed with exit code 1 Error output: /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:10: error: package com.openalpr.jni does not exist import com.openalpr.jni.Alpr; ^ /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:11: error: package com.openalpr.jni does not exist import com.openalpr.jni.AlprException; ^ /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:12: error: package com.openalpr.jni does not exist import com.openalpr.jni.AlprPlate; ^ /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:13: error: package com.openalpr.jni does not exist import com.openalpr.jni.AlprPlateResult; ^ /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:14: error: package com.openalpr.jni does not exist import com.openalpr.jni.AlprResults; ^ /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:15: error: package com.openalpr.util does not exist import com.openalpr.util.Utils; ^ /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:149: error: cannot find symbol private Alpr initAlpr(JSONObject options, CallbackContext callbackContext) { ^ symbol: class Alpr location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:184: error: cannot find symbol private JSONArray buildResponse(AlprResults results, JSONArray array) throws JSONException { ^ symbol: class AlprResults location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:79: error: cannot find symbol Alpr alpr = initAlpr(options, callbackContext); ^ symbol: class Alpr location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:80: error: cannot find symbol AlprResults results = null; ^ symbol: class AlprResults location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:85: error: cannot find symbol } catch (AlprException e) { ^ symbol: class AlprException location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:114: error: cannot find symbol Alpr alpr = initAlpr(options, callbackContext); ^ symbol: class Alpr location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:115: error: cannot find symbol AlprResults results = null; ^ symbol: class AlprResults location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:120: error: cannot find symbol } catch (AlprException e) { ^ symbol: class AlprException location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:164: error: cannot find symbol Utils.copyAssetFolder(context.getAssets(), "runtime_data", ^ symbol: variable Utils location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:170: error: cannot find symbol Alpr alpr = new Alpr(country, conf_file, runtime_dir); //Make new ALPR object with country EU and the config files from assets. ^ symbol: class Alpr location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:170: error: cannot find symbol Alpr alpr = new Alpr(country, conf_file, runtime_dir); //Make new ALPR object with country EU and the config files from assets. ^ symbol: class Alpr location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:185: error: cannot find symbol for (AlprPlateResult result : results.getPlates()) { ^ symbol: class AlprPlateResult location: class OpenALPR /Users/developer/Documents/Rahulmaurya_projects/vipark/vipark/platforms/android/app/src/main/java/org/apache/cordova/openalpr/OpenALPR.java:186: error: cannot find symbol for (AlprPlate plate : result.getTopNPlates()) { ^ symbol: class AlprPlate location: class OpenALPR Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 19 errors

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  • Get more help at https://help.gradle.org

BUILD FAILED in 2s

Please suggest something to solve this issue.

thank you in advance.

No returns on scan

When running a scan I don't get anything returned to me, no success or errors are triggered. If the license plate is not valid should it return anything at all or will that only be triggered if the license plate scanned is a valid one?

Plugin Not Fetching Data From South Africa License Plate

Hello Friend,

I am using this plugin in my one of phonegap project for accessing data from License Plate of South Africa . i am using this code

cordova.plugins.OpenALPR.scan(filepath, { country: 'ZA', amount: 3 }, function (results) {
     console.log(results);
 }, function (error) {
     console.log(error.code + ': ' + error.message)
 });

where ZA is two letter country code for South Africa. code has been compiled successfully. But i am not able to get data after scan license plate image. I found there are many conf file present under runtime_data/config folder for other country like eu,us,fr,gb etc.
Please help me and let me know how can i use this . how can we manage conf file for South Africa.

Thanks in Advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.