Back to FabImage Library website
You are here: Start » Function Reference » Region » Region Morphology » TopHatRegion

TopHatRegion
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationBasic |
Performs a morphological white top hat operation on a region using a predefined kernel.
Syntax
C++
C#
void fil::TopHatRegion ( const fil::Region& inRegion, fil::KernelShape::Type inKernel, int inRadiusX, ftl::Optional<int> inRadiusY, fil::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
Extracts from region small parts. Uses predefined kernels.
Is performed by running consecutively two filters. OpenRegion to remove small parts from region and RegionDifference to remove rest of the region.
Examples
![]() |
![]() |
Top Hat used to remove bigger parts of region. Used parameters inKernel=Ellipse and inRadiusX=5. Region marked white. Source image on the left and result on the right.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Unsupported kernel in TopHatRegion. |