ClassesClasses | | Operators

write_data_code_2d_modelwrite_data_code_2d_modelWriteDataCode2dModelWriteDataCode2dModel (Operator)

Name

write_data_code_2d_modelwrite_data_code_2d_modelWriteDataCode2dModelWriteDataCode2dModel — Writes a 2D data code model into a file.

Signature

write_data_code_2d_model( : : DataCodeHandle, FileName : )

Herror write_data_code_2d_model(const Hlong DataCodeHandle, const char* FileName)

Herror T_write_data_code_2d_model(const Htuple DataCodeHandle, const Htuple FileName)

void WriteDataCode2dModel(const HTuple& DataCodeHandle, const HTuple& FileName)

void HDataCode2D::WriteDataCode2dModel(const HString& FileName) const

void HDataCode2D::WriteDataCode2dModel(const char* FileName) const

static void HOperatorSet.WriteDataCode2dModel(HTuple dataCodeHandle, HTuple fileName)

void HDataCode2D.WriteDataCode2dModel(string fileName)

Description

The operator write_data_code_2d_modelwrite_data_code_2d_modelWriteDataCode2dModelWriteDataCode2dModelWriteDataCode2dModel writes a 2D data code model, which was created by create_data_code_2d_modelcreate_data_code_2d_modelCreateDataCode2dModelCreateDataCode2dModelCreateDataCode2dModel, into a file with the name FileNameFileNameFileNameFileNamefileName. This facilitates creating an identical copy of the saved model in a later session with the operator read_data_code_2d_modelread_data_code_2d_modelReadDataCode2dModelReadDataCode2dModelReadDataCode2dModel. The default HALCON file extension for the 2D data code model is 'dcm'. The handle of the model to write is passed in DataCodeHandleDataCodeHandleDataCodeHandleDataCodeHandledataCodeHandle.

For an explanation of the concept of the 2D data code reader see the introduction of chapter Identification / Data Code.

Execution Information

Parameters

DataCodeHandleDataCodeHandleDataCodeHandleDataCodeHandledataCodeHandle (input_control)  datacode_2d HDataCode2D, HTupleHTupleHtuple (integer) (IntPtr) (Hlong) (Hlong)

Handle of the 2D data code model.

FileNameFileNameFileNameFileNamefileName (input_control)  filename.write HTupleHTupleHtuple (string) (string) (HString) (char*)

Name of the 2D data code model file.

Default value: 'data_code_model.dcm' "data_code_model.dcm" "data_code_model.dcm" "data_code_model.dcm" "data_code_model.dcm"

File extension: .dcm

Example (HDevelop)

* This example demonstrates how a trained model can be saved for
* a future session

* 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)
* Write the model into a file
write_data_code_2d_model (DataCodeHandle, 'ecc200_trained_model.dcm')
* Clear the model
clear_data_code_2d_model (DataCodeHandle)

Result

The operator write_data_code_2d_modelwrite_data_code_2d_modelWriteDataCode2dModelWriteDataCode2dModelWriteDataCode2dModel returns the value 2 (H_MSG_TRUE) if the passed handle is valid and if the model can be written into the named file. Otherwise, an exception is raised.

Possible Predecessors

set_data_code_2d_paramset_data_code_2d_paramSetDataCode2dParamSetDataCode2dParamSetDataCode2dParam, find_data_code_2dfind_data_code_2dFindDataCode2dFindDataCode2dFindDataCode2d

Alternatives

get_data_code_2d_paramget_data_code_2d_paramGetDataCode2dParamGetDataCode2dParamGetDataCode2dParam

See also

create_data_code_2d_modelcreate_data_code_2d_modelCreateDataCode2dModelCreateDataCode2dModelCreateDataCode2dModel, set_data_code_2d_paramset_data_code_2d_paramSetDataCode2dParamSetDataCode2dParamSetDataCode2dParam, find_data_code_2dfind_data_code_2dFindDataCode2dFindDataCode2dFindDataCode2d

Module

Data Code


ClassesClasses | | Operators