region_to_labelregion_to_labelRegionToLabelRegionToLabel (Operator)

Name

region_to_labelregion_to_labelRegionToLabelRegionToLabel — Eintragen von Regionen in ein (Label-)Bild.

Signatur

region_to_label(Region : ImageLabel : Type, Width, Height : )

Herror region_to_label(const Hobject Region, Hobject* ImageLabel, const char* Type, const Hlong Width, const Hlong Height)

Herror T_region_to_label(const Hobject Region, Hobject* ImageLabel, const Htuple Type, const Htuple Width, const Htuple Height)

void RegionToLabel(const HObject& Region, HObject* ImageLabel, const HTuple& Type, const HTuple& Width, const HTuple& Height)

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

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

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

static void HOperatorSet.RegionToLabel(HObject region, out HObject imageLabel, HTuple type, HTuple width, HTuple height)

HImage HRegion.RegionToLabel(string type, int width, int height)

Beschreibung

region_to_labelregion_to_labelRegionToLabelRegionToLabelRegionToLabel trägt die Regionen mit ihrem Index (1..n) in eine Bildmatrix ein. Die erste Region erhält den „Grauwert“ 1, die zweite den „Grauwert“ 2 usw. Es werden also nur positive Zahlen verwendet. Bei 'byte'"byte""byte""byte""byte"-Bildern wird der Index modulo 256 genommen.

Regionen, die über die Größe des angegebenen Bildes hinausgehen, werden entsprechend beschnitten. Falls sich Regionen überlappen, so gibt die Reihenfolge vor, welche Region in dem Bild eingetragen wird: Es wird in der Reihenfolge der Regionen in die Matrix gezeichnet. Die zuletzt gezeichnete Region bleibt folglich im Ergebnisbild markiert. Die Regionen können gegebenenfalls mit expand_regionexpand_regionExpandRegionExpandRegionExpandRegion aufbereitet werden.

Der Hintergrund (keine Regionenpunkte) wird auf 0 gesetzt. Hiermit kann getestet werden, in welchen Bildbereichen keine Regionen vorhanden sind.

Ausführungsinformationen

Parameter

RegionRegionRegionRegionregion (input_object)  region(-array) objectHRegionHRegionHobject

Enthält die einzutragenden Regionen.

ImageLabelImageLabelImageLabelImageLabelimageLabel (output_object)  image objectHImageHImageHobject * (byte / int2 / int4)

Ergebnisbild der Größe Width * Height mit eingetragenen Regionen.

TypeTypeTypeTypetype (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Pixeltyp

Defaultwert: 'int2' "int2" "int2" "int2" "int2"

Werteliste: 'byte'"byte""byte""byte""byte", 'int2'"int2""int2""int2""int2", 'int4'"int4""int4""int4""int4", 'int8'"int8""int8""int8""int8"

WidthWidthWidthWidthwidth (input_control)  extent.y HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Breite des zu erstellenden Bildes.

Defaultwert: 512

Wertevorschläge: 64, 128, 256, 512, 1024

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

Minimale Schrittweite: 1

Empfohlene Schrittweite: 16

Restriktion: Width >= 1

HeightHeightHeightHeightheight (input_control)  extent.x HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Höhe des zu erstellenden Bildes.

Defaultwert: 512

Wertevorschläge: 64, 128, 256, 512, 1024

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

Minimale Schrittweite: 1

Empfohlene Schrittweite: 16

Restriktion: Height >= 1

Komplexität

O(2*HeightHeightHeightHeightheight*WidthWidthWidthWidthwidth).

Ergebnis

region_to_labelregion_to_labelRegionToLabelRegionToLabelRegionToLabel liefert normalerweise den Wert 2 (H_MSG_TRUE). Das Verhalten bei leerer Eingabe (keine Eingaberegionen vorhanden) lässt sich mittels set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>), das bei leerer Region mit set_system('empty_region_result',<Result>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>) festlegen. Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

thresholdthresholdThresholdThresholdThreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowing, connectionconnectionConnectionConnectionConnection, expand_regionexpand_regionExpandRegionExpandRegionExpandRegion

Nachfolger

get_grayvalget_grayvalGetGrayvalGetGrayvalGetGrayval, get_image_pointer1get_image_pointer1GetImagePointer1GetImagePointer1GetImagePointer1

Alternativen

region_to_binregion_to_binRegionToBinRegionToBinRegionToBin, paint_regionpaint_regionPaintRegionPaintRegionPaintRegion

Siehe auch

label_to_regionlabel_to_regionLabelToRegionLabelToRegionLabelToRegion

Modul

Foundation