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

paint_xldpaint_xldpaint_xldPaintXldPaintXld (Operator)

Name

paint_xldpaint_xldpaint_xldPaintXldPaintXld — Paint XLD objects into an image.

Signature

paint_xld(XLD, Image : ImageResult : Grayval : )

Herror paint_xld(const Hobject XLD, const Hobject Image, Hobject* ImageResult, double Grayval)

Herror T_paint_xld(const Hobject XLD, const Hobject Image, Hobject* ImageResult, const Htuple Grayval)

Herror paint_xld(Hobject XLD, Hobject Image, Hobject* ImageResult, const HTuple& Grayval)

HImage HXLD::PaintXld(const HImage& Image, const HTuple& Grayval) const

HImage HXLDArray::PaintXld(const HImage& Image, const HTuple& Grayval) const

void HOperatorSetX.PaintXld(
[in] IHUntypedObjectX* XLD, [in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*ImageResult, [in] VARIANT Grayval)

IHImageX* HImageX.PaintXld(
[in] IHXLDX* XLD, [in] VARIANT Grayval)

IHImageX* HXLDX.PaintXld(
[in] IHImageX* Image, [in] VARIANT Grayval)

IHImageX* HXLDContX.PaintXld(
[in] IHImageX* Image, [in] VARIANT Grayval)

IHImageX* HXLDPolyX.PaintXld(
[in] IHImageX* Image, [in] VARIANT Grayval)

IHImageX* HXLDParaX.PaintXld(
[in] IHImageX* Image, [in] VARIANT Grayval)

IHImageX* HXLDModParaX.PaintXld(
[in] IHImageX* Image, [in] VARIANT Grayval)

IHImageX* HXLDExtParaX.PaintXld(
[in] IHImageX* Image, [in] VARIANT Grayval)

static void HOperatorSet.PaintXld(HObject XLD, HObject image, out HObject imageResult, HTuple grayval)

HImage HImage.PaintXld(HXLD XLD, HTuple grayval)

HImage HImage.PaintXld(HXLD XLD, double grayval)

HImage HXLD.PaintXld(HImage image, HTuple grayval)

HImage HXLD.PaintXld(HImage image, double grayval)

Description

paint_xldpaint_xldpaint_xldPaintXldPaintXld paints the XLD objects XLDXLDXLDXLDXLD of type contour or polygon with the constant gray values GrayvalGrayvalGrayvalGrayvalgrayval into each channel of the background image given in ImageImageImageImageimage and returns the result in ImageResultImageResultImageResultImageResultimageResult. Open contours of XLD objects are closed and their enclosed regions are filled up. The rim of the subpixel XLD objects is painted onto the background image using anti-aliasing. Note that only objects without crossings or touching segments are painted correctly.

GrayvalGrayvalGrayvalGrayvalgrayval contains the gray values for painting the XLD objects. These gray values can either be specified for each channel once, valid for all XLD objects, or for each XLD object separately. To define the latter, group the channel gray values g of each XLD object and concatenate them to a tuple according to the order of the XLD objects, e.g., for a three channel image:

  [g(channel1,xld1), g(channel2,xld1), g(channel3,xld1), g(channel1,xld2), ... ].

Parallelization

Parameters

XLDXLDXLDXLDXLD (input_object)  xld(-array) objectHXLDHXLDHXLDXHobject

XLD objects to be painted into the input image.

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

Image in which the xld objects are to be painted.

ImageResultImageResultImageResultImageResultimageResult (output_object)  image objectHImageHImageHImageXHobject * (byte / direction / cyclic / int1 / int2 / uint2 / int4 / 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 value of the xld object.

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

Example (HDevelop)

* Paint colored xld objects into a gray image

* read and copy image to generate a three channel image
read_image(Image1,'green-dot')
copy_image(Image1,Image2)
copy_image(Image1,Image3)
compose3(Image1,Image2,Image3,Image)
* extract subpixel border
threshold_sub_pix(Image1,Border,128)
* select the circle and the arrows
select_obj(Border,circle,14)
select_obj(Border,arrows,16)
concat_obj(circle,arrows,green_dot)
* paint a green circle and white arrows (to paint all
* objects e.g. blue, pass [0,0,255] tuple for GrayVal)
paint_xld(green_dot,Image,ImageResult,[0,255,0,255,255,255])

Example (C)

/* Paint colored xld objects into a gray image */

/* read and copy image to generate a three channel image */
read_image(&Image1,"green-dot");
copy_image(Image1,&Image2);
copy_image(Image1,&Image3);
compose3(Image1,Image2,Image3,&Image);
/* extract subpixel border */
threshold_sub_pix(Image1,&Border,128);
/* select the circle and the arrows */
select_obj(Border,&circle,14);
select_obj(Border,&arrows,16);
concat_obj(circle,arrows,&green_dot);
/* paint a green circle and white arrows,
 * therefore define tuple grayval:=[0,255,0,255,255,255].
 * (to paint all objects e.g. blue define grayval:=[0,0,255]) */
T_paint_xld(green_dot,Image,&ImageResult,grayval);

Example (HDevelop)

* Paint colored xld objects into a gray image

* read and copy image to generate a three channel image
read_image(Image1,'green-dot')
copy_image(Image1,Image2)
copy_image(Image1,Image3)
compose3(Image1,Image2,Image3,Image)
* extract subpixel border
threshold_sub_pix(Image1,Border,128)
* select the circle and the arrows
select_obj(Border,circle,14)
select_obj(Border,arrows,16)
concat_obj(circle,arrows,green_dot)
* paint a green circle and white arrows (to paint all
* objects e.g. blue, pass [0,0,255] tuple for GrayVal)
paint_xld(green_dot,Image,ImageResult,[0,255,0,255,255,255])

Example (HDevelop)

* Paint colored xld objects into a gray image

* read and copy image to generate a three channel image
read_image(Image1,'green-dot')
copy_image(Image1,Image2)
copy_image(Image1,Image3)
compose3(Image1,Image2,Image3,Image)
* extract subpixel border
threshold_sub_pix(Image1,Border,128)
* select the circle and the arrows
select_obj(Border,circle,14)
select_obj(Border,arrows,16)
concat_obj(circle,arrows,green_dot)
* paint a green circle and white arrows (to paint all
* objects e.g. blue, pass [0,0,255] tuple for GrayVal)
paint_xld(green_dot,Image,ImageResult,[0,255,0,255,255,255])

Example (HDevelop)

* Paint colored xld objects into a gray image

* read and copy image to generate a three channel image
read_image(Image1,'green-dot')
copy_image(Image1,Image2)
copy_image(Image1,Image3)
compose3(Image1,Image2,Image3,Image)
* extract subpixel border
threshold_sub_pix(Image1,Border,128)
* select the circle and the arrows
select_obj(Border,circle,14)
select_obj(Border,arrows,16)
concat_obj(circle,arrows,green_dot)
* paint a green circle and white arrows (to paint all
* objects e.g. blue, pass [0,0,255] tuple for GrayVal)
paint_xld(green_dot,Image,ImageResult,[0,255,0,255,255,255])

Result

paint_xldpaint_xldpaint_xldPaintXldPaintXld 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, gen_contour_polygon_xldgen_contour_polygon_xldgen_contour_polygon_xldGenContourPolygonXldGenContourPolygonXld, threshold_sub_pixthreshold_sub_pixthreshold_sub_pixThresholdSubPixThresholdSubPix

Alternatives

set_grayvalset_grayvalset_grayvalSetGrayvalSetGrayval, paint_graypaint_graypaint_grayPaintGrayPaintGray, paint_regionpaint_regionpaint_regionPaintRegionPaintRegion

See also

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