Herror ::erosion_rectangle1 (
    Hobject Region,
    Hobject *RegionErosion,
    const HTuple &Width,
    const HTuple &Height
)
HRegion HRegion::ErosionRectangle1 (
    const HTuple &Width,
    const HTuple &Height
) const
HRegionArray HRegionArray::ErosionRectangle1 (
    const HTuple &Width,
    const HTuple &Height
) const

Erode a region with a rectangular structuring element.

::erosion_rectangle1 applies an erosion with a rectangular structuring element to the input regions Region. The size of the structuring rectangle is Width x Height. The operator results in reduced regions, and the areas smaller than the rectangular mask are eliminated.

::erosion_rectangle1 is a very fast operation because the height of the rectangle enters only logarithmically into the runtime complexity, while the width does not enter at all. This leads to excellent runtime efficiency, even in the case of very large rectangles (edge length > 100).

Regions containing small connecting strips between large areas are separated only seemingly. They remain logically one region.


Parameters

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

RegionErosion (output_object)
region(-array) -> Hobject * : HRegion(Array)
Eroded regions.

Width (input_control)
extent.x -> HTuple.long
Width of the structuring rectangle.
Default value: 10
Suggested values: 1, 2, 3, 4, 6, 10, 15, 20, 30, 50, 70, 100
Typical range of values: 1 <= Width <= 511 (lin)
Minimum increment: 1
Recommended increment: 1

Height (input_control)
extent.y -> HTuple.long
Height of the structuring rectangle.
Default value: 10
Suggested values: 1, 2, 3, 4, 6, 10, 15, 20, 30, 50, 70, 100
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(sqrt(F1) * ld(H)) .


Result

::erosion_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, ::watersheds, ::class_ndim_norm


Possible Successors

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


Alternatives

::erosion1, ::minkowski_sub1


See also

::gen_rectangle1


Module

Morphology



Copyright © 1996-2002 MVTec Software GmbH