Skip to contents

Uses EBImage::medianFilter (C-based, fast) when EBImage is available, otherwise falls back to a pure-R sliding-window implementation.

Usage

median_filter_3x3(img)

Arguments

img

Numeric matrix (height x width).

Value

Filtered matrix of the same dimensions.

Examples

m <- matrix(runif(100), 10, 10)
m_filt <- median_filter_3x3(m)