Skip to content

Latest commit

 

History

History
113 lines (89 loc) · 7.24 KB

File metadata and controls

113 lines (89 loc) · 7.24 KB

This application is a reference implementation for developers to show how to use the Java API and could be used to easily check the accuracy. The Java API is a wrapper around the C++ API defined at https://www.doubango.org/SDKs/anpr/docs/cpp-api.html.

The application accepts path to a JPEG/PNG/BMP file as input. This is not the recommended way to use the API. We recommend reading the data directly from the camera and feeding the SDK with the uncompressed YUV data without saving it to a file or converting it to RGB.

If you don't want to build this sample and is looking for a quick way to check the accuracy then, try our cloud-based solution at https://www.doubango.org/webapps/alpr/.

This sample is open source and doesn't require registration or license key.

Dependencies

The SDK is developed in C++11 and you'll need glibc 2.27+ on Linux and Visual C++ Redistributable for Visual Studio 2015 (any later version is ok) on Windows. You most likely already have these dependencies on you machine as almost every program require it.

If you're planning to use OpenVINO, then you'll need Intel C++ Compiler Redistributable (choose newest). Please note that OpenVINO is packaged in the SDK as plugin and loaded (dlopen) at runtime. The engine will fail to load the plugin if Intel C++ Compiler Redistributable is missing on your machine but the program will work as expected with Tensorflow as fallback. We highly recommend using OpenVINO to speedup the inference time. See benchmark numbers with/without OpenVINO at https://www.doubango.org/SDKs/anpr/docs/Benchmark.html#core-i7-windows.

Debugging missing dependencies

To check if all dependencies are present:

GPGPU acceleration

By default GPGPU acceleration is disabled. Check here for more information on how to enable it.

Pre-built binaries

If you don't want to build this sample by yourself then, use the pre-built C++ versions:

On Windows, the easiest way to try this sample is to navigate to binaries/windows/x86_64 and run binaries/windows/x86_64/recognizer.bat. You can edit these files to use your own images and configuration options.

Building

This sample contains a single Java source file.

You have to navigate to the current folder (ultimateALPR-SDK/samples/java/recognizer ) before trying the next commands:

cd ultimateALPR-SDK/samples/java/recognizer

Here is how to build the file using javac:

javac @sources.txt -d .

Usage

Recognizer is a command line application with the following usage:

Recognizer \
      --image <path-to-image-with-plate-to-process> \
      [--assets <path-to-assets-folder>] \
      [--tokenfile <path-to-license-token-file>] \
      [--tokendata <base64-license-token-data>]

Options surrounded with [] are optional.

  • --image Path to the image(JPEG/PNG/BMP) to process. You can use default image at ../../../assets/images/lic_us_1280x720.jpg.
  • --assets Path to the assets folder containing the configuration files and models. Default value is the current folder.
  • --tokenfile Path to the file containing the base64 license token if you have one. If not provided then, the application will act like a trial version. Default: null.
  • --tokendata Base64 license token if you have one. If not provided then, the application will act like a trial version. Default: null.

Examples

You'll need to build the sample as explained above.

You have to navigate to the current folder (ultimateALPR-SDK/samples/java/recognizer ) before trying the next commands:

cd ultimateALPR-SDK/samples/java/recognizer
  • For example, on Raspberry Pi you may call the recognizer application using the following command:
LD_LIBRARY_PATH=../../../binaries/raspbian/armv7l:$LD_LIBRARY_PATH \
java Recognizer --image ../../../assets/images/lic_us_1280x720.jpg --assets ../../../assets
  • On Linux x86_64, you may use the next command:
LD_LIBRARY_PATH=../../../binaries/linux/x86_64:$LD_LIBRARY_PATH \
java Recognizer --image ../../../assets/images/lic_us_1280x720.jpg --assets ../../../assets

Before trying to run the program you'll need to download libtensorflow.so as explained here

  • On Windows x86_64, you may use the next command:
setlocal
set PATH=%PATH%;../../../binaries/windows/x86_64
java Recognizer --image ../../../assets/images/lic_us_1280x720.jpg --assets ../../../assets
endlocal

To make your life easier, run Recognizer.bat to test on Windows. You can edit the file using Notepad to change the parameters.

Please note that if you're cross compiling the application then you've to make sure to copy the application and both the assets and binaries folders to the target device.