ClassesClassesClassesClasses | | | | Operators

read_regionread_regionReadRegionread_regionReadRegionReadRegion (Operator)

Name

read_regionread_regionReadRegionread_regionReadRegionReadRegion — Read binary images or HALCON regions.

Signature

read_region( : Region : FileName : )

Herror read_region(Hobject* Region, const char* FileName)

Herror T_read_region(Hobject* Region, const Htuple FileName)

Herror read_region(Hobject* Region, const HTuple& FileName)

HRegion HRegion::ReadRegion(const HTuple& FileName)

HRegionArray HRegionArray::ReadRegion(const HTuple& FileName)

void ReadRegion(HObject* Region, const HTuple& FileName)

void HRegion::ReadRegion(const HString& FileName)

void HRegion::ReadRegion(const char* FileName)

void HOperatorSetX.ReadRegion(
[out] IHUntypedObjectX*Region, [in] VARIANT FileName)

void HRegionX.ReadRegion([in] BSTR FileName)

static void HOperatorSet.ReadRegion(out HObject region, HTuple fileName)

void HRegion.ReadRegion(string fileName)

Description

The operator read_regionread_regionReadRegionread_regionReadRegionReadRegion reads regions from a binary file. The data is stored in packed form.

Tiff:

Binary Tiff images with extension 'tiff'"tiff""tiff""tiff""tiff""tiff" or 'tif'"tif""tif""tif""tif""tif". A tiff image can contain any number of regions. The color white is used as foreground.

PNG:

Binary PNG images with extension 'png'"png""png""png""png""png". The result is always one region. The color white is used as foreground.

BMP:

Binary Windows bitmap images with extension 'bmp'"bmp""bmp""bmp""bmp""bmp". The result is always one region. The color white 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_regionwrite_regionWriteRegionwrite_regionWriteRegionWriteRegion and read_regionread_regionReadRegionread_regionReadRegionReadRegion. All region files have the extension '.reg', which is not indicated when reading or writing the file.

A search path ('image_dir'"image_dir""image_dir""image_dir""image_dir""image_dir") can be defined analogous to the operator read_imageread_imageReadImageread_imageReadImageReadImage.

Attention

The clipping based on the current image format is set via the operator set_system('clip_region',<'true'/'false'>)set_system("clip_region",<"true"/"false">)SetSystem("clip_region",<"true"/"false">)set_system("clip_region",<"true"/"false">)SetSystem("clip_region",<"true"/"false">)SetSystem("clip_region",<"true"/"false">). Consequently, if no image of suffcient size has been created before the call to read_regionread_regionReadRegionread_regionReadRegionReadRegion, set_system('clip_region','false')set_system("clip_region","false")SetSystem("clip_region","false")set_system("clip_region","false")SetSystem("clip_region","false")SetSystem("clip_region","false") should be called before calling read_regionread_regionReadRegionread_regionReadRegionReadRegion to ensure that the region is not being clipped.

Parallelization

Parameters

RegionRegionRegionRegionRegionregion (output_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject *

Read region.

FileNameFileNameFileNameFileNameFileNamefileName (input_control)  filename.read HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Name of the region to be read.

File extension: .reg, .tif, .tiff, .png, .bmp

Example (HDevelop)

* Reading of regions and giving them gray values.
  read_image(Img,'ima_test')
  read_region(Regs,'reg_test')
  reduce_domain(Img,Regs,Res)

Example (C)

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

Example (HDevelop)

* Reading of regions and giving them gray values.
  read_image(Img,'ima_test')
  read_region(Regs,'reg_test')
  reduce_domain(Img,Regs,Res)

Example (HDevelop)

* Reading of regions and giving them gray values.
  read_image(Img,'ima_test')
  read_region(Regs,'reg_test')
  reduce_domain(Img,Regs,Res)

Example (HDevelop)

* Reading of regions and giving them gray values.
  read_image(Img,'ima_test')
  read_region(Regs,'reg_test')
  reduce_domain(Img,Regs,Res)

Example (HDevelop)

* Reading of regions and giving them gray values.
  read_image(Img,'ima_test')
  read_region(Regs,'reg_test')
  reduce_domain(Img,Regs,Res)

Result

If the parameter values are correct the operator read_regionread_regionReadRegionread_regionReadRegionReadRegion returns the value 2 (H_MSG_TRUE). Otherwise an exception is raised.

Possible Predecessors

read_imageread_imageReadImageread_imageReadImageReadImage

Possible Successors

reduce_domainreduce_domainReduceDomainreduce_domainReduceDomainReduceDomain, disp_regiondisp_regionDispRegiondisp_regionDispRegionDispRegion

See also

write_regionwrite_regionWriteRegionwrite_regionWriteRegionWriteRegion, read_imageread_imageReadImageread_imageReadImageReadImage

Module

Foundation


ClassesClassesClassesClasses | | | | Operators