rank_regionrank_regionRankRegionRankRegionrank_region (Operator)

Name

rank_regionrank_regionRankRegionRankRegionrank_region — Berechnen des Rangoperators für Regionen.

Signatur

rank_region(Region : RegionCount : Width, Height, Number : )

Herror rank_region(const Hobject Region, Hobject* RegionCount, const Hlong Width, const Hlong Height, const Hlong Number)

Herror T_rank_region(const Hobject Region, Hobject* RegionCount, const Htuple Width, const Htuple Height, const Htuple Number)

void RankRegion(const HObject& Region, HObject* RegionCount, const HTuple& Width, const HTuple& Height, const HTuple& Number)

HRegion HRegion::RankRegion(Hlong Width, Hlong Height, Hlong Number) const

static void HOperatorSet.RankRegion(HObject region, out HObject regionCount, HTuple width, HTuple height, HTuple number)

HRegion HRegion.RankRegion(int width, int height, int number)

def rank_region(region: HObject, width: int, height: int, number: int) -> HObject

Beschreibung

rank_regionrank_regionRankRegionRankRegionRankRegionrank_region berechnet den binären Rangoperator. Es wird eine Filtermaske (Rechteck: HeightHeightHeightHeightheightheight x WidthWidthWidthWidthwidthwidth) verwendet. Dabei wird für jede Position die Anzahl der Punkte aus RegionRegionRegionRegionregionregion gezählt, die in der Rechteckmaske liegen. Ist die Anzahl größer oder gleich NumberNumberNumberNumbernumbernumber, dann wird der Schwerpunkt des Rechtecks in der Ergebnisregion eingetragen. Wählt man so erhält man den Median Operator.

Achtung

Als Werte für HeightHeightHeightHeightheightheight und WidthWidthWidthWidthwidthwidth sind nur ungerade Zahlen > 3 zugelassen. Werden andere Werte eingegeben, so werden diese automatisch (ohne Fehlermeldung) entsprechend modifiziert (nächstgrößere ungerade Zahl).

Ausführungsinformationen

Parameter

RegionRegionRegionRegionregionregion (input_object)  region(-array) objectHRegionHObjectHRegionHobject

Zu transformierende Region(en).

RegionCountRegionCountRegionCountRegionCountregionCountregion_count (output_object)  region(-array) objectHRegionHObjectHRegionHobject *

Ergebnisregion(en)

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

Breite der Filtermaske.

Defaultwert: 15

Wertevorschläge: 3, 5, 7, 9, 11, 13, 15, 17, 19, 21

Typischer Wertebereich: 3 ≤ Width Width Width Width width width ≤ 511 (lin)

Minimale Schrittweite: 2

Empfohlene Schrittweite: 2

Restriktion: Width >= 3 && odd(Width)

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

Höhe der Filtermaske.

Defaultwert: 15

Wertevorschläge: 3, 5, 7, 9, 11, 13, 15, 17, 19, 21

Typischer Wertebereich: 3 ≤ Height Height Height Height height height ≤ 511 (lin)

Minimale Schrittweite: 2

Empfohlene Schrittweite: 2

Restriktion: Height >= 3 && odd(Height)

NumberNumberNumberNumbernumbernumber (input_control)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Zahl der Punkte innerhalb der Filtermaske >= Number: Punkt wird in Ausgaberegion aufgenommen.

Defaultwert: 70

Wertevorschläge: 5, 10, 20, 40, 60, 80, 90, 120, 150, 200

Typischer Wertebereich: 1 ≤ Number Number Number Number number number ≤ 1000 (lin)

Minimale Schrittweite: 1

Empfohlene Schrittweite: 10

Restriktion: Number > 0

Beispiel (HDevelop)

read_image(Image,'monkey')
mean_image(Image,Mean,5,5)
dyn_threshold(Image,Mean,Points,25,'light')
rank_region(Points,Textur,15,15,30)
gen_circle(Mask,10,10,3)
opening(Textur,Mask,Seg)

Beispiel (C)

read_image(&Image,"monkey");
mean_image(Image,&Mean,5,5);
dyn_threshold(Image,Mean,&Points,25,"light");
rank_region(Points,Textur,15,15,30);
gen_circle(&Mask,10,10,3);
opening(Textur,Mask,&Seg);

Beispiel (HDevelop)

read_image(Image,'monkey')
mean_image(Image,Mean,5,5)
dyn_threshold(Image,Mean,Points,25,'light')
rank_region(Points,Textur,15,15,30)
gen_circle(Mask,10,10,3)
opening(Textur,Mask,Seg)

Beispiel (HDevelop)

read_image(Image,'monkey')
mean_image(Image,Mean,5,5)
dyn_threshold(Image,Mean,Points,25,'light')
rank_region(Points,Textur,15,15,30)
gen_circle(Mask,10,10,3)
opening(Textur,Mask,Seg)

Beispiel (HDevelop)

read_image(Image,'monkey')
mean_image(Image,Mean,5,5)
dyn_threshold(Image,Mean,Points,25,'light')
rank_region(Points,Textur,15,15,30)
gen_circle(Mask,10,10,3)
opening(Textur,Mask,Seg)

Komplexität

Sei F die Fläche der Eingaberegion, dann ist die Laufzeitkomplexität: O(F * 8).

Ergebnis

rank_regionrank_regionRankRegionRankRegionRankRegionrank_region liefert den Wert 2 (H_MSG_TRUE), falls die Parameter korrekt sind. 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, connectionconnectionConnectionConnectionConnectionconnection, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing, pouringpouringPouringPouringPouringpouring, class_ndim_normclass_ndim_normClassNdimNormClassNdimNormClassNdimNormclass_ndim_norm

Nachfolger

select_shapeselect_shapeSelectShapeSelectShapeSelectShapeselect_shape, disp_regiondisp_regionDispRegionDispRegionDispRegiondisp_region

Alternativen

closing_rectangle1closing_rectangle1ClosingRectangle1ClosingRectangle1ClosingRectangle1closing_rectangle1, expand_regionexpand_regionExpandRegionExpandRegionExpandRegionexpand_region

Siehe auch

rank_imagerank_imageRankImageRankImageRankImagerank_image, mean_imagemean_imageMeanImageMeanImageMeanImagemean_image

Modul

Foundation