0% found this document useful (0 votes)
261 views31 pages

CPD Reference Manual: Page 1/31

Uploaded by

ususari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
261 views31 pages

CPD Reference Manual: Page 1/31

Uploaded by

ususari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

CPD Reference Manual Page 1/31

The CARMEN® Parking Digital (CPD) Module

Reference Manual

v. 1.0.2.5

Document version: 12.06.21

CPD Reference Manual Page 2/31


Table of Contents
1. Introduction.................................................................................................................................................................................................................................................................................................4
1.1 Handling of license.........................................................................................................................................................................................................................................................................4
1.2 Programming interface.................................................................................................................................................................................................................................................................4
2. Detailed Description.................................................................................................................................................................................................................................................................................5
2.1 Starting of the recognition process ..........................................................................................................................................................................................................................................5
2.2 Image transferring to the process .............................................................................................................................................................................................................................................5
2.3 Querying the status of the process...........................................................................................................................................................................................................................................5
2.4 Querying the result ........................................................................................................................................................................................................................................................................6
2.5 Reading out the details of the result from the result structure .......................................................................................................................................................................................6
confidence level............................................................................................................................................................................................................................................................................. 7
3. Querying, setting and saving of module properties......................................................................................................................................................................................................................7
3.1 Engine handling in the CPD module ........................................................................................................................................................................................................................................8
3.2 Properties of the CPD module ....................................................................................................................................................................................................................................................9
trigger/dt1 – Overall time limit in msec................................................................................................................................................................................................................................. 9
trigger/n1 – Recognizing limit during dt1. ...........................................................................................................................................................................................................................9
trigger/dt2 – Recognizing time limit in msec. ...................................................................................................................................................................................................................10
trigger/n2 – Recognizing limit during dt2. .........................................................................................................................................................................................................................10
recognize/window – ROI window on the image. .............................................................................................................................................................................................................10
recognize/maxplates – Anpr result number limit.............................................................................................................................................................................................................10
recognize/name1 – The name of the property group of the main anpr module. .................................................................................................................................................10
recognize/name2 – The name of the property group of the secondary anpr module........................................................................................................................................10
recognize/mode – Number plate reading mode..............................................................................................................................................................................................................10
capture/priority – Priority of the capture thread ..............................................................................................................................................................................................................10
recognize/priority – Priority of the recognize thread......................................................................................................................................................................................................11
3.3 Properties of the engines ...........................................................................................................................................................................................................................................................11
datafile – Name of data file of the engine...........................................................................................................................................................................................................................11
contrast_min – Minimal contrast ...........................................................................................................................................................................................................................................11
gamma – turning on/off gamma correction on incoming images.............................................................................................................................................................................11
size – Average height of the characters ...............................................................................................................................................................................................................................12
size_min – Minimum height of the characters..................................................................................................................................................................................................................12
size_max – Maximum height of characters ........................................................................................................................................................................................................................12
nchar_min - Minimum number of the characters in the plate.....................................................................................................................................................................................12
nchar_max - Maximum number of characters in the plate...........................................................................................................................................................................................12
slope – Average slope of the number plate .......................................................................................................................................................................................................................12
slope_min – Minimum slope of the number plate ..........................................................................................................................................................................................................12
slope_max – Maximum slope of the number plate.........................................................................................................................................................................................................12
slant – Average slant of the number plate..........................................................................................................................................................................................................................13
slant_min – Minimum slant of the number plate.............................................................................................................................................................................................................13
slant_max – Maximum slant of the number plate ...........................................................................................................................................................................................................13
unicode_in_text...........................................................................................................................................................................................................................................................................13
timeout – Time limit ...................................................................................................................................................................................................................................................................14
xtoyres – The ratio of horizontal and vertical resolutions..............................................................................................................................................................................................14
colortype – Background color of the plate .........................................................................................................................................................................................................................14
gaptospace – Gaps between characters..............................................................................................................................................................................................................................14
3.3.1 Engine properties - plate type recognition.......................................................................................................................................................................................................................15
general - Selecting general or special reading mode .....................................................................................................................................................................................................15
depth - Heuristic sensitivity .....................................................................................................................................................................................................................................................15
adapt_environment - Accelerated mode selector ...........................................................................................................................................................................................................15
3.3.2 Engine properties - plate color recognition......................................................................................................................................................................................................................17
analyzecolors - Color recognition mode..............................................................................................................................................................................................................................17
whitebalance - White balance correction............................................................................................................................................................................................................................18
Appendices.....................................................................................................................................................................................................................................................................................................19
Confidence Level Calculation ..........................................................................................................................................................................................................................................................19
Sample Calculation..............................................................................................................................................................................................................................................................................20
Result Structure Examples ................................................................................................................................................................................................................................................................21
Retrieving country names from returned plate type values .................................................................................................................................................................................................23
I. In case of every engine excluding the USA (included Canada) and the Australian ones ................................................................................................................................23
II. In case of the USA (including Canada) and Australian engines...............................................................................................................................................................................24
Country and State IDs.........................................................................................................................................................................................................................................................................25
Position frequency...............................................................................................................................................................................................................................................................................26
Description ....................................................................................................................................................................................................................................................................................26
Properties.......................................................................................................................................................................................................................................................................................27
Property List...........................................................................................................................................................................................................................................................................................29
Property List of the CPD Module ....................................................................................................................................................................................................................................................30
Contact Information....................................................................................................................................................................................................................................................................................31

CPD Reference Manual Page 3/31


1. Introduction

The CARMEN® Parking Digital (CDP) module is dedicated for reading number plates from frame sequences. It reads
license plates transferred to the module, than compares them with the results of previously got images. If the
conditions, set by the properties of the module, are fulfilled then it returns number plate(s) read from the frame
sequence.

1.1 Handling of license

