background_segbackground_segBackgroundSegBackgroundSeg (Operator)

Name

background_segbackground_segBackgroundSegBackgroundSeg — Ermitteln zusammenhängender Regionen des Hintergrundes.

Signatur

background_seg(Foreground : BackgroundRegions : : )

Herror background_seg(const Hobject Foreground, Hobject* BackgroundRegions)

Herror T_background_seg(const Hobject Foreground, Hobject* BackgroundRegions)

void BackgroundSeg(const HObject& Foreground, HObject* BackgroundRegions)

HRegion HRegion::BackgroundSeg() const

static void HOperatorSet.BackgroundSeg(HObject foreground, out HObject backgroundRegions)

HRegion HRegion.BackgroundSeg()

Beschreibung

background_segbackground_segBackgroundSegBackgroundSegBackgroundSeg liefert zusammenhängende Hintergrundregionen. Die Prozedur wird typischerweise nach der Kantensuche (inkl. Verdünnung) angewandt, um die von den Kanten begrenzten Bild-Segmente zu ermitteln. Die Berechnung der Zusammenhangskomponenten erfolgt mit der 4-er Nachbarschaft.

Ausführungsinformationen

Parameter

ForegroundForegroundForegroundForegroundforeground (input_object)  region(-array) objectHRegionHRegionHobject

Regionkanten.

BackgroundRegionsBackgroundRegionsBackgroundRegionsBackgroundRegionsbackgroundRegions (output_object)  region-array objectHRegionHRegionHobject *

Die zusammenhängenden Hintergrundkomponenten in Foreground.

Beispiel (HDevelop)

* Simulation of background_seg:
background_seg(Foreground,BackgroundRegions)
  complement(Foreground,Background)
  get_system('neighborhood',Save)
  set_system('neighborhood',4)
  connection(Background,BackgroundRegions)
  set_system('neighborhood',Save)

* Segmentation with edge filter:
read_image(Image,'fabrik')
sobel_dir(Image,Sobel,Dir,'sum_sqrt',3)
threshold(Sobel,Edges,20,255)
skeleton(Edges,Margins)
background_seg(Margins,Regions)

Beispiel (C)

/* Segmentation with edge filter: */
read_image(&Image,"fabrik");
sobel_dir(Image,&Sobel,&Dir,"sum_sqrt",3);
threshold(Sobel,&Edges,20,255);
skeleton(Edges,&Margins);
background_seg(Margins,&Regions);

Beispiel (HDevelop)

* Simulation of background_seg:
background_seg(Foreground,BackgroundRegions)
  complement(Foreground,Background)
  get_system('neighborhood',Save)
  set_system('neighborhood',4)
  connection(Background,BackgroundRegions)
  set_system('neighborhood',Save)

* Segmentation with edge filter:
read_image(Image,'fabrik')
sobel_dir(Image,Sobel,Dir,'sum_sqrt',3)
threshold(Sobel,Edges,20,255)
skeleton(Edges,Margins)
background_seg(Margins,Regions)

Beispiel (HDevelop)

* Simulation of background_seg:
background_seg(Foreground,BackgroundRegions)
  complement(Foreground,Background)
  get_system('neighborhood',Save)
  set_system('neighborhood',4)
  connection(Background,BackgroundRegions)
  set_system('neighborhood',Save)

* Segmentation with edge filter:
read_image(Image,'fabrik')
sobel_dir(Image,Sobel,Dir,'sum_sqrt',3)
threshold(Sobel,Edges,20,255)
skeleton(Edges,Margins)
background_seg(Margins,Regions)

Beispiel (HDevelop)

* Simulation of background_seg:
background_seg(Foreground,BackgroundRegions)
  complement(Foreground,Background)
  get_system('neighborhood',Save)
  set_system('neighborhood',4)
  connection(Background,BackgroundRegions)
  set_system('neighborhood',Save)

* Segmentation with edge filter:
read_image(Image,'fabrik')
sobel_dir(Image,Sobel,Dir,'sum_sqrt',3)
threshold(Sobel,Edges,20,255)
skeleton(Edges,Margins)
background_seg(Margins,Regions)

Komplexität

Sei F die Fläche des Hintergrundes, H die Bildhöhe und N die Anzahl der Ergebnisregionen, dann ist die Laufzeitkomplexität: O(H + sqrt(F) * sqrt(N)).

Ergebnis

background_segbackground_segBackgroundSegBackgroundSegBackgroundSeg 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, connectionconnectionConnectionConnectionConnection, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowing, pouringpouringPouringPouringPouring, class_ndim_normclass_ndim_normClassNdimNormClassNdimNormClassNdimNorm

Nachfolger

select_shapeselect_shapeSelectShapeSelectShapeSelectShape

Alternativen

complementcomplementComplementComplementComplement, connectionconnectionConnectionConnectionConnection

Siehe auch

thresholdthresholdThresholdThresholdThreshold, hysteresis_thresholdhysteresis_thresholdHysteresisThresholdHysteresisThresholdHysteresisThreshold, skeletonskeletonSkeletonSkeletonSkeleton, expand_regionexpand_regionExpandRegionExpandRegionExpandRegion, set_systemset_systemSetSystemSetSystemSetSystem, sobel_ampsobel_ampSobelAmpSobelAmpSobelAmp, edges_imageedges_imageEdgesImageEdgesImageEdgesImage, robertsrobertsRobertsRobertsRoberts, bandpass_imagebandpass_imageBandpassImageBandpassImageBandpassImage

Modul

Foundation