Skip to content

closing_rectangle1ClosingRectangle1ClosingRectangle1closing_rectangle1closing_rectangle1πŸ”—

Short descriptionπŸ”—

closing_rectangle1ClosingRectangle1ClosingRectangle1closing_rectangle1closing_rectangle1 β€” Close a region with a rectangular structuring element.

SignatureπŸ”—

closing_rectangle1( region Region, out region RegionClosing, extent.x Width, extent.y Height )void ClosingRectangle1( const HObject& Region, HObject* RegionClosing, const HTuple& Width, const HTuple& Height )static void HOperatorSet.ClosingRectangle1( HObject region, out HObject regionClosing, HTuple width, HTuple height )def closing_rectangle1( region: HObject, width: int, height: int ) -> HObject

Herror closing_rectangle1( const Hobject Region, Hobject* RegionClosing, const Hlong Width, const Hlong Height )

Herror T_closing_rectangle1( const Hobject Region, Hobject* RegionClosing, const Htuple Width, const Htuple Height )

HRegion HRegion::ClosingRectangle1( Hlong Width, Hlong Height ) const

HRegion HRegion.ClosingRectangle1( int width, int height )

DescriptionπŸ”—

closing_rectangle1ClosingRectangle1 behaves as closingClosing with a rectangular structuring element on the input region Regionregionregion. The size of the rectangular structuring element is determined by the parameters Widthwidthwidth and Heightheightheight. As is the case for all closingClosing variants, regions’ boundaries are smoothed and holes within a region which are smaller than the rectangular structuring element are closed.

Similar to erosion_rectangle1ErosionRectangle1 and dilation_rectangle1DilationRectangle1 closing_rectangle1ClosingRectangle1 is a very fast operation.

AttentionπŸ”—

closing_rectangle1ClosingRectangle1 is applied to each input region separately. If gaps between different regions are to be closed, union1Union1 or union2Union2 has to be called first.

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 closed.

RegionClosingregionClosingregion_closing (output_object) region(-array) β†’ objectHObjectHRegionHObjectHobject *

Closed regions.

Widthwidthwidth (input_control) extent.x β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Width of the structuring rectangle.

Default: 1010
Suggested values: 1, 2, 3, 4, 5, 7, 9, 12, 15, 19, 25, 33, 45, 60, 110, 150, 2001, 2, 3, 4, 5, 7, 9, 12, 15, 19, 25, 33, 45, 60, 110, 150, 200
Value range: 1 ≀ Width ≀ 511 (lin)
Minimum increment: 1
Recommended increment: 1

Heightheightheight (input_control) extent.y β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Height of the structuring rectangle.

Default: 1010
Suggested values: 1, 2, 3, 4, 5, 7, 9, 12, 15, 19, 25, 33, 45, 60, 110, 150, 2001, 2, 3, 4, 5, 7, 9, 12, 15, 19, 25, 33, 45, 60, 110, 150, 200
Value range: 1 ≀ Height ≀ 511 (lin)
Minimum increment: 1
Recommended increment: 1

ComplexityπŸ”—

Let \(F1\) be the area of an input region and \(H\) be the height of the rectangle. Then the runtime complexity for one region is:

\[\begin{eqnarray*} O(2 \cdot \sqrt{F1} \cdot log_2(H)) \enspace . \end{eqnarray*}\]

ResultπŸ”—

closing_rectangle1ClosingRectangle1 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

closingClosing

See also

dilation_rectangle1DilationRectangle1, erosion_rectangle1ErosionRectangle1, opening_rectangle1OpeningRectangle1, gen_rectangle1GenRectangle1

ModuleπŸ”—

Foundation