The CPD module is capable of processing images on more threads at the same time. The number of processes
working at the same time depends on the number of CPD licenses in the system. The number of NNC (Neural
Network Controller) devices determines the number of CPD licenses. There are 1, 2 and 4 core NNC devices as well.
Every core is equal with one CPD license. The CPD module is able to operate with FreeFlow and Parking devices as
well, realized with PCI, PCIe, PC104 card or USB keys. It is possible to use different types of NCC devices in one
computer. In such cases, the number of the CPD licenses depends on the NNC devices which are exceed in number
in the computer because the CPD module can use only one kind of NNC device at a time. For example having three
FreeFlow and one Parking license the CPD module will use the FreeFlow licenses.

1.2 Programming interface

We provide easy-to-use interfaces for different programming languages:


 C (cpd.h)
 C++ (cpd.h)
 C# (cpddotnet7.dll, cpd.ocx)
 VB.NET (cpddotnet7.dll, cpd.ocx)
 Java (jcpd.jar)
 Delphi (cpd.ocx)
 Visual Basic 5.0 (cpd.ocx)

The different interfaces realize the same basic functions according to the rules of the actual language. These basic
functions are:
 querying, setting and saving of module properties
 starting of the recognition process
 image transferring to the process
 querying the status of the process
 querying the got result
 reading out the details of the result from the result structure

CPD Reference Manual Page 4/31


2. Detailed Description

The main steps of the CPD processing are:

1. Starting the process


2. Adding an image to the process
3. Getting the status of the process
4. If the status is not CPD_STAT_PROCESSING, read the results and go to Step 1 or finish the processing.
5. If the status is CPD_STAT_PROCESSING and there are unprocessed images in the image sequence go to
Step 2.
6. If there are no more images in the image sequence go to Step 3.

The thread of the CPD process returns with timeout if dt1 time has expired. The thread returns with success if the
exit condition is fulfilled. This can occur in two cases. In first case (criteria 1) the CPD process has found n1 number
of equal number plates, in the second case (criteria 2) n2 number of equal number plates are found in a dt2 long
time period of maximum dt1 long time period. This second case (criteria 2) increases the dynamics of the exit
condition, because the caller application can get result waiting longer dt1 time in case of low quality plates, and
waiting shorter dt2 time in case of high quality plates. It is considered that n2 < n1 and dt2 < dt1, because in other
case, the second criteria has no effect.

|---------|--------|-------------|------------|
t0 t1 t2 t3 t4
| |<- dt2 ->| |
| |<- dt1 ->|

t0: starting time of the CPD process


t1: first AddImage: starting to measure time
t2: timestamp of the first found number plate
t3: end timestamp of the criteria 2 (for dt2 time)
t4: end timestamp of the criteria 1 (for dt1 time)

2.1 Starting of the recognition process

The recognition process can be started with the Start function of the CPD module.

2.2 Image transferring to the process

As the CPD module fits to the GX system, it uses gxIMAGE images. Besides, it provides the usual image loading
functions as well. Thus it is not necessary to convert your own images into gxIMAGE. It is enough to store pixel data
into a memory buffer and the image with the size data of the image can be conveyed to the CPD module.

2.3 Querying the status of the process

The status of the actual process can be started with the GetStatus function of the CPD module. In case of using
ActiveX control, the property of the control Status returns the actual status.

CPD Reference Manual Page 5/31


Possible status values:
CPD_STAT_UNDEFINED = -1
Undefined status.
CPD_STAT_PROCESSING = 0
CPD process is running.
CPD_STAT_END_SUCCESS = 1
CPD process is finished successfully.
CPD_STAT_END_TIMEOUT = 2
CPD process is finished with timeout.
CPD_STAT_END_NOTFOUND = 3
CPD process is finished and number plate not found.
CPD_STAT_END_ERROR = 4
CPD process is finished with an error.
CPD_STAT_WAIT_FOR_FIRST_IMAGE = 5
CPD process is waiting for the first image.

2.4 Querying the result


If the status is
CPD_STAT_END_SUCCESS,
CPD_STAT_END_TIMEOUT or
CPD_STAT_END_NOTFOUND, than the result(s) can be queried with the GetResult function of the CPD module.
In case of CPD_STAT_END_NOTFOUND status, the module returns only image. In case of
CPD_STAT_END_ERROR status the error can be queried by the gx_geterror() function of the GX system. The
module returns the result in gxVARIANT format.

2.5 Reading out the details of the result from the result structure
If there was a result, details got from the result can be read out with the GetResultItem function of the CPD
module. The following values can be used for the path parameter of the GetResultItem function:

capture/image
Returns the best image for the result of the number plate reading.

capture/imageID
Returns the ID of the result image specified by the user when calls the AddImage function.

capture/imageindex
Returns the index of the result image in the image sequence. The first index is 0.

anpr/text
Returns the Unicode format plate text reading by the engine.

anpr/text_ascii
Returns the ASCII format plate text reading by the engine.

CPD Reference Manual Page 6/31


anpr/disptext
This item has effect on Arabic characters only.
In case of recognition of Arabic letters, it returns the Unicode format plate text in the correct character
order (same as on the number plate) e.g. for displaying on screen. In case of Latin characters, the results
are the same as in case of anpr/text.

anpr/frame
Returns the frame of the plate read by the engine. The frame coordinates are stored in an array (x1, y1,
x2, y2, x3, y3, x4, y4).

anpr/bgcolor
Returns the background color of the plate in BGR format.

anpr/color
Returns the text color of the plate in BGR format.

anpr/color3rd
Returns the 3rd color of the plate in BGR format if it exists.

anpr/confidence
Returns the confidence of the result in percent (See below).

anpr/type
Returns the type of the plate.

anpr/timems
Returns the time of the process in msec.

confidence level
The confidence level value represents that to what extent the engine is sure about the result. Dirt and screw heads
on number plates or poor image quality may increase the risk of mistakes. The greater amount of risk is
represented with low confidence level values by the engine.
For more information on confidence level see Appendix.

