ClassesClassesClassesClasses | | | | Operators

erosion_rectangle1erosion_rectangle1ErosionRectangle1erosion_rectangle1ErosionRectangle1ErosionRectangle1 (Operator)


erosion_rectangle1erosion_rectangle1ErosionRectangle1erosion_rectangle1ErosionRectangle1ErosionRectangle1 — Erode a region with a rectangular structuring element.


erosion_rectangle1(Region : RegionErosion : Width, Height : )

Herror erosion_rectangle1(const Hobject Region, Hobject* RegionErosion, const Hlong Width, const Hlong Height)

Herror T_erosion_rectangle1(const Hobject Region, Hobject* RegionErosion, const Htuple Width, const Htuple Height)

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

void ErosionRectangle1(const HObject& Region, HObject* RegionErosion, const HTuple& Width, const HTuple& Height)

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

void HOperatorSetX.ErosionRectangle1(
[in] IHUntypedObjectX* Region, [out] IHUntypedObjectX*RegionErosion, [in] VARIANT Width, [in] VARIANT Height)

IHRegionX* HRegionX.ErosionRectangle1(
[in] Hlong Width, [in] Hlong Height)

static void HOperatorSet.ErosionRectangle1(HObject region, out HObject regionErosion, HTuple width, HTuple height)

HRegion HRegion.ErosionRectangle1(int width, int height)


erosion_rectangle1erosion_rectangle1ErosionRectangle1erosion_rectangle1ErosionRectangle1ErosionRectangle1 applies an erosion with a rectangular structuring element to the input regions RegionRegionRegionRegionRegionregion. The size of the structuring rectangle is WidthWidthWidthWidthWidthwidth x HeightHeightHeightHeightHeightheight. The operator results in reduced regions, and the areas smaller than the rectangular mask are eliminated.

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


To reduce a region by the same amount in all directions, WidthWidthWidthWidthWidthwidth and HeightHeightHeightHeightHeightheight must be odd. If this is not the case, the region is eroded by a larger amount at the right or at the bottom, respectively, than at the left or at the top.



RegionRegionRegionRegionRegionregion (input_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject

Regions to be eroded.

RegionErosionRegionErosionRegionErosionRegionErosionRegionErosionregionErosion (output_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject *

Eroded regions.

WidthWidthWidthWidthWidthwidth (input_control)  extent.x HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Width of the structuring rectangle.

Default value: 11

Suggested values: 1, 2, 3, 4, 5, 11, 15, 21, 31, 51, 71, 101, 151, 201

Typical range of values: 1 ≤ Width Width Width Width Width width ≤ 511 (lin)

Minimum increment: 1

Recommended increment: 1

HeightHeightHeightHeightHeightheight (input_control)  extent.y HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Height of the structuring rectangle.

Default value: 11

Suggested values: 1, 2, 3, 4, 5, 11, 15, 21, 31, 51, 71, 101, 151, 201

Typical range of values: 1 ≤ Height Height Height Height Height height ≤ 511 (lin)

Minimum increment: 1

Recommended increment: 1


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:


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

Otherwise, an exception is raised.

Possible Predecessors

thresholdthresholdThresholdthresholdThresholdThreshold, regiongrowingregiongrowingRegiongrowingregiongrowingRegiongrowingRegiongrowing, watershedswatershedsWatershedswatershedsWatershedsWatersheds, class_ndim_normclass_ndim_normClassNdimNormclass_ndim_normClassNdimNormClassNdimNorm

Possible Successors

reduce_domainreduce_domainReduceDomainreduce_domainReduceDomainReduceDomain, select_shapeselect_shapeSelectShapeselect_shapeSelectShapeSelectShape, area_centerarea_centerAreaCenterarea_centerAreaCenterAreaCenter, connectionconnectionConnectionconnectionConnectionConnection


erosion1erosion1Erosion1erosion1Erosion1Erosion1, minkowski_sub1minkowski_sub1MinkowskiSub1minkowski_sub1MinkowskiSub1MinkowskiSub1

See also




ClassesClassesClassesClasses | | | | Operators