rank_regionrank_regionRankRegionRankRegion (Operator)

Name

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

Beschreibung

rank_regionrank_regionRankRegionRankRegionRankRegion berechnet den binären Rangoperator. Es wird eine Filtermaske (Rechteck: HeightHeightHeightHeightheight x WidthWidthWidthWidthwidth) verwendet. Dabei wird für jede Position die Anzahl der Punkte aus RegionRegionRegionRegionregion gezählt, die in der Rechteckmaske liegen. Ist die Anzahl größer oder gleich NumberNumberNumberNumbernumber, 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 HeightHeightHeightHeightheight und WidthWidthWidthWidthwidth 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

RegionRegionRegionRegionregion (input_object)  region(-array) objectHRegionHRegionHobject

Zu transformierende Region(en).

RegionCountRegionCountRegionCountRegionCountregionCount (output_object)  region(-array) objectHRegionHRegionHobject *

Ergebnisregion(en)

WidthWidthWidthWidthwidth (input_control)  extent.x HTupleHTupleHtuple (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 ≤ 511 (lin)

Minimale Schrittweite: 2

Empfohlene Schrittweite: 2

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

HeightHeightHeightHeightheight (input_control)  extent.y HTupleHTupleHtuple (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 ≤ 511 (lin)

Minimale Schrittweite: 2

Empfohlene Schrittweite: 2

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

NumberNumberNumberNumbernumber (input_control)  integer HTupleHTupleHtuple (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 ≤ 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_regionRankRegionRankRegionRankRegion 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>), 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, connectionconnectionConnectionConnectionConnection, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowing, pouringpouringPouringPouringPouring, class_ndim_normclass_ndim_normClassNdimNormClassNdimNormClassNdimNorm

Nachfolger

select_shapeselect_shapeSelectShapeSelectShapeSelectShape, disp_regiondisp_regionDispRegionDispRegionDispRegion

Alternativen

closing_rectangle1closing_rectangle1ClosingRectangle1ClosingRectangle1ClosingRectangle1, expand_regionexpand_regionExpandRegionExpandRegionExpandRegion

Siehe auch

rank_imagerank_imageRankImageRankImageRankImage, mean_imagemean_imageMeanImageMeanImageMeanImage

Modul

Foundation