3. Querying, setting and saving of module properties


The module property can be handled with the accustomed GetProperty, SetProperty and SaveProperties
functions at the rest GX based modules.
More threads do the different functions in the module which can be seen in the name of the properties of the
different threads as well.
Properties used by the ANPR module can be queried and set as well by the GetProperty and SetProperty
functions. For this it is necessary to write 'anpr1' (main engine) or 'anpr2' (secondary engine) before the property
name.

For example:
SetProperty(”anpr1/size”,20) - Sets the size property of the main engine to 20.

The function SaveProperties saves the CPD and ANPR properties into the given property group.

CPD Reference Manual Page 7/31


3.1 Engine handling in the CPD module

The CPD module is capable of using maximum two ANPR engines. The main and the secondary engine can be set
by the recognize/name1 and recognize/name2 properties of the CPD module. Setting the main engine is
absolutely necessary. If the usage of the secondary engine is not required, set the “-“ value. In the above
mentioned two properties a property group name has to be specified. This property group has to contain a
cmanpr property containing the exact name of the engine.
For example:
Case 1:
<cpd>
<recognize>
<name1 value="default"/>
<name2 value="-"/>
</recognize>
</cpd>

In this case, the CPD module will use the default engine; no secondary engine is specified. There is always a
cmanpr property in the default group if there is an installed engine. The recognize/name1 = “” also refers to the
default engine.
Case 2:
<cpd>
<recognize>
<name1 value="noland"/>
</recognize>
</cpd>
<noland>
<cmanpr-7.2.7.68>
<datafile value="cmanpr-7.68-noland.dat "/>
</cmanpr-7.2.7.68>
<cmanpr value="cmanpr-7.2.7.68:noland"/>
</noland>

In this case, the CPD module will use the engine defined by the cmanpr property of the noland group (cmanpr-
7.2.7.68:noland).
Case 3:
<cpd>
<recognize>
<name1 value="demo"/>
</recognize>
</cpd>
<esp>
<cmanpr-7.2.7.68>
<datafile value="cmanpr-7.68-esp.dat "/>
</cmanpr-7.2.7.68>
<cmanpr value="cmanpr-7.2.7.68:esp"/>
</esp>
<demo>
<cmanpr-7.2.7.68>
<datafile value="cmanpr-7.68-demo.dat "/>
</cmanpr-7.2.7.68>
<cmanpr value="cmanpr-7.2.7.68:esp"/>
</demo>

CPD Reference Manual Page 8/31


In this case, the CPD module will use the engine defined by the cmanpr property of the demo group (cmanpr-
7.2.7.68:esp instead of the cmanpr-7.2.7.68 engine from the demo group).
Case 4:
<cpd>
<recognize>
<name1 value="demo"/>
</recognize>
</cpd>
<esp>
<cmanpr-7.2.7.68>
<datafile value="cmanpr-7.68-esp.dat "/>
</cmanpr-7.2.7.68>
<cmanpr value="cmanpr-7.2.7.68:esp"/>
</esp>
<demo>
<cmanpr value="cmanpr-7.2.7.68:other"/>
</demo>

In this case, the CPD module will use the engine defined by the cmanpr property of the demo group (cmanpr-
7.2.7.68:other). Since there is no such installed engine an error will occur.

3.2 Properties of the CPD module

<cpd>
<capture>
<priority value="-1"/>
</capture>
<trigger>
<dt1 value="2000"/>
<dt2 value="1000"/>
<n1 value="6"/>
<n2 value="5"/>
</trigger>
<recognize>
<maxplates value="1"/>
<window value="0,0,0,0"/>
<name1 value="default"/>
<name2 value="-"/>
<mode value="0"/>
<priority value="1"/>
</recognize>
</cpd>

trigger/dt1 – Overall time limit in msec.


The CPD process returns time out error if dt1 time has expired and dt1 ≠ 0. dt1 = 0 means infinite waiting.
Default value: 2000

trigger/n1 – Recognizing limit during dt1.


Minimum number of recognition of the number plate. If the number of the recognition of the number plate
reaches n1 number the exit condition is fulfilled, and the CPD process returns with the summary of the result, and
the best image of the number plate.
Default value: 6

CPD Reference Manual Page 9/31


trigger/dt2 – Recognizing time limit in msec.
The length of the short time interval. The length of the short time interval for the criteria 2.
Default value: 1000

trigger/n2 – Recognizing limit during dt2.


Minimum number of recognitions. Number of the plates that are recognized in a dt2 time interval. If the CPD
process recognizes a number plate, it counts the equal results that are found in a dt2 time interval. If this count
reaches n2, the exit condition is fulfilled, and the CPD process returns the summary of the result, including the best
image of the number plate.
Default value: 5

recognize/window – ROI window on the image.


It is an active window on the image for the ANPR processing. The format is “x1,y1,x2,y2”, where x1,y1 coordinates
represent the top-left corner, while x2,y2 stands for the bottom right corner of the window. The value “0,0,0,0”
means no active window, the engine is finding the number plates in the whole image.
Default value: 0,0,0,0

recognize/maxplates – Anpr result number limit.


If a plate found in an image the engine is able to search for further plates: the maximal number of plates (to be
searched for) can be set here.
Default value: 1

recognize/name1 – The name of the property group of the main anpr module.
The name of the main engine’s property group. For more information see chapter “Engine handling in the CPD
module”.
Default value: default

recognize/name2 – The name of the property group of the secondary anpr module.
The name of the secondary engine’s property group. For more information see chapter “Engine handling in the
CPD module”.
Default value: - (It means no secondary engine)

recognize/mode – Number plate reading mode.


The ANPR calling mode.
0: calls only the main engine.
1: calls the main engine. If no plate found calls the secondary engine if it exists.
2: calls the main engine and then the secondary engine if it exists.
Default value: 0

capture/priority – Priority of the capture thread


