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

gen_image_constgen_image_constgen_image_constGenImageConstGenImageConst (Operator)

Name

gen_image_constgen_image_constgen_image_constGenImageConstGenImageConst — Create an image with constant gray value.

Signature

gen_image_const( : Image : Type, Width, Height : )

Herror gen_image_const(Hobject* Image, const char* Type, const Hlong Width, const Hlong Height)

Herror T_gen_image_const(Hobject* Image, const Htuple Type, const Htuple Width, const Htuple Height)

Herror gen_image_const(Hobject* Image, const HTuple& Type, const HTuple& Width, const HTuple& Height)

HImage HImage::GenImageConst(const HTuple& Type, const HTuple& Width, const HTuple& Height)

void HOperatorSetX.GenImageConst(
[out] IHUntypedObjectX*Image, [in] VARIANT Type, [in] VARIANT Width, [in] VARIANT Height)

void HImageX.GenImageConst(
[in] BSTR Type, [in] Hlong Width, [in] Hlong Height)

static void HOperatorSet.GenImageConst(out HObject image, HTuple type, HTuple width, HTuple height)

public HImage(string type, int width, int height)

void HImage.GenImageConst(string type, int width, int height)

Description

The operator gen_image_constgen_image_constgen_image_constGenImageConstGenImageConst creates an image of the indicated size. The height and width of the image are determined by HeightHeightHeightHeightheight and WidthWidthWidthWidthwidth. HALCON supports the following image types:

'byte':

1 byte per pixel, (0..255)

'int1':

1 byte per pixel, signed

'int2':

2 bytes per pixel, signed

'uint2':

2 bytes per pixel, unsigned

'int4':

4 bytes per pixel, signed

'int8':

8 bytes per pixel, signed, available on 64 bit systems only)

'real':

4 bytes per pixel, floating point

'complex'

two matrices of the type 'real'"real""real""real""real"

'vector_field':

two matrices of type 'real'"real""real""real""real"

'dir':

1 byte per pixel (0..180)

'cyclic':

1 byte per pixel; cyclic arithmetics (0..255).

The default value 0 is set via the operator set_system('init_new_image',<'true'/'false'>)set_system("init_new_image",<"true"/"false">)set_system("init_new_image",<"true"/"false">)SetSystem("init_new_image",<"true"/"false">)SetSystem("init_new_image",<"true"/"false">).

Parallelization

Parameters

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

Created image with new image matrix.

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

Pixel type.

Default value: 'byte' "byte" "byte" "byte" "byte"

List of values: 'byte'"byte""byte""byte""byte", 'direction'"direction""direction""direction""direction", 'cyclic'"cyclic""cyclic""cyclic""cyclic", 'int1'"int1""int1""int1""int1", 'int2'"int2""int2""int2""int2", 'uint2'"uint2""uint2""uint2""uint2", 'int4'"int4""int4""int4""int4", 'int8'"int8""int8""int8""int8", 'real'"real""real""real""real", 'complex'"complex""complex""complex""complex", 'vector_field'"vector_field""vector_field""vector_field""vector_field"

WidthWidthWidthWidthwidth (input_control)  extent.x HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Width of image.

Default value: 512

Suggested values: 128, 256, 512, 1024

Typical range of values: 1 ≤ Width Width Width Width width ≤ 512 (lin)

Minimum increment: 1

Recommended increment: 10

Restriction: Width >= 1

HeightHeightHeightHeightheight (input_control)  extent.y HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Height of image.

Default value: 512

Suggested values: 128, 256, 512, 1024

Typical range of values: 1 ≤ Height Height Height Height height ≤ 512 (lin)

Minimum increment: 1

Recommended increment: 10

Restriction: Height >= 1

Example (C)

gen_image_const(&New,"byte",width,height);
get_image_pointer1(New,(long*)&pointer,type,&width,&height);
for (row=0; row<height-1; row++)
  for (col=0; col<width-1; col++)
    pointer[row*width+col] = (row + col) % 256;

Result

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

Possible Successors

paint_regionpaint_regionpaint_regionPaintRegionPaintRegion, reduce_domainreduce_domainreduce_domainReduceDomainReduceDomain, get_image_pointer1get_image_pointer1get_image_pointer1GetImagePointer1GetImagePointer1, copy_objcopy_objcopy_objCopyObjCopyObj

Alternatives

gen_image1gen_image1gen_image1GenImage1GenImage1, gen_image3gen_image3gen_image3GenImage3GenImage3

See also

reduce_domainreduce_domainreduce_domainReduceDomainReduceDomain, paint_graypaint_graypaint_grayPaintGrayPaintGray, paint_regionpaint_regionpaint_regionPaintRegionPaintRegion, set_grayvalset_grayvalset_grayvalSetGrayvalSetGrayval, get_image_pointer1get_image_pointer1get_image_pointer1GetImagePointer1GetImagePointer1

Module

Foundation


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