Operator Reference

write_templateT_write_templateWriteTemplateWriteTemplatewrite_template (Operator)

write_templateT_write_templateWriteTemplateWriteTemplatewrite_template — Writing a template to file.

Warning

write_templatewrite_templateWriteTemplateWriteTemplatewrite_template is obsolete and is only provided for reasons of backward compatibility. The operator will be removed with HALCON 25.11. New applications should use the shape-based or NCC-based operators instead.

Signature

write_template( : : TemplateID, FileName : )

Herror T_write_template(const Htuple TemplateID, const Htuple FileName)

void WriteTemplate(const HTuple& TemplateID, const HTuple& FileName)

void HTemplate::WriteTemplate(const HString& FileName) const

void HTemplate::WriteTemplate(const char* FileName) const

void HTemplate::WriteTemplate(const wchar_t* FileName) const   ( Windows only)

static void HOperatorSet.WriteTemplate(HTuple templateID, HTuple fileName)

void HTemplate.WriteTemplate(string fileName)

def write_template(template_id: HHandle, file_name: str) -> None

Description

The operator write_templatewrite_templateWriteTemplateWriteTemplatewrite_template writes a matching template to file which can be read again with read_templateread_templateReadTemplateReadTemplateread_template. The default HALCON file extension for a template is 'gvt'.

Execution Information

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Processed without parallelization.

Parameters

TemplateIDTemplateIDTemplateIDtemplateIDtemplate_id (input_control)  template HTemplate, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Template number.

FileNameFileNameFileNamefileNamefile_name (input_control)  filename.write HTuplestrHTupleHtuple (string) (string) (HString) (char*)

file name.

File extension: .gvt

Result

If the file name is valid (permission to write), the operator write_templatewrite_templateWriteTemplateWriteTemplatewrite_template returns the value 2 ( H_MSG_TRUE) . If necessary an exception is raised.

Possible Predecessors

create_templatecreate_templateCreateTemplateCreateTemplatecreate_template, create_template_rotcreate_template_rotCreateTemplateRotCreateTemplateRotcreate_template_rot

Module

Matching