简体   繁体   English

如何在Java项目中使用openalpr

[英]How use openalpr in java project

I want to use openalpr in my java project. 我想在我的Java项目中使用openalpr。 What must I include to use the API? 我必须包括什么才能使用API​​? What libs must be imported in project properties in Eclipse or Netbeans? 必须在Eclipse或Netbeans的项目属性中导入哪些库?

I found the solution 我找到了解决方案

  1. Download openalpr binaries https://github.com/openalpr/openalpr/releases 下载openalpr二进制​​文件https://github.com/openalpr/openalpr/releases
  2. Install and configure jdk (java and javac path) 安装和配置JDK(Java和JavaC路径)
  3. Compile openalpr java source code, start java_test.bat file 编译openalpr java源代码,启动java_test.bat文件
  4. Start main.java 启动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 将本机库(Windows的DLL)复制到exec目录中
  2. Copy the java classes into your project (dir: /src/main/java) 将Java类复制到您的项目中(目录:/ 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 ) (来源: http : //doc.openalpr.com/bindings.html#java

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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