简体   繁体   中英

How use openalpr in java project

I want to use openalpr in my java project. What must I include to use the API? What libs must be imported in project properties in Eclipse or Netbeans?

I found the solution

  1. Download openalpr binaries https://github.com/openalpr/openalpr/releases
  2. Install and configure jdk (java and javac path)
  3. Compile openalpr java source code, start java_test.bat file
  4. Start main.java

    java -classpath java Main "us" "openalpr.conf" "runtime_data" "samples/us-1.jpg"

在此处输入图片说明

  1. Copy the native libs (DLLs for windows) into the exec dir
  2. Copy the java classes into your project (dir: /src/main/java)
  3. Get started with:

`

Alpr alpr = new Alpr("us", "/path/to/openalpr.conf", "/path/to/runtime_data");

// Set top N candidates returned to 20
alpr.setTopN(20);

// Set pattern to Maryland
alpr.setDefaultRegion("md");

AlprResults results = alpr.recognize("/path/to/image.jpg");
System.out.format("  %-15s%-8s\n", "Plate Number", "Confidence");
for (AlprPlateResult result : results.getPlates())
{
    for (AlprPlate plate : result.getTopNPlates()) {
        if (plate.isMatchesTemplate())
            System.out.print("  * ");
        else
            System.out.print("  - ");
        System.out.format("%-15s%-8f\n", plate.getCharacters(), plate.getOverallConfidence());
    }
}

(Source: http://doc.openalpr.com/bindings.html#java )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM