Skip to content

write_objectWriteObjectWriteObjectwrite_objectwrite_objectπŸ”—

Short descriptionπŸ”—

write_objectWriteObjectWriteObjectwrite_objectwrite_object β€” Write an iconic object.

SignatureπŸ”—

write_object( object Object, filename FileName )void WriteObject( const HObject& Object, const HTuple& FileName )static void HOperatorSet.WriteObject( HObject objectVal, HTuple fileName )def write_object( object: HObject, file_name: str ) -> None

Herror write_object( const Hobject Object, const char* FileName )

Herror T_write_object( const Hobject Object, const Htuple FileName )

void HObject::WriteObject( const HString& FileName ) const

void HObject::WriteObject( const char* FileName ) const

void HObject::WriteObject( const wchar_t* FileName ) const (Windows only)

void HObject.WriteObject( string fileName )

DescriptionπŸ”—

write_objectWriteObject writes the iconic ObjectobjectValobject to the file FileNamefileNamefile_name. The iconic object is a (possibly mixed) tuple of images, regions, or XLDs. If no extension is specified in FileNamefileNamefile_name, the extension '.hobj' will be appended. The iconic data is written in the HALCON Iconic Object format described below.

  • HALCON Iconic Object (HOBJ): HOBJ is a binary file format, which provides the functionality to write and read all kinds of iconic HALCON objects (images, regions, and XLDs). Since data is written with neither compression nor conversion, writing this file format is faster than other supported file formats in most circumstances. Hence, if an application needs to read and write all kinds of iconic HALCON objects as fast as possible and no compression is required, this format should be used. The default file extension for this file format is '.hobj'. For images, all HALCON pixel types can be written. Multi-channel images are supported. The channels can have mixed pixel types but must have the same width and height. The domain of an image and it’s creation date are stored in the file as well. An object tuple is written into a single file.

Execution informationπŸ”—

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πŸ”—

ObjectobjectValobject (input_object) object(-array) β†’ objectHObjectHObjectHObjectHobject

Iconic object.

FileNamefileNamefile_name (input_control) filename β†’ (string)HTuple (HString)HTuple (string)strHtuple (char*)

Name of file.

File extension: .hobj

ResultπŸ”—

If the parameters are valid, the operator write_objectWriteObject returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible successors

read_objectReadObject, read_imageReadImage

See also

read_objectReadObject, write_imageWriteImage, read_imageReadImage, write_regionWriteRegion, read_regionReadRegion

ModuleπŸ”—

Foundation