contextualMF {imagine}R Documentation

Performs Contextual Median Filter

Description

This function performs the Contextual Median Filter proposed by Belkin & O'Reilly (2009), based on the pseudo-code written on the paper.

Usage

contextualMF(X, times = 1, na = NA)

Arguments

X

A numeric matrix object used for apply filters.

times

How many times do you want to apply the filter?

na

NA as default. But, if specified, it must be an integer value higher than the maximum of X.

Details

The users can change the number of recursive applications by using times argument (times = 1 as default).

Value

contextualMF returns a matrix object with the same dimensions of X.

References

Belkin, I. M., & O'Reilly, J. E. (2009). An algorithm for oceanic front detection in chlorophyll and SST satellite imagery. Journal of Marine Systems, 78(3), 319-326 (http://dx.doi.org/10.1016/j.jmarsys.2008.11.018).

Examples

# Generate example matrix
nRows <- 50
nCols <- 100

myMatrix <- matrix(runif(nRows*nCols, 0, 100), nrow = nRows, ncol = nCols)

# Make convolution
myOutput <- contextualMF(X = myMatrix)

# Plot results
image(myOutput, zlim = c(0, 100))

[Package imagine version 1.5.2 Index]