read_data_code_2d_model ( : : FileName : DataCodeHandle )

Read a 2D data code model from a file and create a new model.

The operator read_data_code_2d_model reads the 2D data code model file FileName and creates a new model that is an identical copy of the saved model. The parameter DataCodeHandle returns the handle of the new model. The model file FileName must be created by the operator write_data_code_2d_model.


Parameters

FileName (input_control)
string -> string
Name of the 2D data code model file.
Default value: 'data_code_model.dcm'

DataCodeHandle (output_control)
datacode_2d -> integer
Handle of the created 2D data code model.


Example
* This example demonstrates how a model that was saved in an earlier
* session can be used again by reading the model file

* Create a model by reading by reading a data code model file
read_data_code_2d_model ('ecc200_trained_model.dcm', DataCodeHandle)
* Read a symbol image
read_image (Image, 'datacode/ecc200/ecc200_cpu_010')
* Read the symbol in the image
find_data_code_2d (Image, SymbolXLDs, DataCodeHandle, [], [],
                   ResultHandles, DecodedDataStrings)
* Clear the model
clear_data_code_2d_model (DataCodeHandle)

Result

The operator read_data_code_2d_model returns the value 2 (H_MSG_TRUE) if the named 2D data code file was found and correctly read. Otherwise, an exception will be raised.


Parallelization Information

read_data_code_2d_model is processed completely exclusively without parallelization.


Possible Successors

find_data_code_2d


Alternatives

create_data_code_2d_model


See also

write_data_code_2d_model, clear_data_code_2d_model, clear_all_data_code_2d_models


Module

Data Code



Copyright © 1996-2008 MVTec Software GmbH