Possible values:
-1: real time priority
0: normal priority
1: low priority
2: idle priority
Default value: -1

CPD Reference Manual Page 10/31


recognize/priority – Priority of the recognize thread
Possible values:
-1: real time priority
0: normal priority
1: low priority
2: idle priority
Default value: 1

3.3 Properties of the engines

Property name of the module is cmanpr in the property tree.


<default>
<cmanpr>
<datafile value="cmanpr-7.2.7.68.dat"/>
<size value="20"/>
...
By setting the properties of the engine appropriately, the recognition time of the engine can be decreased.
Properties effecting recognition time significantly are size_min, size_max, adapt_environment and
contrast_min. These are set appropriately if the intervals defined by them are as narrow as possible (suited to
camera environment).

datafile – Name of data file of the engine


This file has to be in the module folder. The name of the default data file is {engine name}.dat (i.e. cmanpr-7.68-
latin.dat for the cmanpr-7.68-latin engine). In case of having a data file with parameters optimized for some special
number plate types (for example cmanpr-7.68-latin.dat for European plates) this file can be used as well.
Default value: {module name}.dat

contrast_min – Minimal contrast


The supposed minimal difference between the grayscale value of the number plate characters and the plate
background.
Engine dependent default value.

gamma – turning on/off gamma correction on incoming images


NOTE: This parameter is available only from engine versions 7.87.
By this property, gamma correction can be applied on incoming images. After gamma correction, images become
brighter.
Possible values:
 0: Gamma correction is disabled.
 1: Gamma correction is applied with a correction of 2.2, which can result in better recognition rates in case
of linear images.

Image without gamma correction Image with gamma correction

Default value: 0

CPD Reference Manual Page 11/31


size – Average height of the characters
The average height of the number plate characters in the image in pixels.
No default value.
NOTE: size_min ≤ size ≤ size_max
So, the size value has to be equal to or greater than size_min and equal to or less than size_max otherwise the
engine may return no data.

size_min – Minimum height of the characters


The minimum height of the number plate characters in the image in pixels.
Engine dependent default value.

size_max – Maximum height of characters


The maximum height of the number plate characters in the image in pixels.
Engine dependent default value.

nchar_min - Minimum number of the characters in the plate


The minimum number of the number plate characters in the plate. The engine doesn’t return number plates on
which the number of characters is less than the nchar_min value.
NOTE: This property is ignored if plate type recognition is enabled!
Engine dependent default value.

nchar_max - Maximum number of characters in the plate


The maximum number of the number plate characters in the plate. The engine doesn't return number plates on
which the number of characters is more than the nchar_max value.
NOTE: This property is ignored if plate type recognition is enabled!
Engine dependent default value.

slope – Average slope of the number plate


The average slope of the number plate in the image. This value is represented in percent (%) and it is positive if the
horizontal axis of the number plate slopes downwards viewing from left to right.
Engine dependent default value.
NOTE: slope_min ≤ slope ≤ slope_max
So, the slope value has to be equal to or greater than slope_min and equal to or less than slope_max otherwise the
engine may return no data.

slope_min – Minimum slope of the number plate


The minimum slope of the number plate in the image. This value is represented in percent (%) and it is positive if
the horizontal axis of the number plate slopes downwards viewing from left to right.
Engine dependent default value.

slope_max – Maximum slope of the number plate


The maximum slope of the number plate in the image. This value is represented in percent (%) and it is positive if
the horizontal axis of the number plate slopes downwards viewing from left to right.
Engine dependent default value.

CPD Reference Manual Page 12/31


slant – Average slant of the number plate
The average slant of the number plate characters in the image. This value is represented in percent (%) and it is
positive if the vertical axis of the characters slants to the left viewing from bottom to top.
Engine dependent default value.
NOTE: slant_min ≤ slant ≤ slant_max
So, the slant value has to be equal to or greater than slant_min and equal to or less than slant_max otherwise the
engine may return no data.

slant_min – Minimum slant of the number plate


The minimum slant of the number plate characters in the image. This value is represented in percent (%) and it is
positive if the vertical axis of the characters slants to the left viewing from bottom to top.
Engine dependent default value.

slant_max – Maximum slant of the number plate


The maximum slant of the number plate characters in the image. This value is represented in percent (%) and it is
positive if the vertical axis of the characters slants to the left viewing from bottom to top.
Engine dependent default value.

(Calculating methods)

unicode_in_text
Representation of the non-ASCII characters in the text parameter of the cmNP structure.
Possible values are:
 0: The non-ASCII characters are substituted by an exclamation mark ('!')
 1: Each non-ASCII character is represented with 6 ASCII characters: '(xxxx)', where xxxx is the Unicode code
of the character in hexadecimal form including the leading zeros
Default value: 1

CPD Reference Manual Page 13/31


timeout – Time limit
The length of the time interval in milliseconds in which the module tries to find new number plates. The interval
starts when cm_findfirst() is called. At the end of this period the engine tries to finish searching new plates and any
additional call of cm_findnext() will result no plates found. Zero timeout value means no time limit.
Default value: 1000

xtoyres – The ratio of horizontal and vertical resolutions


The ratio of the horizontal and vertical resolutions of the plate. This value is represented in percent (%). The
horizontal resolution is the ratio of the width of the plate in the image and the real width of the plate. The vertical
resolution is the ratio of the height of the plate in the image and the real height of the plate. Zero value to xtoyres
means automatic setting of the ratio by cm_findfirst() using xsize and ysize parameters of the image as follows: if
xsize/ysize is less or equal to 7/3, xtoyres is set to 100, if xsize/ysize is greater than 7/3, xtoyres is set to 200.
Engine dependent default value.

