Name
find_data_code_2dfind_data_code_2dFindDataCode2dfind_data_code_2dFindDataCode2dFindDataCode2d — Detect and read 2D data code symbols in an image or
train the 2D data code model.
Herror find_data_code_2d(const Hobject Image, Hobject* SymbolXLDs, const Hlong DataCodeHandle, const char* GenParamNames, const Hlong GenParamValues, Hlong* ResultHandles, char* DecodedDataStrings)
Herror T_find_data_code_2d(const Hobject Image, Hobject* SymbolXLDs, const Htuple DataCodeHandle, const Htuple GenParamNames, const Htuple GenParamValues, Htuple* ResultHandles, Htuple* DecodedDataStrings)
Herror find_data_code_2d(Hobject Image, Hobject* SymbolXLDs, const HTuple& DataCodeHandle, const HTuple& GenParamNames, const HTuple& GenParamValues, Hlong* ResultHandles, char* DecodedDataStrings)
Herror find_data_code_2d(Hobject Image, Hobject* SymbolXLDs, const HTuple& DataCodeHandle, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* ResultHandles, HTuple* DecodedDataStrings)
HXLDContArray HImage::FindDataCode2d(const HDataCode2D& DataCodeHandle, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* ResultHandles, HTuple* DecodedDataStrings) const
HXLDContArray HDataCode2D::FindDataCode2d(const HImage& Image, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* ResultHandles, HTuple* DecodedDataStrings) const
void FindDataCode2d(const HObject& Image, HObject* SymbolXLDs, const HTuple& DataCodeHandle, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* ResultHandles, HTuple* DecodedDataStrings)
HXLDCont HDataCode2D::FindDataCode2d(const HImage& Image, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* ResultHandles, HTuple* DecodedDataStrings) const
HXLDCont HDataCode2D::FindDataCode2d(const HImage& Image, const HString& GenParamNames, Hlong GenParamValues, Hlong* ResultHandles, HString* DecodedDataStrings) const
HXLDCont HDataCode2D::FindDataCode2d(const HImage& Image, const char* GenParamNames, Hlong GenParamValues, Hlong* ResultHandles, HString* DecodedDataStrings) const
HXLDCont HImage::FindDataCode2d(const HDataCode2D& DataCodeHandle, const HTuple& GenParamNames, const HTuple& GenParamValues, HTuple* ResultHandles, HTuple* DecodedDataStrings) const
HXLDCont HImage::FindDataCode2d(const HDataCode2D& DataCodeHandle, const HString& GenParamNames, Hlong GenParamValues, Hlong* ResultHandles, HString* DecodedDataStrings) const
HXLDCont HImage::FindDataCode2d(const HDataCode2D& DataCodeHandle, const char* GenParamNames, Hlong GenParamValues, Hlong* ResultHandles, HString* DecodedDataStrings) const
void HOperatorSetX.FindDataCode2d(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX** SymbolXLDs, [in] VARIANT DataCodeHandle, [in] VARIANT GenParamNames, [in] VARIANT GenParamValues, [out] VARIANT* ResultHandles, [out] VARIANT* DecodedDataStrings)
IHXLDContX* HDataCode2DX.FindDataCode2d(
[in] IHImageX* Image, [in] VARIANT GenParamNames, [in] VARIANT GenParamValues, [out] VARIANT* ResultHandles, [out] VARIANT* DecodedDataStrings)
IHXLDContX* HImageX.FindDataCode2d(
[in] IHDataCode2DX* DataCodeHandle, [in] VARIANT GenParamNames, [in] VARIANT GenParamValues, [out] VARIANT* ResultHandles, [out] VARIANT* DecodedDataStrings)
static void HOperatorSet.FindDataCode2d(HObject image, out HObject symbolXLDs, HTuple dataCodeHandle, HTuple genParamNames, HTuple genParamValues, out HTuple resultHandles, out HTuple decodedDataStrings)
HXLDCont HDataCode2D.FindDataCode2d(HImage image, HTuple genParamNames, HTuple genParamValues, out HTuple resultHandles, out HTuple decodedDataStrings)
HXLDCont HDataCode2D.FindDataCode2d(HImage image, string genParamNames, int genParamValues, out int resultHandles, out string decodedDataStrings)
HXLDCont HImage.FindDataCode2d(HDataCode2D dataCodeHandle, HTuple genParamNames, HTuple genParamValues, out HTuple resultHandles, out HTuple decodedDataStrings)
HXLDCont HImage.FindDataCode2d(HDataCode2D dataCodeHandle, string genParamNames, int genParamValues, out int resultHandles, out string decodedDataStrings)
The operator find_data_code_2dfind_data_code_2dFindDataCode2dfind_data_code_2dFindDataCode2dFindDataCode2d detects 2D data code symbols
in the input image (ImageImageImageImageImageimage) and reads the data that is encoded
in the symbol.
Before calling find_data_code_2dfind_data_code_2dFindDataCode2dfind_data_code_2dFindDataCode2dFindDataCode2d, a model of a class of 2D
data codes that matches the symbols in the images must be
created with create_data_code_2d_modelcreate_data_code_2d_modelCreateDataCode2dModelcreate_data_code_2d_modelCreateDataCode2dModelCreateDataCode2dModel or
read_data_code_2d_modelread_data_code_2d_modelReadDataCode2dModelread_data_code_2d_modelReadDataCode2dModelReadDataCode2dModel.
The handle returned by these operators is passed to
find_data_code_2dfind_data_code_2dFindDataCode2dfind_data_code_2dFindDataCode2dFindDataCode2d in DataCodeHandleDataCodeHandleDataCodeHandleDataCodeHandleDataCodeHandledataCodeHandle.
To look for more than one symbol in an image, the generic parameter
'stop_after_result_num'"stop_after_result_num""stop_after_result_num""stop_after_result_num""stop_after_result_num""stop_after_result_num" can be passed to
GenParamNamesGenParamNamesGenParamNamesGenParamNamesGenParamNamesgenParamNames together with the number of requested
symbols as GenParamValuesGenParamValuesGenParamValuesGenParamValuesGenParamValuesgenParamValues.
As a result the operator returns for every successfully decoded
symbol the surrounding XLD contour (SymbolXLDsSymbolXLDsSymbolXLDsSymbolXLDsSymbolXLDssymbolXLDs), a
result handle, which refers to a candidate structure that stores
additional information about the symbol as well as the search and
decoding process (ResultHandlesResultHandlesResultHandlesResultHandlesResultHandlesresultHandles), and the string that is
encoded in the symbol (DecodedDataStringsDecodedDataStringsDecodedDataStringsDecodedDataStringsDecodedDataStringsdecodedDataStrings).
Passing the candidate handle from ResultHandlesResultHandlesResultHandlesResultHandlesResultHandlesresultHandles together
with the generic parameter 'decoded_data'"decoded_data""decoded_data""decoded_data""decoded_data""decoded_data",
get_data_code_2d_resultsget_data_code_2d_resultsGetDataCode2dResultsget_data_code_2d_resultsGetDataCode2dResultsGetDataCode2dResults returns a tuple with the ASCII code
of all characters of the string.
The symbol structure of GS1 DataMatrix, GS1 QR Code, and GS1 Aztec is
identical to the structure of ECC 200, QR Code, and Aztec Code,
respectively. Therefore, all parameters, settings, and rules applying to
ECC 200, QR Code, or Aztec Code apply to their GS1 variants as well. The
GS1 symbologies enforce merely additional rules for the format of the data
carried by the codes. The data has to be organized in so called GS1
application element strings according to the GS1 General Specifications.
For example, if the data code model DataCodeHandleDataCodeHandleDataCodeHandleDataCodeHandleDataCodeHandledataCodeHandle is created as
GS1 DataMatrix, then find_data_code_2dfind_data_code_2dFindDataCode2dfind_data_code_2dFindDataCode2dFindDataCode2d only returns a result if
the underlying symbol is a valid ECC 200 symbol, and only if its data
conforms to the GS1 application element strings rules. In contrast,
find_data_code_2dfind_data_code_2dFindDataCode2dfind_data_code_2dFindDataCode2dFindDataCode2d will return no results for ECC 200 containing
general data. The same is valid for GS1 QR Code and GS1 Aztec Code.
Adjusting the model
If there is a symbol in the image that cannot be read, it should be
verified, whether the properties of the symbol fit the model parameters.
Special attention should be paid to
-
the correct polarity ('polarity'"polarity""polarity""polarity""polarity""polarity", light-on-dark or
dark-on-light),
-
the symbol size ('symbol_size'"symbol_size""symbol_size""symbol_size""symbol_size""symbol_size" for ECC 200 and Aztec Code),
-
'version'"version""version""version""version""version" for QR Code,
-
'format'"format""format""format""format""format" for Aztec Code,
-
the module size ('module_size'"module_size""module_size""module_size""module_size""module_size" for ECC 200, QR Code,
Micro QR Code, and Aztec Code, 'module_width'"module_width""module_width""module_width""module_width""module_width" and
'module_aspect'"module_aspect""module_aspect""module_aspect""module_aspect""module_aspect" for PDF417),
-
the possibility of a mirroring of the symbol ('mirrored'"mirrored""mirrored""mirrored""mirrored""mirrored"),
-
and the specified minimum contrast ('contrast_min'"contrast_min""contrast_min""contrast_min""contrast_min""contrast_min").
Further relevant parameters are the gap between neighboring
foreground modules and, for ECC 200, the maximum slant of the
L-shaped finder pattern ('slant_max'"slant_max""slant_max""slant_max""slant_max""slant_max").
The current settings for these parameters are returned by the
operator get_data_code_2d_paramget_data_code_2d_paramGetDataCode2dParamget_data_code_2d_paramGetDataCode2dParamGetDataCode2dParam.
If necessary, the corresponding model parameters can be adjusted with
set_data_code_2d_paramset_data_code_2d_paramSetDataCode2dParamset_data_code_2d_paramSetDataCode2dParamSetDataCode2dParam.
It is recommended to adjust the model as well as possible to the
symbols in the images also for runtime reasons.
In general, the runtime of find_data_code_2dfind_data_code_2dFindDataCode2dfind_data_code_2dFindDataCode2dFindDataCode2d is higher for
a more general model than for a more specific model.
One should take into account that a general model leads to a high
runtime especially if no valid data code can be found.
Train the model
Besides setting the model parameters manually with
set_data_code_2d_paramset_data_code_2d_paramSetDataCode2dParamset_data_code_2d_paramSetDataCode2dParamSetDataCode2dParam, the model can also be trained with
find_data_code_2dfind_data_code_2dFindDataCode2dfind_data_code_2dFindDataCode2dFindDataCode2d based on one or several sample images.
For this, the generic parameter 'train'"train""train""train""train""train" must be passed in
GenParamNamesGenParamNamesGenParamNamesGenParamNamesGenParamNamesgenParamNames.
The corresponding value passed in GenParamValuesGenParamValuesGenParamValuesGenParamValuesGenParamValuesgenParamValues determines
the model parameters that should be learned.
The following values are possible:
-
All data code types:
- 'all'"all""all""all""all""all":
-
All model parameters that can be trained,
- 'symbol_size'"symbol_size""symbol_size""symbol_size""symbol_size""symbol_size":
-
Symbol size and for ECC 200 also the symbol shape
(rectangle or square);
for QR Code and Micro QR Code it is also possible to pass
'version'"version""version""version""version""version".
- 'module_size'"module_size""module_size""module_size""module_size""module_size":
-
Size of the modules; for PDF417 this includes the module
width and the module aspect ratio.
- 'small_modules_robustness'"small_modules_robustness""small_modules_robustness""small_modules_robustness""small_modules_robustness""small_modules_robustness":
-
Robustness of the decoding of data codes with very small
module sizes.
- 'polarity'"polarity""polarity""polarity""polarity""polarity":
-
Polarity of the symbols: they may appear dark on a light
background or light on a dark background.
- 'mirrored'"mirrored""mirrored""mirrored""mirrored""mirrored":
-
Whether the symbols in the image are mirrored or not.
- 'contrast'"contrast""contrast""contrast""contrast""contrast":
-
Minimum contrast for detecting the symbols.
-
ECC 200, Aztec Code, QR Code, and Micro QR Code only:
- 'module_shape'"module_shape""module_shape""module_shape""module_shape""module_shape":
-
Shape of the modules, especially whether there is a gap
between neighboring foreground modules or whether they are
connected.
-
ECC 200 and Aztec Code only:
- 'finder_pattern_tolerance'"finder_pattern_tolerance""finder_pattern_tolerance""finder_pattern_tolerance""finder_pattern_tolerance""finder_pattern_tolerance":
-
The allowed tolerance of the symbol search with respect to
a defect or partially occluded finder pattern.
-
ECC 200 only:
- 'contrast_tolerance'"contrast_tolerance""contrast_tolerance""contrast_tolerance""contrast_tolerance""contrast_tolerance":
-
The tolerance of the symbol search with respect to strong
local contrast variations.
- 'module_grid'"module_grid""module_grid""module_grid""module_grid""module_grid":
-
Algorithm for calculating the module positions
(fixed or variable grid).
- 'image_proc'"image_proc""image_proc""image_proc""image_proc""image_proc":
-
Adjusting different internal image processing parameters;
until now, only the maximum slant of the L-shaped finder
pattern of the ECC 200 symbols is set; more parameters may
follow in future.
-
QR Code only:
- 'model_type'"model_type""model_type""model_type""model_type""model_type":
-
Whether the QR Code symbols follow the Model 1 or Model 2
specification.
-
Aztec Code only
- 'additional_levels'"additional_levels""additional_levels""additional_levels""additional_levels""additional_levels":
-
The number of additional pyramid levels
It is possible to train several of these parameters in one
call of find_data_code_2dfind_data_code_2dFindDataCode2dfind_data_code_2dFindDataCode2dFindDataCode2d by passing the generic parameter
'train'"train""train""train""train""train" in a tuple more than once in conjunction with the
corresponding parameters: e.g.,
GenParamNamesGenParamNamesGenParamNamesGenParamNamesGenParamNamesgenParamNames = ['train','train']["train","train"]["train","train"]["train","train"]["train","train"]["train","train"] and
GenParamValuesGenParamValuesGenParamValuesGenParamValuesGenParamValuesgenParamValues = ['polarity','module_size']["polarity","module_size"]["polarity","module_size"]["polarity","module_size"]["polarity","module_size"]["polarity","module_size"].
Furthermore, in conjunction with 'train'"train""train""train""train""train" = 'all'"all""all""all""all""all"
it is possible to exclude single parameters from training
explicitly again by passing 'train'"train""train""train""train""train" more than once.
The names of the parameters to exclude, however, must be prefixed
by '~'"~""~""~""~""~":
GenParamNamesGenParamNamesGenParamNamesGenParamNamesGenParamNamesgenParamNames = ['train','train']["train","train"]["train","train"]["train","train"]["train","train"]["train","train"] and
GenParamValuesGenParamValuesGenParamValuesGenParamValuesGenParamValuesgenParamValues =
['all','~contrast']["all","~contrast"]["all","~contrast"]["all","~contrast"]["all","~contrast"]["all","~contrast"],
e.g., trains all parameters except the minimum contrast.
For training the model, the following aspects should be considered:
-
To use several images for the training, the operator
find_data_code_2dfind_data_code_2dFindDataCode2dfind_data_code_2dFindDataCode2dFindDataCode2d must be called with the parameter
'train'"train""train""train""train""train" once for every sample image.
-
It is also possible to train the model with several symbols in
one image.
Here, the generic parameter 'stop_after_result_num'"stop_after_result_num""stop_after_result_num""stop_after_result_num""stop_after_result_num""stop_after_result_num"
must be passed as a tuple to GenParamNamesGenParamNamesGenParamNamesGenParamNamesGenParamNamesgenParamNames together with
'train'"train""train""train""train""train".
The number of symbols in the image is passed in
GenParamValuesGenParamValuesGenParamValuesGenParamValuesGenParamValuesgenParamValues together with the training parameters.
-
If the training image contains more symbols than the one that
shall be used for the training the domain of the image should
be reduced to the symbol of interest with reduce_domainreduce_domainReduceDomainreduce_domainReduceDomainReduceDomain.
-
In an application with very similar images, one image for
training may be sufficient if the following assumptions are true:
The symbol size (in modules) is the same for all symbols used in
the application, foreground and background modules are of the
same size and there is no gap between neighboring foreground
modules, the background has no distinct texture; and the
contrast of all images is almost the same.
Otherwise, several images should be used for training.
-
In applications where the symbol size (in modules) is not fixed,
the smallest as well as the biggest symbols should be used for
the training.
If this can not be guaranteed, the limits for the symbol size
should be adapted manually after the training, or the symbol
size should entirely be excluded from the training.
-
During the first call of find_data_code_2dfind_data_code_2dFindDataCode2dfind_data_code_2dFindDataCode2dFindDataCode2d in the
training mode, the trained model parameters are restricted to
the properties of the detected symbol.
Any successive training call will, where necessary, extend the
parameter range to cover the already trained symbols as well as
the new symbols.
Resetting the model with set_data_code_2d_paramset_data_code_2d_paramSetDataCode2dParamset_data_code_2d_paramSetDataCode2dParamSetDataCode2dParam to one of
its default settings ('default_parameters'"default_parameters""default_parameters""default_parameters""default_parameters""default_parameters" =
'standard_recognition'"standard_recognition""standard_recognition""standard_recognition""standard_recognition""standard_recognition", 'enhanced_recognition'"enhanced_recognition""enhanced_recognition""enhanced_recognition""enhanced_recognition""enhanced_recognition", or
'maximum_recognition'"maximum_recognition""maximum_recognition""maximum_recognition""maximum_recognition""maximum_recognition") will also reset the training
state of the model.
-
If find_data_code_2dfind_data_code_2dFindDataCode2dfind_data_code_2dFindDataCode2dFindDataCode2d is not able to read the
symbol in the training image, this will produce no error or
exception handling.
This can simply be tested in the program by checking the
results of find_data_code_2dfind_data_code_2dFindDataCode2dfind_data_code_2dFindDataCode2dFindDataCode2d: SymbolXLDsSymbolXLDsSymbolXLDsSymbolXLDsSymbolXLDssymbolXLDs,
ResultHandlesResultHandlesResultHandlesResultHandlesResultHandlesresultHandles, DecodedDataStringsDecodedDataStringsDecodedDataStringsDecodedDataStringsDecodedDataStringsdecodedDataStrings.
These tuples will be empty, and the model will not be modified.
Note that during training, a possibly set timeout is ignored (see
set_data_code_2d_paramset_data_code_2d_paramSetDataCode2dParamset_data_code_2d_paramSetDataCode2dParamSetDataCode2dParam).
Functionality of the symbol search
Depending on the current settings of the 2D data code model (see
set_data_code_2d_paramset_data_code_2d_paramSetDataCode2dParamset_data_code_2d_paramSetDataCode2dParamSetDataCode2dParam), the operator
find_data_code_2dfind_data_code_2dFindDataCode2dfind_data_code_2dFindDataCode2dFindDataCode2d performs several passes for searching
the data code symbols.
The search starts at the highest pyramid level, where -
according to the maximum module size defined in the data code model
- the modules can be separated.
In addition, in every pyramid level the preprocessing can vary
depending on the presets for the module gap.
If the data code model enables dark symbols on a light background as
well as light symbols on a dark background, within the current pyramid
level, the dark symbols are searched first.
Then the passes for searching light symbols follow.
A pass consists of two phases: The search phase is used to
look for the finder patterns and to generate a symbol candidate for
every detected finder pattern, and the evaluation phase, where in a
lower pyramid level all candidates are investigated and - if
possible - read.
The operator call is either terminated after successfully decoding
the requested number of symbols, after processing all search passes,
or due to a timeout (see set_data_code_2d_paramset_data_code_2d_paramSetDataCode2dParamset_data_code_2d_paramSetDataCode2dParamSetDataCode2dParam). The
number of requested symbols can be specified via the generic
parameter GenParamNamesGenParamNamesGenParamNamesGenParamNamesGenParamNamesgenParamNames = 'stop_after_result_num'"stop_after_result_num""stop_after_result_num""stop_after_result_num""stop_after_result_num""stop_after_result_num".
Without specifying this number the search stops as soon as one
symbol could be decoded.
Query results of the symbol search
With the result handles and the operators
get_data_code_2d_resultsget_data_code_2d_resultsGetDataCode2dResultsget_data_code_2d_resultsGetDataCode2dResultsGetDataCode2dResults and
get_data_code_2d_objectsget_data_code_2d_objectsGetDataCode2dObjectsget_data_code_2d_objectsGetDataCode2dObjectsGetDataCode2dObjects, additional data can be requested
about the search process, e.g., the number of internal search passes
or the number of investigated candidates, and - together with
the ResultHandlesResultHandlesResultHandlesResultHandlesResultHandlesresultHandles - about the symbols, like the symbol
and module size, the contrast, or the raw data coded in the symbol.
In addition, these operators provide information about all
investigated candidates that could not be read.
In particular, this helps to determine if a candidate was actually
generated at the symbol's position during the preprocessing and
- by the value of a status variable - why the search or
reading was aborted.
Further information about the parameters can be found with the
operators get_data_code_2d_resultsget_data_code_2d_resultsGetDataCode2dResultsget_data_code_2d_resultsGetDataCode2dResultsGetDataCode2dResults and
get_data_code_2d_objectsget_data_code_2d_objectsGetDataCode2dObjectsget_data_code_2d_objectsGetDataCode2dObjectsGetDataCode2dObjects.
Timeout
With the operator set_data_code_2d_paramset_data_code_2d_paramSetDataCode2dParamset_data_code_2d_paramSetDataCode2dParamSetDataCode2dParam you can specify a
timeout for find_data_code_2dfind_data_code_2dFindDataCode2dfind_data_code_2dFindDataCode2dFindDataCode2d. If find_data_code_2dfind_data_code_2dFindDataCode2dfind_data_code_2dFindDataCode2dFindDataCode2d
reaches this timeout, it returns all intermediate results.
Whether a timeout occurred or not can be queried by calling
get_data_code_2d_resultsget_data_code_2d_resultsGetDataCode2dResultsget_data_code_2d_resultsGetDataCode2dResultsGetDataCode2dResults with the parameter
'timeout_occurred'"timeout_occurred""timeout_occurred""timeout_occurred""timeout_occurred""timeout_occurred".
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on internal data level.
XLD contours that surround the successfully decoded
data code symbols.
Handle of the 2D data code model.
Names of (optional) parameters for
controlling the behavior of the operator.
Default value: []
List of values: 'stop_after_result_num'"stop_after_result_num""stop_after_result_num""stop_after_result_num""stop_after_result_num""stop_after_result_num", 'train'"train""train""train""train""train"
Values of the optional generic parameters.
Default value: []
Suggested values: 'all'"all""all""all""all""all", 'model_type'"model_type""model_type""model_type""model_type""model_type", 'symbol_size'"symbol_size""symbol_size""symbol_size""symbol_size""symbol_size", 'version'"version""version""version""version""version", 'module_size'"module_size""module_size""module_size""module_size""module_size", 'small_modules_robustness'"small_modules_robustness""small_modules_robustness""small_modules_robustness""small_modules_robustness""small_modules_robustness", 'module_shape'"module_shape""module_shape""module_shape""module_shape""module_shape", 'polarity'"polarity""polarity""polarity""polarity""polarity", 'mirrored'"mirrored""mirrored""mirrored""mirrored""mirrored", 'contrast'"contrast""contrast""contrast""contrast""contrast", 'module_grid'"module_grid""module_grid""module_grid""module_grid""module_grid", 'finder_pattern_tolerance'"finder_pattern_tolerance""finder_pattern_tolerance""finder_pattern_tolerance""finder_pattern_tolerance""finder_pattern_tolerance", 'contrast_tolerance'"contrast_tolerance""contrast_tolerance""contrast_tolerance""contrast_tolerance""contrast_tolerance", 'image_proc'"image_proc""image_proc""image_proc""image_proc""image_proc", 1, 2, 3
Handles of all successfully decoded 2D data code
symbols.
Decoded data strings of all detected 2D data code
symbols in the image.
* Examples showing the use of find_data_code_2d.
* First, the operator is used to train the model, afterwards it is used to
* read the symbol in another image.
* Create a model for reading Data matrix ECC 200 codes
create_data_code_2d_model ('Data Matrix ECC 200', [], [], DataCodeHandle)
* Read a training image
read_image (Image, 'datacode/ecc200/ecc200_cpu_008')
* Train the model with the symbol in the image
find_data_code_2d (Image, SymbolXLDs, DataCodeHandle, 'train', 'all', \
ResultHandles, DecodedDataStrings)
*
* End of training / begin of normal application
*
* Read an image
read_image (Image, 'datacode/ecc200/ecc200_cpu_010')
* Read the symbol in the image
find_data_code_2d (Image, SymbolXLDs, DataCodeHandle, [], [], \
ResultHandles, DecodedDataStrings)
* Display all symbols, the strings encoded in them, and the module size
dev_set_color ('green')
for i := 0 to |ResultHandles| - 1 by 1
select_obj (SymbolXLDs, SymbolXLD, i+1)
dev_display (SymbolXLD)
get_contour_xld (SymbolXLD, Row, Col)
set_tposition (WindowHandle, max(Row), min(Col))
write_string (WindowHandle, DecodedDataStrings[i])
get_data_code_2d_results (DataCodeHandle, ResultHandles[i], \
['module_height','module_width'], ModuleSize)
new_line (WindowHandle)
write_string (WindowHandle, 'module size = ' + ModuleSize[0] + 'x' + \
ModuleSize[1])
endfor
* Clear the model
clear_data_code_2d_model (DataCodeHandle)
The operator find_data_code_2dfind_data_code_2dFindDataCode2dfind_data_code_2dFindDataCode2dFindDataCode2d returns the value 2 (H_MSG_TRUE)
if the given parameters are correct.
Otherwise, an exception is raised.
create_data_code_2d_modelcreate_data_code_2d_modelCreateDataCode2dModelcreate_data_code_2d_modelCreateDataCode2dModelCreateDataCode2dModel,
read_data_code_2d_modelread_data_code_2d_modelReadDataCode2dModelread_data_code_2d_modelReadDataCode2dModelReadDataCode2dModel,
set_data_code_2d_paramset_data_code_2d_paramSetDataCode2dParamset_data_code_2d_paramSetDataCode2dParamSetDataCode2dParam
get_data_code_2d_resultsget_data_code_2d_resultsGetDataCode2dResultsget_data_code_2d_resultsGetDataCode2dResultsGetDataCode2dResults,
get_data_code_2d_objectsget_data_code_2d_objectsGetDataCode2dObjectsget_data_code_2d_objectsGetDataCode2dObjectsGetDataCode2dObjects,
write_data_code_2d_modelwrite_data_code_2d_modelWriteDataCode2dModelwrite_data_code_2d_modelWriteDataCode2dModelWriteDataCode2dModel
create_data_code_2d_modelcreate_data_code_2d_modelCreateDataCode2dModelcreate_data_code_2d_modelCreateDataCode2dModelCreateDataCode2dModel,
set_data_code_2d_paramset_data_code_2d_paramSetDataCode2dParamset_data_code_2d_paramSetDataCode2dParamSetDataCode2dParam,
get_data_code_2d_resultsget_data_code_2d_resultsGetDataCode2dResultsget_data_code_2d_resultsGetDataCode2dResultsGetDataCode2dResults,
get_data_code_2d_objectsget_data_code_2d_objectsGetDataCode2dObjectsget_data_code_2d_objectsGetDataCode2dObjectsGetDataCode2dObjects
Data Code