Read binary images or HALCON regions.
The operator read_region reads regions from a binary file. The data is stored in packed form.
Tiff: Binary Tiff images with extension 'tiff' or 'tif'. The result is always one region. The color black is used as foreground. BMP: Binary Windows bitmap images with extension 'bmp'. The result is always one region. The color black is used as foreground. HALCON regions: File format of HALCON for regions. Several images can be stored (in one file) or read simultaneously via the operators write_region and read_region. All region files have the extension '.reg', which is not indicated when reading or writing the file. A search path ('image_dir') can be defined analogous to the operator read_image.
The clipping based on the current image format is set via the operator set_system('clip_region',<'true'/'false'>). Consequently, if no image of suffcient size has been created before the call to read_region, set_system('clip_region','false') should be called before calling read_region to ensure that the region is not being clipped.
|
Region (output_object) |
region(-array) -> object |
| Read region. | |
|
FileName (input_control) |
filename -> string |
| Name of the region to be read. | |
/* Reading of regions and giving them gray values. */ read_image(Img,'bild_test5') read_region(Regs,'reg_test5') reduce_domain(Img,Regs,Res)
If the parameter values are correct the operator read_region returns the value 2 (H_MSG_TRUE). If the file cannot be opened 5 (H_MSG_FAIL) is returned. Otherwise an exception handling is raised.
read_region is reentrant and processed without parallelization.
Foundation