This parameter can be set manually using images, which contain plates of the same type. Calculating the average
of the ratio r of the width and the height of the plates on images and by calculating the R ratio of the width and
the height of a real plate: (1) xtoyres=[(100*r)/R+0,5].
Example: The width of the Hungarian plates is 51 cm, the height is 11 cm, then the ratio of the width and the
height is 51/11=4,6363. On 100 images with Hungarian plates the average of the width and the height of the
plates is 5,25. In this case, using (1) xtoyres=[(100*5,25)/4,6363+0,5]=113.

colortype – Background color of the plate


The type of the plates to be read by the module.
Possible values are:
 0: Module searches for all kinds of plates in the image.
 1: Module searches for plates only with black characters on white background.
 2: Module searches for plates only with white characters on black background.
Default value: 0

gaptospace – Gaps between characters


If this parameter is set to a nonzero value, the module searches for gaps between characters that can be spaces.
Space characters are inserted to these positions in the text and wtext fields of the result structure. If the value is
zero, no spaces will appear in the result.
Default value: 0

CPD Reference Manual Page 14/31


3.3.1 Engine properties - plate type recognition

IMPORTANT
 Engines including plate type recognition option operate slower than ones without it.
 The basic Engine does not include plate type recognition option but our Support team supplies our
customers with one on request FREE OF CHARGE.
To enable plate type recognition, the following properties in this section has to be set properly.
general - Selecting general or special reading mode

NOTE: Values from 2 to 7 can be applied only if the .dat file contains ADR information (e.g. cmanpr-7.68-latin.dat).
Other engines use only two values: 0 and 1.
By this property, the reading modes can be selected.
Possible values:

 0: special mode, license plate text results returned only if the plate type is also recognized
 1: general mode, text results are always returned (NOTE: ADR results are not returned)
 2: turning off plate type ANPR, no results are returned
 3: results are returned only when type recognition is not successful
 4: returns ADR and license plate texts only with recognized plate types
 5: every result is returned.
 6: only ADR types with plate type recognition are returned
 7: returns ADR and results without plate type recognition

Default value: 1
depth - Heuristic sensitivity
CMANPR engines with license plate type recognition use more sophisticated algorithms than former ones, thus
not only the plate types are recognized but text accuracy is also improved in most cases. If the recognition time is
too long for the application, the depth of search may be lowered through this parameter, however the accuracy of
both text and plate type reading will be affected. If the application is not time-crucial, then this depth may be
increased to get higher recognition accuracy. If set to 0, plate type recognition and heuristics are disabled.
NOTE: For reading plate colors, plate type recognition has to be enabled!
Engine dependent default value. Possible values: 0-500.

adapt_environment - Accelerated mode selector


This property serves as an accelerator for the recognition process; it can be applied only when license plate type
recognition is enabled.
Possible values: 0 or 1
Standard mode if set to 0.
If set to 1, CMANPR engine applies real-time adaptation methods based on statistical measurements. In many
cases reading a few recognized license plates is enough to adapt to the environment and get even two times faster
license plate recognition, however recognition time and accuracy is optimized only when the application is
running.
When using adapt_environment the following factors have to be considered:

CPD Reference Manual Page 15/31


 Timeout Acceleration is VERY high using engines with large plate type set, if only a few different plate
types are common at the recognition location (e.g. Arabic engine used in Bahrain). Although the common
types will have intensively accelerated recognition, the uncommon ones will have about the same
recognition time as without using this option. Because of this, using low timeout value (e.g. based on the
mean recognition time calculated using acceleration) may end up in loosing all the uncommon license
plates. The timeout value must be set properly, not too low, taking into consideration all aspects.

 Recognition accuracy Acceleration is a very useful option in many cases (especially in time-crucial
applications), but it can easily cause some hard-to-understand "errors", e.g. the same license plate on the
same picture may be read at first but misread or not read at all after some other plates. This is because of
statistical reasons and it is not very common, however it may happen especially when using low timeout
values (read note no. 1). According to our tests, text reading accuracy is nearly the same with and without
acceleration. Plate type recognition accuracy is more sensitive to this option, but this also means that they
might even be improved in some cases.

 Error reporting Using acceleration makes it difficult to reproduce errors or misreading because the engine
continuously changes recognition parameters. Thus, before reporting an error please check it also with
acceleration disabled to help us decide whether it is an acceleration-related issue.
Default value: 0

CPD Reference Manual Page 16/31


3.3.2 Engine properties - plate color recognition

To enable plate color recognition the color mode has to be set properly.

analyzecolors - Color recognition mode


This property selects the mode of color recognition.

Possible values:
 0: Color identification is disabled
 1: CMANPR engine returns discrete 1 color values (exact 2 values are read and the statistically most possible
results are given)
NOTE: Discrete results may be incorrect - because of statistical reasons - in case of plates with formerly
unseen colors (e.g. blue plates will not be identified if there were only red and orange ones available when
the CMANPR data file was created)
 2: CMANPR engine returns the exact BGR values read (to define the exact color further processing may be
required by the user)
 4: Besides color recognition (as in case of value 1), this option provides the following feature: In case of
certain contemporary Saudi Arabian plates, - on which the band color is marked with a symbol (circle, or
isosceles triangle pointing to various directions) - a discrete color value is returned according to the marker
symbol.
 5: Both color identification and symbol reading are applied to recognize colors. Values are returned as in
case of value 1.
The CMANPR engine is capable of recognizing the color of a license plate only when the following requirements
are fulfilled:
 the license plate type recognition has to be enabled (depth > 0)
 the license plate type must be identified by the engine (if not, the identified color value might be wrong)
 the analyzecolors property has to be set to 1,2,4 or 5
NOTE: The operation of color recognition is not defined for values different from the enlisted ones above. When
setting values 4 or 5, color information may be returned from grayscale images as well, in case of plate types 5209–
5218.

Color codes and names


Color BGR Code Decimal (returned value)
White 0xFFFFFF 16777215
Black 0x000000 0
Blue 0xFF0000 16711680
Cyan 0xFFFF00 16776960
Green 0x00FF00 65280
Orange 0x0080FF 33023
Yellow 0x00FFFF 65535
Red 0x0000FF 255

