write_region — Write regions to a file.
The operator write_region writes the regions in Region into a binary file. The regions can be written in the HALCON Iconic Object format (HOBJ), as TIFF files or as HALCON region files. The format is selected via the file name extension of FileName. If no extension is specified or if the file extension is '.hobj', the regions are stored in the HOBJ format. If no extension is specified in FileName, the extension '.hobj' will be appended. See write_object for more information about the HOBJ format. If the extension '.tif' or '.tiff' is specified, the regions are stored as TIFF files. If the extension '.reg' is specified, the regions are stored as a HALCON region file. The HALCON region file format is now legacy and the file format HOBJ should be used instead unless the files must be readable with HALCON versions older than 12.0. Iconic object tuples with an arbitrary number of regions can be written. The output data can be read via the operator read_region.
Region of the images which are returned.
Name of region file.
Default value: 'region.hobj'
File extension: .hobj, .reg, .tif, .tiff
If the parameter values are correct the operator write_region returns the value 2 (H_MSG_TRUE). Otherwise an exception handling is raised.
open_window, read_image, read_region, read_object, threshold, regiongrowing