Back to Adaptive Vision Library website
You are here: Start » Function Reference » Region Morphology » OpenRegion
OpenRegion
Performs a morphological opening on a region using a predefined kernel.
Header: | AVL.h |
---|
Syntax
C++
C#
void avl::OpenRegion ( const avl::Region& inRegion, avl::KernelShape::Type inKernel, int inRadiusX, atl::Optional<int> inRadiusY, avl::Region& outRegion )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
inRegion | const Region& | Input region | |||
inKernel | KernelShape::Type | Kernel shape (predefined) | |||
inRadiusX | int | 0 - | 1 | Nearly half of the kernel's width (2*R+1) | |
inRadiusY | Optional<int> | 0 - | NIL | Nearly half of the kernel's height (2*R+1), or same as inRadiusX | |
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
Errors
Error type | Description |
---|---|
DomainError | Unsupported kernel in OpenRegion. |
See Also
- CloseRegion – Performs a morphological closing on a region using selected predefined kernel.
- ErodeRegion – Performs a morphological erosion on a region using a predefined kernel.
- OpenRegion_AnyKernel – Performs a morphological opening on a region using an arbitrary kernel.