Default value: 0

1
One of the eight values from the table ’Color codes and names’
2
A value between 0 and 16777215

CPD Reference Manual Page 17/31


whitebalance - White balance correction
When applying color recognition, the white balance is set automatically by the engine. In some special cases
(special camera settings, extreme weather or light conditions) the returned colors may not be correct. To avoid
misrecognition of colors the whitebalance property can be used.
 If it is set to 0 then white balance correction is not used.
 If it is set to 100 then maximal white balance correction is applied
24/7 use of white balance correction can also be applied. Incorrect results may return only when the camera is
used in very different environmental conditions in a very short time (e.g. the camera is used at night with
whitebalance 100, turned off and then turned on in the morning with the same settings).
Default value: 100

CPD Reference Manual Page 18/31


Appendices

Confidence Level Calculation

Where:

- Qall stands for the overall confidence (returned by GetConfidence)


- Qp stands for the confidence of the plate type*
- Gp stands for the confidence of the detected geometrical characteristics (gaps, stacked characters, font, etc)*
- qi stands for the confidence of the ith character

*NOTE: Qp and Gp values are not available in engines without plate type recognition option.

Based on this information, the following confidence values can be calculated:

Text confidence:

Overall confidence of the returned plate type (Qp*Gp):

NOTE: Qp and Gp values can not be queried or calculated separately.

CPD Reference Manual Page 19/31


Sample Calculation

Text confidence (Qc):

= q1* q2* q3* q4* q5* q6 – (Q values represent the confidence of the plate characters)

Since these values represent percentages each q value has to be divided by 100:

=(q1/100)*(q2/100)*(q3/100)*(q4/100)*(q5/100)*(q6/100) = (100/100)*(99/100)*(99/100)*(98/100)*(99/100)*(99/100)

So, ≈ 0,94

Qc≈94%

Overall confidence of the returned plate type (Qp* Gp):

Qall = 90% (‘confidence’ value above)

Qp* Gp =

Qp* Gp = 90/0,94
Qp* Gp ≈95,74%

CPD Reference Manual Page 20/31


Result Structure Examples
Sample #1 - number plate type from Hungary

cmanpr result result from


Plate type: 111 cmNP: type
Returned value Converted to BGR Color
decimal hexadecimal name
Character color: 0 0x000000 black cmNP::CHR color
Character background cmNP::CHR
16777215 0xFFFFFF white
color: bkcolor
cmNP:color
Dedicated area color: 16777215 0xFFFFFF white
(anpr.GetColor())

number plate text results


result from
If unicode_in_text=0 If unicode_in_text=1
Number plate
KGT239 KGT239 cmNP::text
(ASCII version)
Number plate
KGT239 cmNP::wtext
(UNICODE version)

Sample #2 - number plate type from Croatia

cmanpr result result from


Plate type: 3101 cmNP: type
Returned value Converted to BGR Color
decimal hexadecimal name
Character color: 0 0x000000 black cmNP::CHR color
Character background cmNP::CHR
16777215 0xFFFFFF white
color: bkcolor
cmNP:color
Dedicated area color: 16777215 0xFFFFFF white
(anpr.GetColor())

number plate text results


result from
If unicode_in_text=0 If unicode_in_text=1
Number plate
V!360GC V(017D)360GC cmNP::text
(ASCII version)
Number plate
VŽ360GC cmNP::wtext
(UNICODE version)

CPD Reference Manual Page 21/31


Sample #3 - number plate type from China

cmanpr result result from


Plate type: 8034 cmNP: type
Returned value Converted to BGR Color
decimal hexadecimal name
Character color: 16777215 0xFFFFFF white cmNP::CHR color
Character background cmNP::CHR
16711680 0xFF0000 blue
color: bkcolor
cmNP:color
Dedicated area color: 16711680 0xFF0000 blue
(anpr.GetColor())

number plate text results


result from
If unicode_in_text=0 If unicode_in_text=1
Number plate
!N719N0 (4eac)N719N0 cmNP::text
(ASCII version)
Number plate
N719N0 cmNP::wtext
(UNICODE version)

Sample #4 - a number plate type from OMAN

cmanpr result result from


Plate type: 5306 cmNP: type
Returned value Converted to BGR Color
decimal hexadecimal name
Character color: 0 0x000000 black cmNP::CHR color
Character background cmNP::CHR
65535 0x00FFFF yellow
color: bkcolor
cmNP:color
Dedicated area color: 65535 0x00FFFF yellow
(anpr.GetColor())

number plate text results


result from
If unicode_in_text=0 If unicode_in_text=1
Number plate
2219RS 2219RS cmNP::text
(ASCII version)
Number plate
2219RS cmNP::wtext
(UNICODE version)

CPD Reference Manual Page 22/31


Sample #5 - number plate type from Saudi Arabia

cmanpr result result from


Plate type: 5209 cmNP: type
Returned value Converted to BGR Color
decimal hexadecimal name
Character color: 0 0x000000 black cmNP::CHR color
Character background cmNP::CHR
16777215 0xFFFFFF white
color: bkcolor
cmNP:color
Dedicated area color: 42495 0x0080FF orange
(anpr.GetColor())

number plate text results


result from
If unicode_in_text=0 If unicode_in_text=1
(0668)(0660)(0669)
Number plate
!!!!!! (0665)(0639)(0627) cmNP::text
(ASCII version) (0627)
Number plate
cmNP::wtext
(UNICODE version)

Retrieving country names from returned plate type values

The returned cmNP::type value is 0 -plate type info is not available- in the following cases:

 If the engine does not include plate type recognition option*


 If the engine can not determine the type of the plate

*The Support Team supplies our customers with engines including plate type recognition option free of charge. Do
not hesitate to contact us.

The returned cmNP::type value by the engine contains the following information:

 country of the plate


 state information (in case of USA, Canada and Australia)
 subtype of the plate (for more information on subtype information feel free to contact ARH Support
Team)

