Start » Filter Reference » Region » Region Morphology » OpenRegion

OpenRegion


Module: FoundationBasic

Performs a morphological opening on a region using a predefined kernel.

Applications

Removing small parts from a region without making it thinner.
Name Type Range Description
Input value
inRegion Region Input region
Input value
inKernel KernelShape Kernel shape (predefined)
Input value
inRadiusX Integer 0 - Nearly half of the kernel's width (2*R+1)
Input value
inRadiusY Integer* 0 - Nearly half of the kernel's height (2*R+1), or same as inRadiusX
Output value
outRegion Region Output region

Description

The operation performs a morphological opening, which is a tool used for removing thin parts from a region. The operation is a convolution of two basic morphological operations:

  • Firstly, the input region is eroded using ErodeRegion operation.
  • Then, the resulting region is dilated using DilateRegion operation.

During the erosion thin parts of a region are eliminated, while further dilation assures that the width of region limbs is preserved.

Both of the component operations are conducted using the same inKernel, inRadiusX and inRadiusY parameters.

Hints

  • Increase inRadiusX to remove more small parts from the region.
  • Change inKernel to Ellipse to make the filter work equally strongly in each direction (execution will be slower).

Examples

Description of usage of this filter can be found in examples and tutorial: Capsules, Molybdenum Foil, Rubber Ring, Rubber Ring (Simple), Finding PCB Missing Covering.

OpenRegion run with inKernel = Ellipse of dimensions inRadiusX = 3, inRadiusY = 3.

Errors

This filter can throw an exception to report error. Read how to deal with errors in Error Handling.

List of possible exceptions:

Error type Description
DomainError Unsupported kernel in OpenRegion.

Complexity Level

This filter is available on Advanced Complexity Level.

Filter Group

This filter is member of OpenRegion filter group.

See Also

  • ErodeRegion – Performs a morphological erosion on a region using a predefined kernel.
  • CloseRegion – Performs a morphological closing on a region using selected predefined kernel.