medianFilter

Median filtering algorithm.

Slice!(Contiguous, packs, O*)
medianFilter
(
alias BoundaryConditionTest = neumann
T
O = T
SliceKind kind
size_t[] packs
)
(
Slice!(kind, packs, T*) slice
,
size_t kernelSize
,
Slice!(Contiguous, packs, O*) prealloc = emptySlice!(packs, O)
,
TaskPool pool = taskPool
)
in { import std.traits : isAssignable; static assert (isAssignable!(T, O), "Output slice value type is not assignable to the input value type."); static assert (isBoundaryCondition!BoundaryConditionTest, "Given boundary condition test is not DCV valid boundary condition test function."); assert (!slice.empty()); }

Parameters

slice
Type: Slice!(kind, packs, T*)

Input image slice.

kernelSize
Type: size_t

Square size of median kernel.

prealloc
Type: Slice!(Contiguous, packs, O*)

Optional pre-allocated return image buffer.

pool
Type: TaskPool

Optional TaskPool instance used to parallelize computation.

Return Value

Type: Slice!(Contiguous, packs, O*)

Returns filtered image of same size as the input. If prealloc parameter is not an empty slice, and is of same size as input slice, return value is assigned to prealloc buffer. If not, newly allocated buffer is used.

Meta