contextualMF {imagine} | R Documentation |
This function performs the Contextual Median Filter proposed by Belkin & O'Reilly (2009), based on the pseudo-code written on the paper.
contextualMF(X, times = 1, na = NA)
X |
A |
times |
How many times do you want to apply the filter? |
na |
|
The users can change the number of recursive applications by using times
argument
(times = 1
as default).
contextualMF
returns a matrix
object with the same dimensions
of X
.
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).
# 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))