dilate

Perform morphological $(LINK3 https://en.wikipedia.org/wiki/Dilation_(morphology),dilation).

Use given kernel matrix to estimate image dilation for given image slice. Given slice is considered to be binarized with threshold method.

For given input slice:

1 0 0 0 0 0 0 0 0 0 0 0
2 0 1 1 1 1 0 0 1 1 1 0
3 0 1 1 1 1 0 0 1 1 1 0
4 0 1 1 1 1 1 1 1 1 1 0
5 0 1 1 1 1 1 1 1 1 1 0
6 0 1 1 0 0 0 1 1 1 1 0
7 0 1 1 0 0 0 1 1 1 1 0
8 0 1 1 0 0 0 1 1 1 1 0
9 0 1 1 1 1 1 1 1 0 0 0
10 0 1 1 1 1 1 1 1 0 0 0
11 0 0 0 0 0 0 0 0 0 0 0

... And dilation kernel of:

1 1 1
1 1 1
1 1 1

... Resulting slice is:

1 1 1 1 1 1 1 1 1 1 1 1
2 1 1 1 1 1 1 1 1 1 1 1
3 1 1 1 1 1 1 1 1 1 1 1
4 1 1 1 1 1 1 1 1 1 1 1
5 1 1 1 1 1 1 1 1 1 1 1
6 1 1 1 1 1 1 1 1 1 1 1
7 1 1 1 1 0 1 1 1 1 1 1
8 1 1 1 1 1 1 1 1 1 1 1
9 1 1 1 1 1 1 1 1 1 1 1
10 1 1 1 1 1 1 1 1 1 0 0
11 1 1 1 1 1 1 1 1 1 0 0

Note: Dilation works only for 2D binary images.

Slice!(kind, [2], T*)
dilate
(
alias BoundaryConditionTest = neumann
T
SliceKind kind
)
(
Slice!(kind, [2], T*) slice
,
Slice!(kind, [2], T*) kernel = radialKernel!T(3)
,
Slice!(kind, [2], T*) prealloc = emptySlice!([2], T)
,
TaskPool pool = taskPool
)
if (
isBoundaryCondition!BoundaryConditionTest
)

Parameters

slice
Type: Slice!(kind, [2], T*)

Input image slice, to be eroded.

kernel
Type: Slice!(kind, [2], T*)

Dilation kernel. Default value is radialKernel!T(3).

prealloc
Type: Slice!(kind, [2], T*)

Optional pre-allocated buffer to hold result.

pool
Type: TaskPool

Optional TaskPool instance used to parallelize computation.

Return Value

Type: Slice!(kind, [2], T*)

Dilated image slice, of same type as input image.

Meta