HALCON Reference Manual 10.0.2
Table of Contents / Morphology / Region ClassesClassesClasses | | | Operators

closing_rectangle1closing_rectangle1closing_rectangle1ClosingRectangle1ClosingRectangle1 (Operator)

Name

closing_rectangle1closing_rectangle1closing_rectangle1ClosingRectangle1ClosingRectangle1 — Close a region with a rectangular structuring element.

Signature

closing_rectangle1(Region : RegionClosing : Width, Height : )

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)

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

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

IHRegionX* HRegionX.ClosingRectangle1(
[in] VARIANT Width, [in] VARIANT Height)

static void HOperatorSet.ClosingRectangle1(HObject region, out HObject regionClosing, HTuple width, HTuple height)

HRegion HRegion.ClosingRectangle1(HTuple width, HTuple height)

HRegion HRegion.ClosingRectangle1(int width, int height)

Description

closing_rectangle1closing_rectangle1closing_rectangle1ClosingRectangle1ClosingRectangle1 performs a dilation_rectangle1dilation_rectangle1dilation_rectangle1DilationRectangle1DilationRectangle1 followed by an erosion_rectangle1erosion_rectangle1erosion_rectangle1ErosionRectangle1ErosionRectangle1 on the input region RegionRegionRegionRegionregion. The size of the rectangular structuring element is determined by the parameters WidthWidthWidthWidthwidth and HeightHeightHeightHeightheight. As is the case for all closingclosingclosingClosingClosing variants, regions' boundaries are smoothed and holes within a region which are smaller than the rectangular structuring element are closed.

Attention

closing_rectangle1closing_rectangle1closing_rectangle1ClosingRectangle1ClosingRectangle1 is applied to each input region separately. If gaps between different regions are to be closed, union1union1union1Union1Union1 or union2union2union2Union2Union2 has to be called first.

Parallelization

Parameters

RegionRegionRegionRegionregion (input_object)  region(-array) objectHRegionHRegionHRegionXHobject

Regions to be closed.

RegionClosingRegionClosingRegionClosingRegionClosingregionClosing (output_object)  region(-array) objectHRegionHRegionHRegionXHobject *

Closed regions.

WidthWidthWidthWidthwidth (input_control)  extent.x HTupleHTupleVARIANTHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double) (Hlong / 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 Width Width Width width ≤ 511 (lin)

Minimum increment: 1

Recommended increment: 1

HeightHeightHeightHeightheight (input_control)  extent.y HTupleHTupleVARIANTHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double) (Hlong / 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 Height Height Height 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_rectangle1closing_rectangle1closing_rectangle1ClosingRectangle1ClosingRectangle1 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

thresholdthresholdthresholdThresholdThreshold, regiongrowingregiongrowingregiongrowingRegiongrowingRegiongrowing, connectionconnectionconnectionConnectionConnection, union1union1union1Union1Union1, watershedswatershedswatershedsWatershedsWatersheds, class_ndim_normclass_ndim_normclass_ndim_normClassNdimNormClassNdimNorm

Possible Successors

reduce_domainreduce_domainreduce_domainReduceDomainReduceDomain, select_shapeselect_shapeselect_shapeSelectShapeSelectShape, area_centerarea_centerarea_centerAreaCenterAreaCenter, connectionconnectionconnectionConnectionConnection

Alternatives

closingclosingclosingClosingClosing

See also

dilation_rectangle1dilation_rectangle1dilation_rectangle1DilationRectangle1DilationRectangle1, erosion_rectangle1erosion_rectangle1erosion_rectangle1ErosionRectangle1ErosionRectangle1, opening_rectangle1opening_rectangle1opening_rectangle1OpeningRectangle1OpeningRectangle1, gen_rectangle1gen_rectangle1gen_rectangle1GenRectangle1GenRectangle1

Module

Foundation


Table of Contents / Morphology / Region ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH