### Build Python Extension Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/python/README.md Execute the setup script to compile and install the extension in the current directory. ```bash python ../../../python/setup.py build_ext --inplace -v ``` -------------------------------- ### Install Raspberry Pi Toolchain on Ubuntu Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/README.md Installs the necessary cross-compilation build essentials via apt. ```bash sudo apt-get update sudo apt-get install crossbuild-essential-armhf ``` -------------------------------- ### Example Recognizer Command Line Arguments Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/csharp/recognizer/README.md Example of how to run the recognizer application with specific image, assets, and charset arguments. Ensure Visual Studio properties are set accordingly. ```bash recognizer.exe \ --image "$(ProjectDir)..\..\..\assets\images\lic_us_1280x720.jpg" \ --assets "$(ProjectDir)..\..\..\assets" \ --charset "latin" ``` -------------------------------- ### Install Dependencies Inside Container Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/CONTAINER.md Update package lists and install the udev tool required for hardware identification. ```bash apt update ``` ```bash apt install udev ``` -------------------------------- ### Process BGR24 Images with C# SDK Source: https://context7.com/doubangotelecom/ultimatealpr-sdk/llms.txt This C# example demonstrates how to initialize the SDK, load a Bitmap image, determine its pixel format, and process it using the SDK's native functions. It includes error handling and SDK deinitialization. ```csharp using System; using System.Drawing; using System.Drawing.Imaging; using org.doubango.ultimateAlpr.Sdk; class ALPRProcessor { public static void ProcessImage(string imagePath) { // Build configuration JSON string config = BuildConfig(); // Initialize engine UltAlprSdkResult result = UltAlprSdkEngine.init(config); if (!result.isOK()) throw new Exception($"Init failed: {result.phrase()}"); // Load image Bitmap image = new Bitmap(imagePath); int bytesPerPixel = Image.GetPixelFormatSize(image.PixelFormat) >> 3; // Determine SDK image type based on pixel format ULTALPR_SDK_IMAGE_TYPE imageType = bytesPerPixel switch { 1 => ULTALPR_SDK_IMAGE_TYPE.ULTALPR_SDK_IMAGE_TYPE_Y, 3 => ULTALPR_SDK_IMAGE_TYPE.ULTALPR_SDK_IMAGE_TYPE_BGR24, 4 => ULTALPR_SDK_IMAGE_TYPE.ULTALPR_SDK_IMAGE_TYPE_BGRA32, _ => throw new Exception($"Unsupported BPP: {bytesPerPixel}") }; // Lock bitmap data for processing BitmapData bmpData = image.LockBits( new Rectangle(0, 0, image.Width, image.Height), ImageLockMode.ReadOnly, image.PixelFormat ); try { result = UltAlprSdkEngine.process( imageType, bmpData.Scan0, (uint)bmpData.Width, (uint)bmpData.Height, (uint)(bmpData.Stride / bytesPerPixel), 1 // EXIF orientation ); Console.WriteLine($"Result: {result.json()}"); } finally { image.UnlockBits(bmpData); } // Cleanup UltAlprSdkEngine.deInit(); } private static string BuildConfig() { return @"{ \"debug_level\": \"info\", \"gpgpu_enabled\": true, \"openvino_enabled\": true, \"openvino_device\": \"CPU\", \"assets_folder\": \"C:/ultimateALPR-SDK/assets\", \"charset\": \"latin\", \"detect_minscore\": 0.3, \"pyramidal_search_enabled\": true, \"pyramidal_search_sensitivity\": 0.33, \"pyramidal_search_minscore\": 0.3, \"klass_lpci_enabled\": true, \"klass_vcr_enabled\": true, \"klass_vmmr_enabled\": true, \"recogn_minscore\": 0.2, \"recogn_score_type\": \"min\", \"recogn_rectify_enabled\": true }"; } } ``` -------------------------------- ### CMake configuration for runtimeKey Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/runtimeKey/CMakeLists.txt Defines the project, links the UltimateALPR SDK, and sets up the build and installation targets. ```cmake cmake_minimum_required(VERSION 3.0) project(runtimeKey VERSION 1.0.0 LANGUAGES CXX C) #### ultimate Libraries #### add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../../SDK_dev/lib build/ultimateALPR/SDK_dev) include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../../../../SDK_dev/lib/include ) set(runtimeKey_SOURCES runtimeKey.cxx ) ###### The executable ###### add_executable(runtimeKey ${runtimeKey_SOURCES}) ###### 3rd parties libs ###### target_link_libraries(runtimeKey ${LIB_LINK_SCOPE} ultimate_alpr-sdk) add_dependencies(runtimeKey ultimate_alpr-sdk) ###### Install Libs ###### install(TARGETS runtimeKey DESTINATION bin) ``` -------------------------------- ### Run Docker Container with Hardware Access Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/CONTAINER.md Start a container with read-only access to host udev and device information. ```bash docker run -v /run/udev:/run/udev:ro -v /dev:/dev:ro -it ubuntu ``` -------------------------------- ### Install ARM32 Cross-Compiler Toolchain Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/binaries/linux/armv7l/README.md Commands to install the necessary GCC and G++ cross-compilation packages for ARM32 targets on an Ubuntu host. ```bash sudo apt-get update sudo apt-get install gcc-arm-linux-gnueabihf sudo apt-get install g++-arm-linux-gnueabihf ``` -------------------------------- ### Generate Azure Instance Runtime Key Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/AWS.md Use this command to generate a runtime key attached to the Azure VM instance. Ensure libcurl is installed. ```bash ./runtimeKey --type azure-instance --assets ../../../assets ``` -------------------------------- ### Check Python Version Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/python/recognizer/README.md Command to verify the installed Python version to ensure compatibility with the SDK extension. ```bash python --version ``` -------------------------------- ### Verify GCC Toolchain Installation Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/binaries/linux/aarch64/README.md Checks the installed version and configuration of the aarch64-linux-gnu-g++ compiler. This command displays detailed information about the compiler's build and target. ```bash aarch64-linux-gnu-g++ -v ``` -------------------------------- ### Benchmark Tool Expected Output Source: https://context7.com/doubangotelecom/ultimatealpr-sdk/llms.txt Example of the expected output format from the benchmark tool, showing elapsed time and estimated frames per second. ```text Elapsed time (ALPR) = [[[ 421.5 millis ]]] *** elapsedTimeInMillis: 421.5, estimatedFps: 237.2 *** ``` -------------------------------- ### Configure CMake for UltimateALPR SDK Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/recognizer/CMakeLists.txt Defines the project requirements, includes the SDK library directory, and sets up the executable build and installation targets. ```cmake cmake_minimum_required(VERSION 3.0) project(recognizer VERSION 1.0.0 LANGUAGES CXX C) #### ultimate Libraries #### add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../../SDK_dev/lib build/ultimateALPR/SDK_dev) include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../../../../SDK_dev/lib/include ) set(recognizer_SOURCES recognizer.cxx ) ###### The executable ###### add_executable(recognizer ${recognizer_SOURCES}) ###### 3rd parties libs ###### target_link_libraries(recognizer ${LIB_LINK_SCOPE} ultimate_alpr-sdk) add_dependencies(recognizer ultimate_alpr-sdk) ###### Install Libs ###### install(TARGETS recognizer DESTINATION bin) ``` -------------------------------- ### Verify ARM32 Toolchain Version Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/binaries/linux/armv7l/README.md Output generated by checking the version of the installed ARM32 cross-compiler. ```text Using built-in specs. COLLECT_GCC=arm-linux-gnueabihf-g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/arm-linux-gnueabihf/7/lto-wrapper Target: arm-linux-gnueabihf Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 7.5.0-3ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-multiarch --enable-multilib --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-werror --enable-multilib --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=arm-linux-gnueabihf --program-prefix=arm-linux-gnueabihf- --includedir=/usr/arm-linux-gnueabihf/include Thread model: posix gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) ``` -------------------------------- ### Generate Azure BYOL Runtime Key Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/AWS.md Use this command to generate a runtime key attached to the hardware for Azure BYOL (Bring Your Own License). Ensure libcurl is installed. ```bash ./runtimeKey --type azure-byol --assets ../../../assets ``` -------------------------------- ### Run UltimateALPR on Myriad VPU Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/README.md To run UltimateALPR on a Myriad VPU, use version v3.3.5 or later and Windows 10+. Ensure the Myriad driver is correctly installed. The device name is case-sensitive. ```bash --openvino_enabled true --openvino_device MYRIAD ``` -------------------------------- ### Install ARM64 Cross-Compilation Toolchain on Ubuntu 18 Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/binaries/linux/aarch64/README.md Installs the GCC and G++ cross-compilers for the aarch64-linux-gnu target. Ensure your package list is up-to-date before installation. ```bash sudo apt-get update sudo apt-get install gcc-aarch64-linux-gnu sudo apt install g++-aarch64-linux-gnu ``` -------------------------------- ### Build the benchmark sample with GCC Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/benchmark/README.md Use this command to compile the benchmark application on Linux-based systems. Ensure the library paths and architecture identifiers are updated for your specific environment. ```bash cd ultimateALPR-SDK/samples/c++/benchmark g++ benchmark.cxx -O3 -I../../../c++ -L../../../binaries// -lultimate_alpr-sdk -o benchmark ``` -------------------------------- ### Run Benchmark Tool with Custom Settings Source: https://context7.com/doubangotelecom/ultimatealpr-sdk/llms.txt Execute the benchmark tool with specified image paths, asset directory, loop count, rate, and parallel processing enabled. Adjust parameters for your hardware. ```bash ./benchmark \ --positive /path/to/image_with_plate.jpg \ --negative /path/to/image_without_plate.jpg \ --assets /path/to/ultimateALPR-SDK/assets \ --loops 100 \ --rate 0.2 \ --parallel true ``` -------------------------------- ### Initialize and process images with the C++ API Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/README.md Demonstrates the lifecycle of the engine including initialization with a JSON configuration, processing image frames, and deinitialization to free resources. ```cpp #include // Include the API header file // JSON configuration string // More info at https://www.doubango.org/SDKs/anpr/docs/Configuration_options.html static const char* __jsonConfig = "{" "\"debug_level\": \"info\"," "\"debug_write_input_image_enabled\": false," "\"debug_internal_data_path\": \".\"," "" "\"num_threads\": -1," "\"gpgpu_enabled\": true," "\"openvino_enabled\": true," "\"openvino_device\": \"CPU\"," "" "\"detect_roi\": [0, 0, 0, 0]," "\"detect_minscore\": 0.1," "" "\"pyramidal_search_enabled\": true," "\"pyramidal_search_sensitivity\": 0.28," "\"pyramidal_search_minscore\": 0.3," "\"pyramidal_search_min_image_size_inpixels\": 800," "" "\"klass_lpci_enabled\": true," "\"klass_vcr_enabled\": true," "\"klass_vmm_enabled\": true," "" "\"recogn_minscore\": 0.3," "\"recogn_score_type\": \"min\"" "}"; // Local variable UltAlprSdkResult result; // Initialize the engine (should be done once) ULTALPR_SDK_ASSERT((result = UltAlprSdkEngine::init( __jsonConfig )).isOK()); // Processing (detection + recognition) // Call this function for every video frame const void* imageData = nullptr; ULTALPR_SDK_ASSERT((result = UltAlprSdkEngine::process( ULTMICR_SDK_IMAGE_TYPE_RGB24, imageData, imageWidth, imageHeight )).isOK()); // DeInit // Call this function before exiting the app to free the allocate resources // You must not call process() after calling this function ULTALPR_SDK_ASSERT((result = UltAlprSdkEngine::deInit()).isOK()); ``` -------------------------------- ### Build Ultimate ALPR SDK for Raspberry Pi Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/runtimeKey/README.md Compile the runtimeKey sample on Raspberry Pi or cross-compile on other systems. Ensure the correct toolchain and paths are used. ```bash cd ultimateALPR-SDK/samples/c++/runtimeKey arm-linux-gnueabihf-g++ runtimeKey.cxx -O3 -I../../../c++ -L../../../binaries/raspbian/armv7l -lultimate_alpr-sdk -o runtimeKey ``` -------------------------------- ### Build C++ sample with GCC Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/recognizer/README.md Generic command for compiling the C++ recognizer sample using GCC. Replace placeholders with the appropriate OS and architecture paths. ```bash cd ultimateALPR-SDK/samples/c++/recognizer g++ recognizer.cxx -O3 -I../../../c++ -L../../../binaries// -lultimate_alpr-sdk -o recognizer ``` -------------------------------- ### Build with Generic GCC Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/runtimeKey/README.md Compile the SDK using GCC. Ensure you replace \`` and \`` with the correct values for your target system. For cross-compiling, adjust the compiler command accordingly. ```bash cd ultimateALPR-SDK/samples/c++/runtimeKey g++ runtimeKey.cxx -O3 -I../../../c++ -L../../../binaries// -lultimate_alpr-sdk -o runtimeKey ``` -------------------------------- ### Build the benchmark sample for Raspberry Pi Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/benchmark/README.md Compile the benchmark specifically for Raspberry Pi using the arm-linux-gnueabihf toolchain. Adjust the compiler command if building natively on the device. ```bash cd ultimateALPR-SDK/samples/c++/benchmark arm-linux-gnueabihf-g++ benchmark.cxx -O3 -I../../../binaries/raspbian/armv7l -lultimate_alpr-sdk -o benchmark ``` -------------------------------- ### Navigate to Binaries Directory Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/python/README.md Change the current working directory to the location of the SDK binaries for the target OS and architecture. ```bash cd ultimateALPR-SDK/binaries/<>/<> ``` -------------------------------- ### CMake Build Configuration for trt_optimizer Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/trt_optimizer/CMakeLists.txt Configures the project, links the ultimate_alpr-sdk library, and defines the installation target for the trt_optimizer executable. ```cmake cmake_minimum_required(VERSION 3.0) project(trt_optimizer VERSION 1.0.0 LANGUAGES CXX C) #### ultimate Libraries #### add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../../../SDK_dev/lib build/ultimateALPR/SDK_dev) include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/../../../../SDK_dev/lib/include ) set(trt_optimizer_SOURCES trt_optimizer.cxx ) ###### The executable ###### add_executable(trt_optimizer ${trt_optimizer_SOURCES}) ###### 3rd parties libs ###### target_link_libraries(trt_optimizer ${LIB_LINK_SCOPE} ultimate_alpr-sdk) add_dependencies(trt_optimizer ultimate_alpr-sdk) ###### Install Libs ###### install(TARGETS trt_optimizer DESTINATION bin) ``` -------------------------------- ### Navigate to Java Recognizer Directory Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/java/recognizer/README.md Change the current directory to the Java recognizer sample folder before executing build commands. ```bash cd ultimateALPR-SDK/samples/java/recognizer ``` -------------------------------- ### Enable NVIDIA TensorRT Acceleration Source: https://context7.com/doubangotelecom/ultimatealpr-sdk/llms.txt Use this command to enable TensorRT acceleration for the recognizer. Ensure TensorRT is properly installed and configured. ```bash ./recognizer \ --image /path/to/car_image.jpg \ --assets /path/to/ultimateALPR-SDK/assets \ --trt_enabled true \ --openvino_enabled false ``` -------------------------------- ### Pre-load Models with UltAlprSdkEngine.warmUp() Source: https://context7.com/doubangotelecom/ultimatealpr-sdk/llms.txt Use warmUp() after init() to load deep learning models into memory before actual processing. This ensures consistent frame timing by avoiding initial model loading latency. ```cpp #include using namespace ultimateAlprSdk; // After init(), warm up the engine UltAlprSdkResult result = UltAlprSdkEngine::warmUp(ULTALPR_SDK_IMAGE_TYPE_RGB24); if (result.isOK()) { printf("Engine warmed up, models loaded into memory\n"); } // Now process frames with consistent timing auto start = std::chrono::high_resolution_clock::now(); UltAlprSdkEngine::process(ULTALPR_SDK_IMAGE_TYPE_RGB24, imageData, width, height); auto elapsed = std::chrono::high_resolution_clock::now() - start; // First frame timing will be consistent with subsequent frames ``` -------------------------------- ### Install TensorRT on Linux Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/README.md Use LD_LIBRARY_PATH to specify the location of TensorRT libraries or copy them to binaries/linux/x86_64. Requires TensorRT 8.x and CUDA 11 or later. ```bash cp /home/TensorRT-8.6.1.6/lib/* binaries/linux/x86_64 ``` -------------------------------- ### UltAlprSdkEngine.init() - Initialize the Recognition Engine Source: https://context7.com/doubangotelecom/ultimatealpr-sdk/llms.txt Initializes the ALPR engine by loading models and preparing resources. This function must be called once before any processing. ```APIDOC ## UltAlprSdkEngine.init() ### Description Initializes the ALPR engine by loading deep learning models and preparing GPU/CPU resources. It accepts a JSON configuration string defining detection parameters, recognition settings, and hardware acceleration options. This function must be called once before any processing and supports an optional callback for parallel/asynchronous result delivery. ### Method static UltAlprSdkResult init(const char* jsonConfig, UltAlprSdkCallback callback) ### Endpoint N/A (This is a static SDK function) ### Parameters #### Request Body - **jsonConfig** (string) - Required - A JSON string defining detection parameters, recognition settings, and hardware acceleration options. - **callback** (UltAlprSdkCallback) - Optional - A callback function for parallel/asynchronous result delivery. ### Request Example ```cpp #include using namespace ultimateAlprSdk; static const char* jsonConfig = "{" "debug_level": "info", "debug_write_input_image_enabled": false, "debug_internal_data_path": ".", "num_threads": -1, "gpgpu_enabled": true, "openvino_enabled": true, "openvino_device": "CPU", "assets_folder": "/path/to/ultimateALPR-SDK/assets", "charset": "latin", "detect_roi": [0, 0, 0, 0], "detect_minscore": 0.1, "pyramidal_search_enabled": true, "pyramidal_search_sensitivity": 0.28, "pyramidal_search_minscore": 0.3, "pyramidal_search_min_image_size_inpixels": 800, "klass_lpci_enabled": true, "klass_vcr_enabled": true, "klass_vmmr_enabled": true, "klass_vbsr_enabled": false, "recogn_minscore": 0.3, "recogn_score_type": "min", "recogn_rectify_enabled": true "}"; UltAlprSdkResult result = UltAlprSdkEngine::init(jsonConfig, nullptr); if (!result.isOK()) { printf("Init failed: %s\n", result.phrase()); return -1; } printf("Engine initialized successfully\n"); ``` ### Response #### Success Response (200) - **isOK** (boolean) - True if initialization was successful. - **phrase** (string) - A message indicating the status of the operation. - **numPlates** (integer) - Number of plates detected (usually 0 on init). - **json** (string) - JSON string with detailed results (usually empty on init). #### Response Example ```json { "isOK": true, "phrase": "Initialization successful", "numPlates": 0, "json": "" } ``` ``` -------------------------------- ### Run Benchmark on Windows x86_64 Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/benchmark/README.md Executes the benchmark application on Windows using the command prompt syntax with caret line continuations. ```batch benchmark.exe ^ --positive ../../../assets/images/lic_us_1280x720.jpg ^ --negative ../../../assets/images/london_traffic.jpg ^ --assets ../../../assets ^ --charset latin ^ --loops 100 ^ --rate 0.2 ^ --parallel true ``` -------------------------------- ### Run UltimateALPR Recognizer Tool - Basic Usage Source: https://context7.com/doubangotelecom/ultimatealpr-sdk/llms.txt Basic command-line usage for the UltimateALPR recognizer tool, specifying the image path, assets folder, and character set. ```bash # Basic usage with Latin charset ./recognizer \ --image /path/to/car_image.jpg \ --assets /path/to/ultimateALPR-SDK/assets \ --charset latin ``` -------------------------------- ### Run UltimateALPR Recognizer Tool - OpenVINO GPU Source: https://context7.com/doubangotelecom/ultimatealpr-sdk/llms.txt Command-line usage for the UltimateALPR recognizer tool, enabling OpenVINO acceleration and specifying the GPU device. ```bash # Using OpenVINO acceleration on Intel GPU ./recognizer \ --image /path/to/car_image.jpg \ --assets /path/to/ultimateALPR-SDK/assets \ --openvino_enabled true \ --openvino_device GPU ``` -------------------------------- ### Process YUV420P Images with UltAlprSdkEngine.process() Source: https://context7.com/doubangotelecom/ultimatealpr-sdk/llms.txt Use this overload for camera streams and video processing, especially with planar YUV formats from sources like FFmpeg. Ensure correct plane pointers, dimensions, and strides are provided. ```cpp #include using namespace ultimateAlprSdk; // Process YUV420P image (planar format from FFmpeg) // frame is an AVFrame from FFmpeg UltAlprSdkResult result = UltAlprSdkEngine::process( ULTALPR_SDK_IMAGE_TYPE_YUV420P, frame->data[0], // Y plane pointer frame->data[1], // U plane pointer frame->data[2], // V plane pointer frame->width, // Width in pixels frame->height, // Height in pixels frame->linesize[0], // Y stride in bytes frame->linesize[1], // U stride in bytes frame->linesize[2], // V stride in bytes 0, // UV pixel stride (0 for auto, 1 for planar, 2 for semi-planar) 1 // EXIF orientation ); if (result.isOK() && result.numPlates() > 0) { printf("Detected %zu plates: %s\n", result.numPlates(), result.json()); } ``` -------------------------------- ### Run runtimeKey on Linux x86_64 Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/runtimeKey/README.md Execute the runtimeKey application on a Linux x86_64 system, configuring the library path and assets. ```bash LD_LIBRARY_PATH=../../../binaries/linux/x86_64:$LD_LIBRARY_PATH ./runtimeKey \ --json true \ --assets ../../../assets ``` -------------------------------- ### Pull Docker Image Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/CONTAINER.md Download the base Ubuntu image from the registry. ```bash docker pull ubuntu ``` -------------------------------- ### Run Recognizer on Linux and Raspberry Pi Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/python/recognizer/README.md Configures environment variables and executes the recognizer script. Requires libtensorflow.so on Linux x86_64 systems. ```bash PYTHONPATH=$PYTHONPATH:.:../../../python \ LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH \ python ../../../samples/python/recognizer/recognizer.py --image ../../../assets/images/lic_us_1280x720.jpg --assets ../../../assets ``` -------------------------------- ### Run runtimeKey on NVIDIA Jetson Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/runtimeKey/README.md Execute the runtimeKey application on an NVIDIA Jetson device, setting the library path and assets folder. ```bash LD_LIBRARY_PATH=../../../binaries/jetson/aarch64:$LD_LIBRARY_PATH ./runtimeKey \ --json true \ --assets ../../../assets ``` -------------------------------- ### UltAlprSdkEngine::warmUp Source: https://context7.com/doubangotelecom/ultimatealpr-sdk/llms.txt Pre-loads deep learning models into memory to ensure consistent performance for the first frame. ```APIDOC ## UltAlprSdkEngine::warmUp ### Description Performs a fake inference to force model loading into memory, preventing latency on the first real frame. ### Parameters - **imageType** (int) - Required - The image type to simulate for the warm-up process. ### Response - **UltAlprSdkResult** - Returns success or failure status of the warm-up operation. ``` -------------------------------- ### Run Benchmark on NVIDIA Jetson Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/benchmark/README.md Executes the benchmark on aarch64 Jetson devices after ensuring the device is in maximum performance mode. ```bash LD_LIBRARY_PATH=../../../binaries/jetson/aarch64:$LD_LIBRARY_PATH ./benchmark \ --positive ../../../assets/images/lic_us_1280x720.jpg \ --negative ../../../assets/images/london_traffic.jpg \ --assets ../../../assets \ --charset latin \ --loops 100 \ --rate 0.2 \ --parallel true \ --rectify false ``` -------------------------------- ### Generate Runtime Key for AWS BYOL Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/AWS.md Execute this command to generate a runtime key for binding the license to the hardware using AWS's Bring Your Own Licensing (BYOL) offer. This method guarantees hardware information stability but incurs additional subscription costs. ```bash ./runtimeKey --type aws-byol --assets ../../../assets ``` -------------------------------- ### Build C++ sample for Raspberry Pi Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/recognizer/README.md Compilation command for Raspberry Pi using the arm-linux-gnueabihf toolchain. Adjust the compiler command based on whether building on the device or cross-compiling. ```bash cd ultimateALPR-SDK/samples/c++/recognizer arm-linux-gnueabihf-g++ recognizer.cxx -O3 -I../../../c++ -L../../../binaries/raspbian/armv7l -lultimate_alpr-sdk -o recognizer ``` -------------------------------- ### Run Benchmark on Linux x86_64 Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/benchmark/README.md Executes the benchmark application on standard x86_64 Linux systems. ```bash LD_LIBRARY_PATH=../../../binaries/linux/x86_64:$LD_LIBRARY_PATH ./benchmark \ --positive ../../../assets/images/lic_us_1280x720.jpg \ --negative ../../../assets/images/london_traffic.jpg \ --assets ../../../assets \ --charset latin \ --loops 100 \ --rate 0.2 \ --parallel true ``` -------------------------------- ### Run Benchmark on Raspberry Pi Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/benchmark/README.md Executes the benchmark application on ARMv7l architecture by setting the library path and providing asset and processing parameters. ```bash LD_LIBRARY_PATH=../../../binaries/raspbian/armv7l:$LD_LIBRARY_PATH ./benchmark \ --positive ../../../assets/images/lic_us_1280x720.jpg \ --negative ../../../assets/images/london_traffic.jpg \ --assets ../../../assets \ --charset latin \ --loops 100 \ --rate 0.2 \ --parallel true \ --rectify false ``` -------------------------------- ### Initialize the Recognition Engine in C++ Source: https://context7.com/doubangotelecom/ultimatealpr-sdk/llms.txt Initializes the ALPR engine by loading models and hardware acceleration settings. Must be called once before any processing occurs. ```cpp #include using namespace ultimateAlprSdk; // JSON configuration for the ALPR engine static const char* jsonConfig = "{" "\"debug_level\": \"info\"," "\"debug_write_input_image_enabled\": false," "\"debug_internal_data_path\": \".\"," "\"num_threads\": -1," "\"gpgpu_enabled\": true," "\"openvino_enabled\": true," "\"openvino_device\": \"CPU\"," "\"assets_folder\": \"/path/to/ultimateALPR-SDK/assets\"," "\"charset\": \"latin\"," "\"detect_roi\": [0, 0, 0, 0]," "\"detect_minscore\": 0.1," "\"pyramidal_search_enabled\": true," "\"pyramidal_search_sensitivity\": 0.28," "\"pyramidal_search_minscore\": 0.3," "\"pyramidal_search_min_image_size_inpixels\": 800," "\"klass_lpci_enabled\": true," "\"klass_vcr_enabled\": true," "\"klass_vmmr_enabled\": true," "\"klass_vbsr_enabled\": false," "\"recogn_minscore\": 0.3," "\"recogn_score_type\": \"min\"," "\"recogn_rectify_enabled\": true" "}"; // Initialize without parallel callback (sequential mode) UltAlprSdkResult result = UltAlprSdkEngine::init(jsonConfig, nullptr); if (!result.isOK()) { printf("Init failed: %s\n", result.phrase()); return -1; } printf("Engine initialized successfully\n"); ``` -------------------------------- ### Cleanup Resources with UltAlprSdkEngine.deInit() Source: https://context7.com/doubangotelecom/ultimatealpr-sdk/llms.txt Call deInit() to release all SDK resources, including GPU memory and models. Re-initialization with init() is required before further processing. ```cpp #include using namespace ultimateAlprSdk; // Processing complete, cleanup resources UltAlprSdkResult result = UltAlprSdkEngine::deInit(); if (result.isOK()) { printf("Engine deinitialized successfully\n"); } else { printf("DeInit failed: %s\n", result.phrase()); } ``` -------------------------------- ### Run UltimateALPR Recognizer Tool - All Classifiers Source: https://context7.com/doubangotelecom/ultimatealpr-sdk/llms.txt Command-line usage for the UltimateALPR recognizer tool with all classifiers enabled and rectification turned on. ```bash # With all classifiers enabled ./recognizer \ --image /path/to/car_image.jpg \ --assets /path/to/ultimateALPR-SDK/assets \ --charset latin \ --klass_lpci_enabled true \ --klass_vcr_enabled true \ --klass_vmmr_enabled true \ --klass_vbsr_enabled true \ --rectify true ``` -------------------------------- ### Generate Runtime Key for AWS Instance Binding Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/AWS.md Use this command to generate a runtime key for binding the license to the AWS instance. This ensures the license remains valid even if the underlying hardware changes, but will be lost if the instance is terminated. ```bash ./runtimeKey --type aws-instance --assets ../../../assets ``` -------------------------------- ### RuntimeKey Command Line Usage Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/runtimeKey/README.md The runtimeKey application accepts optional arguments for JSON output and the path to assets. ```bash runtimeKey \ [--json ] \ [--assets ] ``` -------------------------------- ### Perform Plate Recognition in Python Source: https://context7.com/doubangotelecom/ultimatealpr-sdk/llms.txt Demonstrates the full lifecycle of the Python API, including engine initialization, image loading with PIL, and processing for plate recognition. ```python import ultimateAlprSdk import json from PIL import Image # Configuration dictionary config = { "debug_level": "info", "debug_write_input_image_enabled": False, "debug_internal_data_path": ".", "num_threads": -1, "gpgpu_enabled": True, "max_latency": -1, "assets_folder": "/path/to/ultimateALPR-SDK/assets", "charset": "latin", "detect_roi": [0, 0, 0, 0], "detect_minscore": 0.1, "pyramidal_search_enabled": True, "pyramidal_search_sensitivity": 0.28, "pyramidal_search_minscore": 0.3, "pyramidal_search_min_image_size_inpixels": 800, "klass_lpci_enabled": True, "klass_vcr_enabled": True, "klass_vmmr_enabled": True, "recogn_rectify_enabled": True, "recogn_minscore": 0.3, "recogn_score_type": "min" } # Map PIL modes to SDK image types IMAGE_TYPES = { 'RGB': ultimateAlprSdk.ULTALPR_SDK_IMAGE_TYPE_RGB24, 'RGBA': ultimateAlprSdk.ULTALPR_SDK_IMAGE_TYPE_RGBA32, 'L': ultimateAlprSdk.ULTALPR_SDK_IMAGE_TYPE_Y } # Initialize engine result = ultimateAlprSdk.UltAlprSdkEngine_init(json.dumps(config)) if not result.isOK(): raise Exception(f"Init failed: {result.phrase()}") # Load and process image image = Image.open("car_image.jpg") width, height = image.size image_type = IMAGE_TYPES[image.mode] result = ultimateAlprSdk.UltAlprSdkEngine_process( image_type, image.tobytes(), width, height, 0, # stride 1 # exifOrientation ) if result.isOK(): print(f"Found {result.numPlates()} plates") plates = json.loads(result.json()) if result.json() else {} for plate in plates.get("plates", []): print(f"Plate: {plate['text']} (confidence: {plate['confidence']:.2f})") # Cleanup ultimateAlprSdk.UltAlprSdkEngine_deInit() ``` -------------------------------- ### Generate Device License Key in C++ Source: https://context7.com/doubangotelecom/ultimatealpr-sdk/llms.txt Generates a hardware-bound license key for activation without requiring internet. The engine must be initialized prior to calling this function. ```cpp #include using namespace ultimateAlprSdk; // Initialize engine first UltAlprSdkEngine::init(jsonConfig); // Request runtime license key (JSON format) UltAlprSdkResult result = UltAlprSdkEngine::requestRuntimeLicenseKey(false); if (result.isOK()) { printf("Runtime key (JSON): %s\n", result.json()); } // Request raw string format result = UltAlprSdkEngine::requestRuntimeLicenseKey(true); if (result.isOK()) { printf("Runtime key (raw): %s\n", result.json()); } // Use this key with Doubango License Manager for activation ``` -------------------------------- ### Use License Token for Recognition Source: https://context7.com/doubangotelecom/ultimatealpr-sdk/llms.txt Specify a license token file for authentication when running the recognizer. This is required for licensed usage. ```bash ./recognizer \ --image /path/to/car_image.jpg \ --assets /path/to/ultimateALPR-SDK/assets \ --tokenfile /path/to/license.lic ``` -------------------------------- ### Compile Java Source Files Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/java/recognizer/README.md Compile the Java source files using the 'javac' command, specifying the input file list and output directory. This command assumes you are in the 'ultimateALPR-SDK/samples/java/recognizer' directory. ```bash javac @sources.txt -d . ``` -------------------------------- ### Run runtimeKey on Raspberry Pi Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/runtimeKey/README.md Execute the runtimeKey application on a Raspberry Pi, specifying JSON output and the assets folder. ```bash LD_LIBRARY_PATH=../../../binaries/raspbian/armv7l:$LD_LIBRARY_PATH ./runtimeKey \ --json true \ --assets ../../../assets ``` -------------------------------- ### Run runtimeKey on Linux aarch64 Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/runtimeKey/README.md Execute the runtimeKey application on a Linux aarch64 system, specifying the library path and assets directory. ```bash LD_LIBRARY_PATH=../../../binaries/linux/aarch64:$LD_LIBRARY_PATH ./runtimeKey \ --json true \ --assets ../../../assets ``` -------------------------------- ### Run runtimeKey on Windows x86_64 Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/runtimeKey/README.md Execute the runtimeKey application on a Windows x86_64 system, providing the assets path. ```batch runtimeKey.exe ^ --json true ^ --assets ../../../assets ``` -------------------------------- ### Run Benchmark on Linux aarch64 Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/benchmark/README.md Executes the benchmark application on aarch64 Linux systems. ```bash LD_LIBRARY_PATH=../../../binaries/linux/aarch64:$LD_LIBRARY_PATH ./benchmark \ --positive ../../../assets/images/lic_us_1280x720.jpg \ --negative ../../../assets/images/london_traffic.jpg \ --assets ../../../assets \ --charset latin \ --loops 100 \ --rate 0.2 \ --parallel true ``` -------------------------------- ### Run Recognizer on Raspberry Pi Source: https://github.com/doubangotelecom/ultimatealpr-sdk/blob/master/samples/c++/recognizer/README.md Executes the recognizer on ARMv7l architecture by setting the library path. ```bash LD_LIBRARY_PATH=../../../binaries/raspbian/armv7l:$LD_LIBRARY_PATH ./recognizer \ --image ../../../assets/images/lic_us_1280x720.jpg \ --assets ../../../assets \ --charset latin \ --parallel false \ --rectify true ```