region_to_labelregion_to_labelRegionToLabelRegionToLabelregion_to_label (Operator)

Name

region_to_labelregion_to_labelRegionToLabelRegionToLabelregion_to_label — 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)

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

Beschreibung

region_to_labelregion_to_labelRegionToLabelRegionToLabelRegionToLabelregion_to_label 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-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_regionExpandRegionExpandRegionExpandRegionexpand_region aufbereitet werden.

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

Ausführungsinformationen

Parameter

RegionRegionRegionRegionregionregion (input_object)  region(-array) objectHRegionHObjectHRegionHobject

Enthält die einzutragenden Regionen.

ImageLabelImageLabelImageLabelImageLabelimageLabelimage_label (output_object)  image objectHImageHObjectHImageHobject * (byte / int2 / int4)

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

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

Pixeltyp

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

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

WidthWidthWidthWidthwidthwidth (input_control)  extent.y HTupleintHTupleHtuple (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 width ≤ 1024 (lin)

Minimale Schrittweite: 1

Empfohlene Schrittweite: 16

Restriktion: Width >= 1

HeightHeightHeightHeightheightheight (input_control)  extent.x HTupleintHTupleHtuple (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 height ≤ 1024 (lin)

Minimale Schrittweite: 1

Empfohlene Schrittweite: 16

Restriktion: Height >= 1

Komplexität

O(2*HeightHeightHeightHeightheightheight*WidthWidthWidthWidthwidthwidth).

Ergebnis

region_to_labelregion_to_labelRegionToLabelRegionToLabelRegionToLabelregion_to_label 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>)set_system("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>)set_system("empty_region_result",<Result>) festlegen. Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

thresholdthresholdThresholdThresholdThresholdthreshold, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing, connectionconnectionConnectionConnectionConnectionconnection, expand_regionexpand_regionExpandRegionExpandRegionExpandRegionexpand_region

Nachfolger

get_grayvalget_grayvalGetGrayvalGetGrayvalGetGrayvalget_grayval, get_image_pointer1get_image_pointer1GetImagePointer1GetImagePointer1GetImagePointer1get_image_pointer1

Alternativen

region_to_binregion_to_binRegionToBinRegionToBinRegionToBinregion_to_bin, paint_regionpaint_regionPaintRegionPaintRegionPaintRegionpaint_region

Siehe auch

label_to_regionlabel_to_regionLabelToRegionLabelToRegionLabelToRegionlabel_to_region

Modul

Foundation