background_segbackground_segBackgroundSegBackgroundSegbackground_seg (Operator)

Name

background_segbackground_segBackgroundSegBackgroundSegbackground_seg — 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()

def background_seg(foreground: HObject) -> HObject

Beschreibung

background_segbackground_segBackgroundSegBackgroundSegBackgroundSegbackground_seg 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

ForegroundForegroundForegroundForegroundforegroundforeground (input_object)  region(-array) objectHRegionHObjectHRegionHobject

Regionenkanten.

BackgroundRegionsBackgroundRegionsBackgroundRegionsBackgroundRegionsbackgroundRegionsbackground_regions (output_object)  region-array objectHRegionHObjectHRegionHobject *

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_segBackgroundSegBackgroundSegBackgroundSegbackground_seg liefert normalerweise den Wert 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, connectionconnectionConnectionConnectionConnectionconnection, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing, pouringpouringPouringPouringPouringpouring, class_ndim_normclass_ndim_normClassNdimNormClassNdimNormClassNdimNormclass_ndim_norm

Nachfolger

select_shapeselect_shapeSelectShapeSelectShapeSelectShapeselect_shape

Alternativen

complementcomplementComplementComplementComplementcomplement, connectionconnectionConnectionConnectionConnectionconnection

Siehe auch

thresholdthresholdThresholdThresholdThresholdthreshold, hysteresis_thresholdhysteresis_thresholdHysteresisThresholdHysteresisThresholdHysteresisThresholdhysteresis_threshold, skeletonskeletonSkeletonSkeletonSkeletonskeleton, expand_regionexpand_regionExpandRegionExpandRegionExpandRegionexpand_region, set_systemset_systemSetSystemSetSystemSetSystemset_system, sobel_ampsobel_ampSobelAmpSobelAmpSobelAmpsobel_amp, edges_imageedges_imageEdgesImageEdgesImageEdgesImageedges_image, robertsrobertsRobertsRobertsRobertsroberts, bandpass_imagebandpass_imageBandpassImageBandpassImageBandpassImagebandpass_image

Modul

Foundation