HALCON Reference Manual 10.0.2
Table of Contents / Image / Manipulation ClassesClassesClasses | | | Operators

paint_regionpaint_regionpaint_regionPaintRegionPaintRegion (Operator)

Name

paint_regionpaint_regionpaint_regionPaintRegionPaintRegion — Paint regions into an image.

Signature

paint_region(Region, Image : ImageResult : Grayval, Type : )

Herror paint_region(const Hobject Region, const Hobject Image, Hobject* ImageResult, double Grayval, const char* Type)

Herror T_paint_region(const Hobject Region, const Hobject Image, Hobject* ImageResult, const Htuple Grayval, const Htuple Type)

Herror paint_region(Hobject Region, Hobject Image, Hobject* ImageResult, const HTuple& Grayval, const HTuple& Type)

HImage HRegion::PaintRegion(const HImage& Image, const HTuple& Grayval, const HTuple& Type) const

HImage HRegionArray::PaintRegion(const HImage& Image, const HTuple& Grayval, const HTuple& Type) const

void HOperatorSetX.PaintRegion(
[in] IHUntypedObjectX* Region, [in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*ImageResult, [in] VARIANT Grayval, [in] VARIANT Type)

IHImageX* HImageX.PaintRegion(
[in] IHRegionX* Region, [in] VARIANT Grayval, [in] BSTR Type)

IHImageX* HRegionX.PaintRegion(
[in] IHImageX* Image, [in] VARIANT Grayval, [in] BSTR Type)

static void HOperatorSet.PaintRegion(HObject region, HObject image, out HObject imageResult, HTuple grayval, HTuple type)

HImage HImage.PaintRegion(HRegion region, HTuple grayval, string type)

HImage HImage.PaintRegion(HRegion region, double grayval, string type)

HImage HRegion.PaintRegion(HImage image, HTuple grayval, string type)

HImage HRegion.PaintRegion(HImage image, double grayval, string type)

Description

paint_regionpaint_regionpaint_regionPaintRegionPaintRegion paints the regions given in RegionRegionRegionRegionregion with a constant gray value into the image given in ImageImageImageImageimage and returns the result in ImageResultImageResultImageResultImageResultimageResult. These gray values can either be specified for each channel once, valid for all regions, or for each region separately. To define the latter, group the channel gray values g of each region and concatenate them to a tuple according to the regions' order, e.g., for a three channel image:

  [g(channel1,region1), g(channel2,region1), g(channel3,region1), g(channel1,region2), ... ].

The parameter TypeTypeTypeTypetype determines whether the region should be painted filled ('fill'"fill""fill""fill""fill") or whether only its boundary should be painted ('margin'"margin""margin""margin""margin").

As an alternative to paint_regionpaint_regionpaint_regionPaintRegionPaintRegion, you can use the operator overpaint_regionoverpaint_regionoverpaint_regionOverpaintRegionOverpaintRegion, which directly paints the regions into ImageImageImageImageimage.

Parallelization

Parameters

RegionRegionRegionRegionregion (input_object)  region(-array) objectHRegionHRegionHRegionXHobject

Regions to be painted into the input image.

ImageImageImageImageimage (input_object)  image objectHImageHImageHImageXHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex)

Image in which the regions are to be painted.

ImageResultImageResultImageResultImageResultimageResult (output_object)  image objectHImageHImageHImageXHobject * (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex)

Image containing the result.

GrayvalGrayvalGrayvalGrayvalgrayval (input_control)  number(-array) HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

Desired gray values of the regions.

Default value: 255.0

Suggested values: 0.0, 1.0, 2.0, 5.0, 10.0, 16.0, 32.0, 64.0, 128.0, 253.0, 254.0, 255.0

TypeTypeTypeTypetype (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Paint regions filled or as boundaries.

Default value: 'fill' "fill" "fill" "fill" "fill"

List of values: 'fill'"fill""fill""fill""fill", 'margin'"margin""margin""margin""margin"

Example (HDevelop)

* Paint a rectangle into the image 'monkey'

read_image(Image,'monkey')
gen_rectangle1(Rectangle,100.0,100.0,300.0,300.0)
* paint a white rectangle
paint_region(Rectangle,Image,ImageResult,255.0,'fill')

Example (C)

/* Paint a rectangle into the image 'monkey'  */

read_image(&Image,"monkey");
gen_rectangle1(&Rectangle,100.0,100.0,300.0,300.0);
/* paint a white rectangle */
paint_region(Rectangle,Image,&ImageResult,255.0,"fill");

Example (HDevelop)

* Paint a rectangle into the image 'monkey'

read_image(Image,'monkey')
gen_rectangle1(Rectangle,100.0,100.0,300.0,300.0)
* paint a white rectangle
paint_region(Rectangle,Image,ImageResult,255.0,'fill')

Example (HDevelop)

* Paint a rectangle into the image 'monkey'

read_image(Image,'monkey')
gen_rectangle1(Rectangle,100.0,100.0,300.0,300.0)
* paint a white rectangle
paint_region(Rectangle,Image,ImageResult,255.0,'fill')

Example (HDevelop)

* Paint a rectangle into the image 'monkey'

read_image(Image,'monkey')
gen_rectangle1(Rectangle,100.0,100.0,300.0,300.0)
* paint a white rectangle
paint_region(Rectangle,Image,ImageResult,255.0,'fill')

Result

paint_regionpaint_regionpaint_regionPaintRegionPaintRegion returns 2 (H_MSG_TRUE) if all parameters are correct. If the input is empty the behavior can be set via set_system(::'no_object_result',<Result>:)set_system("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary, an exception is raised.

Possible Predecessors

read_imageread_imageread_imageReadImageReadImage, gen_image_constgen_image_constgen_image_constGenImageConstGenImageConst, gen_image_protogen_image_protogen_image_protoGenImageProtoGenImageProto, reduce_domainreduce_domainreduce_domainReduceDomainReduceDomain

Alternatives

set_grayvalset_grayvalset_grayvalSetGrayvalSetGrayval, overpaint_regionoverpaint_regionoverpaint_regionOverpaintRegionOverpaintRegion, paint_xldpaint_xldpaint_xldPaintXldPaintXld

See also

reduce_domainreduce_domainreduce_domainReduceDomainReduceDomain, paint_graypaint_graypaint_grayPaintGrayPaintGray, overpaint_grayoverpaint_grayoverpaint_grayOverpaintGrayOverpaintGray, set_drawset_drawset_drawSetDrawSetDraw, gen_image_constgen_image_constgen_image_constGenImageConstGenImageConst

Module

Foundation


Table of Contents / Image / Manipulation ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH