You are here: Start » AVL.NET » AVL.RegionHitAndMissTransform(AvlNet.Region, AvlNet.Region, AvlNet.Location?, AvlNet.Region, AvlNet.Location?, AvlNet.Region)
AVL.RegionHitAndMissTransform(AvlNet.Region, AvlNet.Region, AvlNet.Location?, AvlNet.Region, AvlNet.Location?, AvlNet.Region)
Performs a hit-and-miss transformation on a region using arbitrary kernels.
| Namespace: | AvlNet |
|---|---|
| Assembly: | AVL.NET.dll |
Syntax
public static void RegionHitAndMissTransform( AvlNet.Region inRegion, AvlNet.Region inHitKernel, AvlNet.Location? inHitKernelAnchor, AvlNet.Region inMissKernel, AvlNet.Location? inMissKernelAnchor, out AvlNet.Region outRegion )
Parameters
- inRegion
- Type: AvlNet.Region
Input region - inHitKernel
- Type: AvlNet.Region
The kernel of pixels that should be present - inHitKernelAnchor
- Type: System.Nullable<AvlNet.Location>
Location withing inHitKernel, defining its center, or null. - inMissKernel
- Type: AvlNet.Region
The kernel of pixels that should be missing - inMissKernelAnchor
- Type: System.Nullable<AvlNet.Location>
Location withing inMissKernel, defining its center, or null. - outRegion
- Type: AvlNet.Region
Output region
Description
The operation performs a hit-and-miss transformation. Similarly to other region morphology operations, hit-and-miss is conducted using a shape called kernel (or structuring element). In this particular case, there are two kernels: inHitKernel and inMissKernel. Both of them are repeatedly centered at each location within the dimensions of the input region. Then, pixel location L is added to the resulting region if and only if all of the inHitKernel pixels centered at L lie inside and all of the inMissKernel pixels centered at L lie outside the input region.
Examples
![]() |
![]() |
RegionHitAndMissTransform run with kernels \( \begin{bmatrix} 1 & X & X\\ 1 & 0 & X\\ 1 & X & X \end{bmatrix} \) where \( 1 \)'s represent pixels from inHitKernel, \( 0 \)'s from inMissKernel and \( X \)'s the other ones.
Errors
| Error type | Description |
|---|---|
| DomainError | Inconsistent regions dimensions in RegionHitAndMissTransform. |


