ClassesClassesClassesClasses | | | | Operators

background_segbackground_segBackgroundSegbackground_segBackgroundSegBackgroundSeg (Operator)

Name

background_segbackground_segBackgroundSegbackground_segBackgroundSegBackgroundSeg — Determine the connected components of the background of given regions.

Signature

background_seg(Foreground : BackgroundRegions : : )

Herror background_seg(const Hobject Foreground, Hobject* BackgroundRegions)

Herror T_background_seg(const Hobject Foreground, Hobject* BackgroundRegions)

Herror background_seg(Hobject Foreground, Hobject* BackgroundRegions)

HRegionArray HRegion::BackgroundSeg() const

HRegionArray HRegionArray::BackgroundSeg() const

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

HRegion HRegion::BackgroundSeg() const

void HOperatorSetX.BackgroundSeg(
[in] IHUntypedObjectX* Foreground, [out] IHUntypedObjectX*BackgroundRegions)

IHRegionX* HRegionX.BackgroundSeg()

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

HRegion HRegion.BackgroundSeg()

Description

background_segbackground_segBackgroundSegbackground_segBackgroundSegBackgroundSeg determines connected components of the background of the foreground regions given in ForegroundForegroundForegroundForegroundForegroundforeground. This operator is normally used after an edge operator in order to determine the regions enclosed by the extracted edges. The connected components are determined using 4-neighborhood.

Parallelization

Parameters

ForegroundForegroundForegroundForegroundForegroundforeground (input_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject

Input regions.

BackgroundRegionsBackgroundRegionsBackgroundRegionsBackgroundRegionsBackgroundRegionsbackgroundRegions (output_object)  region-array objectHRegionHRegionHRegionArrayHRegionXHobject *

Connected components of the background.

Example (HDevelop)

* Simulation of background_seg:
background_seg(Foreground,BackgroundRegions)
  complement(Foreground,Background)
  get_system('neighborhood',Save)
  set_system('neighborhood',4)
  connection(Background,BackgroundRegions)
     clear_obj(Background)
  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)

Example (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) ;

Example (HDevelop)

* Simulation of background_seg:
background_seg(Foreground,BackgroundRegions)
  complement(Foreground,Background)
  get_system('neighborhood',Save)
  set_system('neighborhood',4)
  connection(Background,BackgroundRegions)
     clear_obj(Background)
  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)

Example (HDevelop)

* Simulation of background_seg:
background_seg(Foreground,BackgroundRegions)
  complement(Foreground,Background)
  get_system('neighborhood',Save)
  set_system('neighborhood',4)
  connection(Background,BackgroundRegions)
     clear_obj(Background)
  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)

Example (HDevelop)

* Simulation of background_seg:
background_seg(Foreground,BackgroundRegions)
  complement(Foreground,Background)
  get_system('neighborhood',Save)
  set_system('neighborhood',4)
  connection(Background,BackgroundRegions)
     clear_obj(Background)
  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)

Example (HDevelop)

* Simulation of background_seg:
background_seg(Foreground,BackgroundRegions)
  complement(Foreground,Background)
  get_system('neighborhood',Save)
  set_system('neighborhood',4)
  connection(Background,BackgroundRegions)
     clear_obj(Background)
  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)

Complexity

Let F be the area of the background, H and W be the height and width of the image, and N be the number of resulting regions. Then the runtime complexity is O(H + sqrt(F) * sqrt(N)).

Result

background_segbackground_segBackgroundSegbackground_segBackgroundSegBackgroundSeg always returns the value 2 (H_MSG_TRUE). The behavior in case of empty input (no regions given) can be set via set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>) and the behavior in case of an empty input region via set_system('empty_region_result',<Result>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>). If necessary, an exception is raised.

Possible Predecessors

thresholdthresholdThresholdthresholdThresholdThreshold, connectionconnectionConnectionconnectionConnectionConnection, regiongrowingregiongrowingRegiongrowingregiongrowingRegiongrowingRegiongrowing, pouringpouringPouringpouringPouringPouring, class_ndim_normclass_ndim_normClassNdimNormclass_ndim_normClassNdimNormClassNdimNorm

Possible Successors

select_shapeselect_shapeSelectShapeselect_shapeSelectShapeSelectShape

Alternatives

complementcomplementComplementcomplementComplementComplement, connectionconnectionConnectionconnectionConnectionConnection

See also

thresholdthresholdThresholdthresholdThresholdThreshold, hysteresis_thresholdhysteresis_thresholdHysteresisThresholdhysteresis_thresholdHysteresisThresholdHysteresisThreshold, skeletonskeletonSkeletonskeletonSkeletonSkeleton, expand_regionexpand_regionExpandRegionexpand_regionExpandRegionExpandRegion, set_systemset_systemSetSystemset_systemSetSystemSetSystem, sobel_ampsobel_ampSobelAmpsobel_ampSobelAmpSobelAmp, edges_imageedges_imageEdgesImageedges_imageEdgesImageEdgesImage, robertsrobertsRobertsrobertsRobertsRoberts, bandpass_imagebandpass_imageBandpassImagebandpass_imageBandpassImageBandpassImage

Module

Foundation


ClassesClassesClassesClasses | | | | Operators