I. In case of every engine excluding the USA (included Canada) and the Australian ones

The type value (T) is a decimal between 100 and 99999. Divided this type value by 100 the result is the code of
the country (C). The remainder defines the subtype (S) within the country.

CPD Reference Manual Page 23/31


Example: Latin engine

cmNP::type: 111
C=111/100=1 defines HUN (Hungary) as country.
The remainder (S=111 mod 100) =11, refers to the standard, single-row Hungarian EU-plate

II. In case of the USA (including Canada) and Australian engines

The type value (T) is a decimal which is greater than 100000 consisting three main components.
T=100000*C+100*F+S
Where:
 C - state code within the USA; C=T/100000
 F - Format -a number between 0 and 999- is built up according to the followings:
o 0-stands for a number in the plate text
o 1-stands for a letter in the plate text
o N-stands for the length of the plate text
(in the formula below 2N equals to the greatest power of two below or equal to F)
o B: Decimal value of the plate text’s binary format created by the previous rules

The B value can be calculated according to the following formula: F=2N-2+B

Subtype (S): Serves to distinct plates with the same format within a state (2-digit decimal between 0 and 99)

Example: USA and Canada engine

cmNP::type: 1121701
T=1121701.
C=T/100000= 1121701/100000=11 defines USA-CA (California).
F=217
Subtype (S)=1,

F=2N-2+B where N is the greatest power of two below 217, which is 128. 128=27 so N=7
217=27-2+B
217=126+B
B=91 converted to binary: 1011011, so the format of the plate is the following:

’letter number letter letter number letter letter’

CPD Reference Manual Page 24/31


Country and State IDs

Country IDs 50 GEO 102 DEU_OLDTIMER 24 USA-NC


51 COL 103 DEU_SEASON 25 USA-MA
1 HUN 52 SAU 104 DEU_TEMP_Old 26 USA-CT
2 UKR 53 OMN 105 DEU_TEST_Old 27 USA-OR
3 RUS 54 KWT 106 DEU_OLDTIMER_Old 28 USA-NE
4 LTU 55 BHR 107 DEU_SEASON_Old 29 USA-WA
5 CZE 56 FIN 108 MOZ 30 USA-AZ
6 LVA 57 EST 109 LSO 31 USA-WY
7 AUT 58 JOR 110 ZWE 32 USA-KS
8 DEU 59 IRN 111 AZE 33 USA-AL
9 ROU 60 ARE_CD 112 KGZ 34 USA-AK
10 SVK 61 ARE_Dubai 113 FRA 35 USA-AR
11 POL 62 ARE_AbuDhabi 128 GBR 36 USA-DE
12 NLD 63 ARE_Ajman 136 IRL 37 USA-DC
13 FRA 64 ARE_Fujairah 140 ZAF 38 USA-HI
14 TWN 65 ARE_Sharjah 142 IMN 39 USA-ID
15 BRA 66 ARE_UmmalQuwain 143 JEY 40 USA-LA
16 KOR 67 ARE_RasAlKhaimah 144 GGY 41 USA-MS
17 ITA 68 ARE_Unknown 145 NZL 42 USA-MT
18 CHL 70 NOR 176 MAR 43 USA-NV
19 SVN 71 LBN 180 CHN 44 USA-NH
20 MLT 72 ARG 181 CHN 45 USA-NM
21 ESP 73 MCO 184 VAT 46 USA-ND
22 SGP 74 LIE 185 VEN 47 USA-RI
23 BIH 75 KAZ 186 ANT 48 USA-SC
24 SMR 76 MAR 49 USA-SD
25 CHE 77 SYR USA State IDs 50 USA-UT
26 SWE 78 HKG 51 USA-VT
27 BEL 79 GIB 1 USA-GOV 52 USA-WV
28 GBR 80 CHN 2 USA-IL 60 CAN-ON
29 DNK 81 CHN 3 USA-IN 61 CAN-QC
30 AND 82 KOR 4 USA-MI 62 CAN-BC
31 HRV 83 EGY 5 USA-WI 63 CAN-MB
32 SRB 84 KOS 6 USA-OH 64 CAN-NS
33 GRC 85 ISR 7 USA-ME 65 CAN-AB
34 LUX 86 CRI 8 USA-TN 66 CAN-SK
35 MYS 87 AUT_Old 9 USA-MN 67 CAN-NB
36 IRL 88 DEU_Old 10 USA-PA 73 CAN-FED
37 PRT 89 FRA_New 11 USA-CA
38 THA 90 MDA 12 USA-FL Australian State IDs
39 MEX 91 MNE 13 USA-VA
40 ZAF 92 TKM 14 USA-NY 1 AUS-FIS
41 MKD 93 MNG 15 USA-TX 2 AUS-ACT
42 BGR 94 BWA 16 USA-IA 3 AUS-NT
43 ALB 95 NAM 17 USA-OK 4 AUS-NSW
44 ISL 96 SWZ 18 USA-CO 5 AUS-QLD
45 NZL 97 ADR 19 USA-KY 6 AUS-SA
46 QAT 98 UN 20 USA-MO 7 AUS-TAS
47 BLR 99 Unknown 21 USA-NJ 8 AUS-VIC
48 DZA 100 DEU_TEMP 22 USA-GA 9 AUS-WA
49 TUR 101 DEU_TEST 23 USA-MD

CPD Reference Manual Page 25/31


Position frequency
By using the position frequency, certain areas can be specified for the ANPR engine, which are more superior to
the others.

Please check the following sample image which indicates superior areas in the center of the image:

Description

With the following parameters the ANPR algorithm can be set to search for license plates on specific parts of the
image. Moreover, some parts can be differentiated according to probability of the license plate occurrence. The
essence of the method is that the image is divided into equal zones and each zone is provided with a weight.

