CPD Reference Manual: Page 1/31
CPD Reference Manual: Page 1/31
Reference Manual
v. 1.0.2.5
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.
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.
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
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 ->|
The recognition process can be started with the Start function of the CPD module.
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.
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.
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.
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.
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.
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>
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.
<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>
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)
Default value: 0
(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
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.
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.
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
To enable plate color recognition the color mode has to be set properly.
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.
Default value: 0
1
One of the eight values from the table ’Color codes and names’
2
A value between 0 and 16777215
Where:
*NOTE: Qp and Gp values are not available in engines without plate type recognition option.
Text confidence:
= 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%
Qp* Gp =
Qp* Gp = 90/0,94
Qp* Gp ≈95,74%
The returned cmNP::type value is 0 -plate type info is not available- in the following cases:
*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:
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.
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
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
Subtype (S): Serves to distinct plates with the same format within a state (2-digit decimal between 0 and 99)
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:
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.
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.
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
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.
-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
-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.
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:
IMPORTANT NOTES:
Before sending back a faulty device, always contact ARH Support Team.
Repairs may be executed by the manufacturer only!