TABLE OF CONTENTS


CURRENT VERSION

2020.12 – released December 2020


SYSTEM REQUIREMENTS AND PRE-REQUISITES

  • Debian 8 and above (x86 and x64) 32bit and 64bit.
  • Ubuntu 16.04 and above (x86, x64, ARM Cortex A53, and ARM Cortex A72) 32bit and 64bit.
  • Raspbian 10 (Buster) and above (ARM Cortex A53, and ARM Cortex A72) 32bit.
  • Windows WSL 1.0 (Ubuntu 16.04 and above) 64bit
  • JRE (Java Runtime Environment) should be installed and configured.


PREPARATION FOR USAGE

  • Include file "Engine.h" into your application.
  • Include the path to file "Engine.h" and add file "StdAfx.cpp" to list of source files.
  • Next three files should be in the same directory: "StdAfx.cpp", "StdAfx.h", " Engine.h".
  • To link application, next keys should be added:
    • lcontainerocr
    • -Lpath/to/folder_of_libcontainerocr.so


USING THE LIBRARY

When it’s done, the function "InitEngine" should be called. After the engine is initialized, a recognition function can be called.

There are three available functions:

  • int Recognition(BYTE* pImage, int nWidth, int nHeight, int nBitCount, InitSet* iniSet, CONTAINERPLATE_DATA* carData);
  • int RecognitionFromFile(char* szFile,int fileNameLen, InitSet* iniSet, CONTAINERPLATE_DATA* carData);
  • char* RecognitionFromFileToJSON(char* szFile,int fileNameLen);


After result is received, function "FreeEngine" should be called.


Example of usage

InitEngine();

char* strJSON = RecognitionFromFileToJSON("path/to/image", "length_path/to/image");

if (strJSON) {
   // the input is fine, parse the json
}

FreeEngine();
// Process results of recognizing

typedef struct tagInitSet

{

   RECT RoiRect;

   int nLetterHeightMin;

   int nLetterHeightMax;

   int skewAng;

    int mode; //0: picture, 1:video

}InitSet;

 

#define MULTIRESULT                             10


typedef struct tagLICENSE

{

   int     nLetNum;

   TCHAR szLicense[20];

   float pfDist;

   int     nTrust;

   int     aveH;

   BOOL bCheckSum;

   BYTE Type;

   BYTE bBkColor;

   RECT rtPlate;                                // Get plate region

   RECT blob[20];

 

   BYTE bCarColor;

   BYTE bCarColDp;

} LICENSE, *LPLICENSE;

 

typedef struct tagCONTAINERPLATE

{

   int     nPlate;

   LICENSE pPlate[MULTIRESULT];                 

   DWORD nProcTime;                              // Get Recognition Speed(ms)

   char licenseMSG[100];

} CONTAINERPLATE_DATA;

License checking errors

  • invalidServerPublicKey: Invalid server public key
  • invalidJSONResponse: Invalid JSON response
  • invalidResponse: Invalid response from server
  • invalidURL: Invalid server URL
  • invalidDevicId: Error while getting device ID
  • timeOut: Request timeout.
  • invalidAPIKey: Invalid API key


RECOGNITION RESULTS

If recognition is successful, it contains JSON response with the objects documented in the article OCR ENGINE OUTPUT.


EXAMPLE PROJECTS (SOURCE CODE)

Download attached file.