GitXplorerGitXplorer
S

openalpr-android

public
771 stars
270 forks
30 issues

Commits

List of commits on branch master.
Unverified
09b76610b502e8957e7823cbd578365eee87dd71

Merge pull request #44 from SandroMachado/bugfix/update-libpng-library

SSandroMachado committed 8 years ago
Unverified
4449c74d2f4ea1429d9087d802ff03ed82728637

Update libpng library

SSandroMachado committed 8 years ago
Unverified
8822ef14575bad4ec2561caaa9c2964675c01a44

Merge pull request #25 from DevFactory/release/method-name-should-comply-with-naming-conventions-fix-1

SSandroMachado committed 9 years ago
Unverified
329ed0ebc587a24405bd5be26671989883daa9e7

Fixing squid:S00100 - Method names should comply with a naming convention.

tthe-best-dev committed 9 years ago
Unverified
7d0cbe71c8455ff75de4a615441ffd7084dcd60e

Merge pull request #26 from DevFactory/release/utility-classes-should-not-have-public-constructors-fix-1

SSandroMachado committed 9 years ago
Unverified
4aeb0dbddddb06bc993e28b95a0845d0a98e9c71

Merge pull request #28 from DevFactory/release/general-code-quality-fix-2

SSandroMachado committed 9 years ago

README

The README file for this repository.

openalpr-android

Release

OpenALPR is an open source Automatic License Plate Recognition library written in C++ with bindings in C#, Java, Node.js, and Python. This project ports this library to Android. You can find the demo application apk at the releases tab.

Screenshot

Gradle Dependency

Repository

First, add the following to your app's build.gradle file:

repositories {
    maven { url "https://jitpack.io" }
}

Them include the openalpr-android dependency:

dependencies {

    // ... other dependencies here.    	
    compile 'com.github.SandroMachado:openalpr-android:1.1.2'
}

Usage

Code

Copy the OpenALPR configuration file to your android project assets directory /main/assets/runtime_data/openalpr.conf, open it and update the runtime_dir to your project directory (for instance, for the sample project the directory is: runtime_dir = /data/data/com.sandro.openalprsample/runtime_data). After that just follow the code example bellow. To see a full example check the sample application.

static final String ANDROID_DATA_DIR = "/data/data/com.sandro.openalprsample";

final String openAlprConfFile = ANDROID_DATA_DIR + File.separatorChar + "runtime_data" + File.separatorChar + "openalpr.conf";

String result = OpenALPR.Factory.create(MainActivity.this, ANDROID_DATA_DIR).recognizeWithCountryRegionNConfig("us", "", image.getAbsolutePath(), openAlprConfFile, 10);

Interface

/*
 Method interface.
*/

/**
 * Recognizes the licence plate.
 *
 * @param country        - Country code to identify (either us for USA or eu for Europe). Default=us.
 * @param region         -  Attempt to match the plate number against a region template (e.g., md for Maryland, ca for California).
 * @param imgFilePath    - Image containing the license plate.
 * @param configFilePath - Config file path (default /etc/openalpr/openalpr.conf)
 * @param topN           - Max number of possible plate numbers to return(default 10)
 *
 * @return - JSON string of results
 */

public String recognizeWithCountryRegionNConfig(String country, String region, String configFilePath, String imgFilePath, int topN);

Sample Application

The repository also includes a sample application that can be tested with Android Studio.

Screencast

Credits

  • OpenALPR Parent Project
  • OpenAlprDroidApp for the compiled sources and sample that helped port the project to an android library