gen_image_constgen_image_constGenImageConstGenImageConstgen_image_const (Operator)

Name

gen_image_constgen_image_constGenImageConstGenImageConstgen_image_const — Erzeugen eines Bildes mit konstantem Grauwert.

Signatur

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)

void GenImageConst(HObject* Image, const HTuple& Type, const HTuple& Width, const HTuple& Height)

void HImage::HImage(const HString& Type, Hlong Width, Hlong Height)

void HImage::HImage(const char* Type, Hlong Width, Hlong Height)

void HImage::HImage(const wchar_t* Type, Hlong Width, Hlong Height)   (Nur Windows)

void HImage::GenImageConst(const HString& Type, Hlong Width, Hlong Height)

void HImage::GenImageConst(const char* Type, Hlong Width, Hlong Height)

void HImage::GenImageConst(const wchar_t* Type, Hlong Width, Hlong Height)   (Nur Windows)

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)

def gen_image_const(type: str, width: int, height: int) -> HObject

Beschreibung

gen_image_constgen_image_constGenImageConstGenImageConstGenImageConstgen_image_const erzeugt ein Bild in der angegebenen Größe. Die Breite und Höhe des Bildes wird mit WidthWidthWidthWidthwidthwidth und HeightHeightHeightHeightheightheight festgelegt. HALCON unterstützt folgende Bildtypen:

'byte'"byte""byte""byte""byte""byte"

1 Byte pro Pixel, ohne Vorzeichen

Wertebereich: (0..255)

'int1'"int1""int1""int1""int1""int1"

1 Byte pro Pixel, mit Vorzeichen

Wertebereich: (-128..127)

'uint2'"uint2""uint2""uint2""uint2""uint2"

2 Byte pro Pixel, ohne Vorzeichen

Wertebereich: (0..65535)

'int2'"int2""int2""int2""int2""int2"

2 Byte pro Pixel, mit Vorzeichen

Wertebereich: (-32768..32767)

'int4'"int4""int4""int4""int4""int4"

4 Byte pro Pixel, mit Vorzeichen

Wertebereich: (-2147483648..2147483647)

'int8'"int8""int8""int8""int8""int8"

8 Byte pro Pixel, mit Vorzeichen (nur auf 64-Bit-Systemen verfügbar)

Wertebereich: (-9223372036854775808..9223372036854775807)

'real'"real""real""real""real""real"

4 Byte pro Pixel, Fließkomma

Wertebereich: (-3.4e38..3.4e38)

Genauigkeit: 6 Stellen

'complex'"complex""complex""complex""complex""complex"

zwei Matrizen vom Typ 'real'"real""real""real""real""real"

'vector_field_relative'"vector_field_relative""vector_field_relative""vector_field_relative""vector_field_relative""vector_field_relative"

zwei Matrizen vom Typ 'real'"real""real""real""real""real"

Interpretation: Vektoren

'vector_field_absolute'"vector_field_absolute""vector_field_absolute""vector_field_absolute""vector_field_absolute""vector_field_absolute"

zwei Matrizen vom Typ 'real'"real""real""real""real""real"

Interpretation: Absolute Koordinaten

'direction'"direction""direction""direction""direction""direction"

1 Byte pro Pixel, ohne Vorzeichen

Wertebereich: (0..179)

Interpretation: Halber Winkel

Achtung: Die Werte 180..254 werden auf den Wert 255 gesetzt, der als undefinierter Winkel interpretiert wird.

'cyclic'"cyclic""cyclic""cyclic""cyclic""cyclic"

1 Byte pro Pixel, ohne Vorzeichen, zyklische Arithmetik

Wertebereich: (0..255)

Ob das erzeugte Bild mit 0 initialisiert wird oder nicht, wird mit 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">)SetSystem("init_new_image",<"true"/"false">)set_system("init_new_image",<"true"/"false">) festgelegt.

Ausführungsinformationen

Parameter

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

Erzeugtes Bild mit neuer Bildmatrix.

TypeTypeTypeTypetypetype (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Pixeltyp.

Defaultwert: 'byte' "byte" "byte" "byte" "byte" "byte"

Werteliste: 'byte'"byte""byte""byte""byte""byte", 'complex'"complex""complex""complex""complex""complex", 'cyclic'"cyclic""cyclic""cyclic""cyclic""cyclic", 'direction'"direction""direction""direction""direction""direction", 'int1'"int1""int1""int1""int1""int1", 'int2'"int2""int2""int2""int2""int2", 'int4'"int4""int4""int4""int4""int4", 'int8'"int8""int8""int8""int8""int8", 'real'"real""real""real""real""real", 'uint2'"uint2""uint2""uint2""uint2""uint2", 'vector_field_absolute'"vector_field_absolute""vector_field_absolute""vector_field_absolute""vector_field_absolute""vector_field_absolute", 'vector_field_relative'"vector_field_relative""vector_field_relative""vector_field_relative""vector_field_relative""vector_field_relative"

WidthWidthWidthWidthwidthwidth (input_control)  extent.x HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Breite des Bildes.

Defaultwert: 512

Wertevorschläge: 128, 256, 512, 1024

Typischer Wertebereich: 1 ≤ Width Width Width Width width width ≤ 512 (lin)

Minimale Schrittweite: 1

Empfohlene Schrittweite: 10

Restriktion: Width >= 1

HeightHeightHeightHeightheightheight (input_control)  extent.y HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Höhe des Bildes.

Defaultwert: 512

Wertevorschläge: 128, 256, 512, 1024

Typischer Wertebereich: 1 ≤ Height Height Height Height height height ≤ 512 (lin)

Minimale Schrittweite: 1

Empfohlene Schrittweite: 10

Restriktion: Height >= 1

Beispiel (C)

gen_image_const(&New,"byte",width,height);
get_image_pointer1(New,(Hlong*)&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;
  }
}

Ergebnis

Sind die Parameterwerte korrekt, dann liefertgen_image_constgen_image_constGenImageConstGenImageConstGenImageConstgen_image_const den Wert TRUE. Andernfalls wird eine Fehlerbehandlung durchgeführt.

Nachfolger

paint_regionpaint_regionPaintRegionPaintRegionPaintRegionpaint_region, reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain, get_image_pointer1get_image_pointer1GetImagePointer1GetImagePointer1GetImagePointer1get_image_pointer1, copy_objcopy_objCopyObjCopyObjCopyObjcopy_obj

Alternativen

gen_image1gen_image1GenImage1GenImage1GenImage1gen_image1, gen_image3gen_image3GenImage3GenImage3GenImage3gen_image3

Siehe auch

reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain, paint_graypaint_grayPaintGrayPaintGrayPaintGraypaint_gray, paint_regionpaint_regionPaintRegionPaintRegionPaintRegionpaint_region, set_grayvalset_grayvalSetGrayvalSetGrayvalSetGrayvalset_grayval, get_image_pointer1get_image_pointer1GetImagePointer1GetImagePointer1GetImagePointer1get_image_pointer1

Modul

Foundation