Herror ::read_region (
    Hobject *Region,
    const HTuple &FileName
)
HRegion HRegion::ReadRegion (
    const HTuple &FileName
)
HRegionArray HRegionArray::ReadRegion (
    const HTuple &FileName
)

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.
 HALCONregions:

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.


Parameters

Region (output_object)
region(-array) -> Hobject * : HRegion(Array)

FileName (input_control)
filename -> HTuple.char *


Example
/* Reading of regions and giving them gray values. */
  read_image(&Img,"bild_test5") ;
  read_region(&Regs,"reg_test5") ;
  reduce_domain(Img,Regs,&Res) ;

Result

If the parameter values are correct the operator ::read_region returns the value H_MSG_TRUE. If the file cannot be opened H_MSG_FAIL is returned. Otherwise an exception handling is raised.


Possible Predecessors

::read_image


Possible Successors

::reduce_domain, ::disp_region


See also

::write_region, ::read_image


Module

Image / region / XLD management



Copyright © 1996-2002 MVTec Software GmbH