The correct value assignment of the weight increases the effectiveness of the searching process. Giving a larger
weight of the appointed zone increases the probability of finding the plate and decreases the plate reading time.

The weight assignment is possible in three ways:


o by uniform distribution: the weight of each zone will be the same positive number,
o manually: by the posfeq property (see below) zones can be defined by the user,
o defining a polygon by the posfreq property (see below), that should contain all the plates to be read.

There is a possibility for adaption of the weights as well. In this case, the engine calculates the weights by itself
based on the incoming images: each found plate increases the weight of that zone which contains the plate.

CPD Reference Manual Page 26/31


Properties

posfreq

This property contains numbers divided by ',' and ';' within a row.
If the string is empty, it initializes the grid with uniform distribution (the weight of each zone will be the same
positive number).
Otherwise, ',' separates the numbers while the ';' stands for the line wrap.
If there are two columns and at least three rows, the string defines a polygon. Otherwise it defines zones, where
the given numbers are the starting weights of the zones.
The data is invalid if the rows are not the same length.

For example:
Defining zones:
<posfreq value=“1,1,1;4,9,4;1,1,1”/>
The image is divided into 3×3 zone with the given starting weights.

1 1 1

4 9 4

1 1 1

Defining a polygon:
<posfreq value="264,0;450,0;610,445;110,445">
NOTE: Order of the coordinates has to be set clockwise (see below).
A polygon is designated in the center of the image, on the score of which the algorithm produces the zones
(posfreqhistxs*posfreqhistys is the number of zones, 16*16 by default) in such a way that the starting weight of the
zones – contained by the polygon – will be maximal.
The weight of the zones intersected by the polygon will be lower in proportion to the intersection.
Finally, the weight of the outer (untouched by the polygon) zones will be 0.
It doesn’t return any character from the zones with 0 weight.
Example for posfreq settings:
264,0 450,0

110,445 610,445

CPD Reference Manual Page 27/31


posfreqhistxs,posfreqhistys [2..64],[2..64]

In case of setting a polygon, the number of rows and columns can be set by these properties.
Both are 16 by default.

posfreqhalflife [0..1048576]

If its value is 0, the weights will not be adapted (it does not learn from the previous cases). It will use the original
settings all the time.
Otherwise, after 'posfreqhalflife' number of evaluations, the starting information will be half lapsed and the new
information will be half freshened.
Half-life: after evaluation of so many images the total weight of the histogram will be twice as much.
Default value: 0.

posfreqweight [0..100]

This parameter defines that to what extent the system has to take into account the position of the license plates.
If this parameter is 0, the system does not distinguish between the non-0 weight zones. In this case, the searching
does not exploit the distribution of the position of license plates.
If this parameter is 100, the system tries to exploit maximally the distribution of the position of license plates.
Default value: 50.

CPD Reference Manual Page 28/31


Property List

-A-
adapt_environment - Property for accelerated mode
analyzecolors - Color recognition mode

-C-
colortype - Background color of the plate
contrast_min - Minimal contrast

-D-
datafile - Name of data file of the engine
depth - Heuristic sensitivity

-G-
gaptospace - Gaps between characters
general - Selects general or special reading mode

-N-
nchar_min - Minimum number of characters in the plate
nchar_max - Maximum number of characters in the plate

-S-
size - Average height of the characters
size_min - Minimum height of the characters
size_max - Maximum height of characters
slant - Average slant of the number plate
slant_min - Minimum slant of the number plate
slant_max - Maximum slant of the number plate
slope - Average slope of the number plate
slope_min - Minimum slope of the number plate
slope_max - Maximum slope of the number plate

-T-
timeout - Time limit

-U-
unicode_in_text - Representation of the non ASCII characters in the text parameter of the cmNP structure
-W-
whitebalance - White balance correction

-X-
xtoyres - The ratio of horizontal and vertical resolutions

CPD Reference Manual Page 29/31


Property List of the CPD Module

-C-
capture/priority – Priority of the capture thread.

-R-
recognize/window – ROI window on the image.
recognize/maxplates – Anpr result number limit.
recognize/name1 – The name of the property group of the main anpr module.
recognize/name2 – The name of the property group of the secondary anpr module.
recognize/mode – Number plate reading mode.
recognize/priority – Priority of the recognize thread.

-T-
trigger/dt1 – Overall time limit in msec.
trigger/n1 – Recognizing limit during dt1.
trigger/dt2 – Recognizing time limit in msec.
trigger/n2 – Recognizing limit during dt2.

CPD Reference Manual Page 30/31


Contact Information

Should you have any problem during operating the products, our support team is at your disposal. Please try to
explain the problem as detailed as possible and do not forget to send the following information to make it easier
to help you:

 The name of your company (for administration purposes).


 The exact type of the product you have (serial number is appreciated).
 If you have problems during recognition, send images in the original file format.
 If there is any error code or message appearing, please send us the code snippet where it occurs (a
screenshot may also be helpful).
 If you noticed the problem while running a Demo or a sample application, please let us know the name of
the application you tested.
 If you have some problem while developing your own application, please specify the followings:
o your programming language
o your operating system
o the name and version number of the compiler you use
o the programming technology (e.g. native C/C++ / ActiveX / .NET)
o If possible please send a short part of the source code. Please try to determine the place where the
error occurs (e.g. “the scapture?getshutter command returns a negative number…“).

IMPORTANT NOTES:

 Before sending back a faulty device, always contact ARH Support Team.
 Repairs may be executed by the manufacturer only!

Office address: Service address:


ARH Inc. ARH Inc.
41 Alkotás Road Ipari Park HRSZ 1113/1
HU-1123 Budapest HU-2074 Perbál
Hungary Hungary
Phone: +36 1 2019650 Phone: +36 1 2019650
Web: www.arhungary.hu Web: www.arhungary.hu
Email: support@arh.hu Email: rmarequest@arh.hu

CPD Reference Manual Page 31/31

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy