Skip to content

opening_circleOpeningCircleOpeningCircleopening_circleopening_circle🔗

Short description🔗

opening_circleOpeningCircleOpeningCircleopening_circleopening_circle — Open a region with a circular structuring element.

Signature🔗

opening_circle( region Region, out region RegionOpening, real Radius )void OpeningCircle( const HObject& Region, HObject* RegionOpening, const HTuple& Radius )static void HOperatorSet.OpeningCircle( HObject region, out HObject regionOpening, HTuple radius )def opening_circle( region: HObject, radius: Union[float, int] ) -> HObject

Herror opening_circle( const Hobject Region, Hobject* RegionOpening, double Radius )

Herror T_opening_circle( const Hobject Region, Hobject* RegionOpening, const Htuple Radius )

HRegion HRegion::OpeningCircle( const HTuple& Radius ) const

HRegion HRegion::OpeningCircle( double Radius ) const

HRegion HRegion.OpeningCircle( HTuple radius )

HRegion HRegion.OpeningCircle( double radius )

Description🔗

opening_circleOpeningCircle is defined as an erosion followed by a Minkowski addition with a circular structuring element (see example). openingOpening serves to eliminate small regions (smaller than the circular structuring element) and to smooth the boundaries of a region.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on tuple level.

Parameters🔗

Regionregionregion (input_object) region(-array) → objectHObjectHRegionHObjectHobject

Regions to be opened.

RegionOpeningregionOpeningregion_opening (output_object) region(-array) → objectHObjectHRegionHObjectHobject *

Opened regions.

Radiusradiusradius (input_control) real → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Radius of the circular structuring element.

Default: 3.53.5
Suggested values: 1.5, 2.5, 3.5, 4.5, 5.5, 7.5, 9.5, 12.5, 15.5, 19.5, 25.5, 33.5, 45.5, 60.5, 110.51.5, 2.5, 3.5, 4.5, 5.5, 7.5, 9.5, 12.5, 15.5, 19.5, 25.5, 33.5, 45.5, 60.5, 110.5
Value range: 0.5 ≤ Radius ≤ 511.5 (lin)
Minimum increment: 1.0
Recommended increment: 1.0

Example🔗

(HDevelop)

* Large regions in an aerial picture (beech trees or meadows):
read_image (Image, 'forest_road')
threshold (Image, Region, 120, 255)
* Close the small gaps.
closing_circle (Region, RegionClosing, 3.5)
* Select the large regions.
opening_circle (RegionClosing, RegionOpening, 19.5)
(C)
/* simulation of opening_circle */
my_opening_circle(Hobject In, double Radius, Hobject *Out)
{
  Hobject Circle, tmp\;
  gen_circle(&Circle,100.0,100.0,Radius)\;
  erosion1(Region,Circle,&tmp,1)\;
  minkowski_add1(tmp,Circle,&Out,1)\;
}

/* Large regions in an aerial picture (beech trees or meadows): */
read_image(&Image, "forest_road")\;
threshold(Image, &Region, 120.0, 255.0)\;
/* Close the small gaps. */
closing_circle(Region, &RegionClosing, 3.5)\;
/* Select the large regions. */
opening_circle(RegionClosing, &RegionOpening, 19.5)\;

Complexity🔗

Let \(F1\) be the area of the input region. Then the runtime complexity for one region is:

\[\begin{eqnarray*} O(4 \cdot \sqrt{F1} \cdot \textrm{Radius}) \enspace . \end{eqnarray*}\]

Result🔗

opening_circleOpeningCircle returns 2 (H_MSG_TRUE) if all parameters are correct. The behavior in case of empty or no input region can be set via:

  • no region: set_system('no_object_result',<RegionResult>)

  • empty region: set_system('empty_region_result',<RegionResult>)

Otherwise, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

thresholdThreshold, regiongrowingRegiongrowing, connectionConnection, union1Union1, watershedsWatersheds, class_ndim_normClassNdimNorm

Possible successors

reduce_domainReduceDomain, select_shapeSelectShape, area_centerAreaCenter, connectionConnection

Alternatives

openingOpening, dilation1Dilation1, minkowski_add1MinkowskiAdd1, gen_circleGenCircle

See also

transpose_regionTransposeRegion

Module🔗

Foundation