Herror ::closing_rectangle1 (
    Hobject Region,
    Hobject *RegionClosing,
    const HTuple &Width,
    const HTuple &Height
)
HRegion HRegion::ClosingRectangle1 (
    const HTuple &Width,
    const HTuple &Height
) const
HRegionArray HRegionArray::ClosingRectangle1 (
    const HTuple &Width,
    const HTuple &Height
) const

Close a region with a rectangular structuring element.

::closing_rectangle1 performs a ::dilation_rectangle1 followed by an ::erosion_rectangle1 on the input region Region. The size of the rectangular structuring element is determined by the parameters Width and Height. As is the case for all ::closing variants, regions' boundaries are smoothed and holes within a region which are smaller than the rectangular structuring element are closed.


Attention

::closing_rectangle1 is applied to each input region separately. If gaps between different regions are to be closed, ::union1 or ::union2 has to be called first.


Parameters

Region (input_object)
region(-array) -> Hobject: HRegion(Array)
Regions to be closed.

RegionClosing (output_object)
region(-array) -> Hobject * : HRegion(Array)
Closed regions.

Width (input_control)
extent.x -> HTuple.long / double
Width of the structuring rectangle.
Default value: 10
Suggested values: 1, 2, 3, 4, 5, 7, 9, 12, 15, 19, 25, 33, 45, 60, 110, 150, 200
Typical range of values: 1 <= Width <= 511 (lin)
Minimum increment: 1
Recommended increment: 1

Height (input_control)
extent.y -> HTuple.long / double
Height of the structuring rectangle.
Default value: 10
Suggested values: 1, 2, 3, 4, 5, 7, 9, 12, 15, 19, 25, 33, 45, 60, 110, 150, 200
Typical range of values: 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:

       O(2 * sqrt(F1) * log2(H)) .


Result

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

  a) no region:    set_system('no_object_result',<RegionResult>)
  b) empty region: set_system('empty_region_result',<RegionResult>)
Otherwise, an exception is raised.


Possible Predecessors

::threshold, ::regiongrowing, ::connection, ::union1, ::watersheds, ::class_ndim_norm


Possible Successors

::reduce_domain, ::select_shape, ::area_center, ::connection


Alternatives

::closing


See also

::dilation_rectangle1, ::erosion_rectangle1, ::opening_rectangle1, ::gen_rectangle1


Module

Morphology



Copyright © 1996-2002 MVTec Software GmbH