extrema2dC {EMD}R Documentation

Finding Local Extrema

Description

This function finds the two dimensional local extrema.

Usage

extrema2dC(z, nnrow=nrow(z), nncol=ncol(z))

Arguments

z matrix of an input image
nnrow the number of row of an input image
nncol the number of column of an input image

Details

This function finds the two dimensional local extrema using Rem's algorithm

Value

minindex index of minima. Each row specifies index of local minimum.
maxindex index of maxima. Each row specifies index of local maximum.

See Also

extrema, , extractimf2d, emd2d.

Examples

data(lena)
z <- lena[seq(1, 512, by=4), seq(1, 512, by=4)]

par(mfrow=c(1,3), mar=c(0, 0.5, 2, 0.5))
image(z, main="Lena", xlab="", ylab="", col=gray(0:100/100), axes=FALSE)    

#example <- extrema2dC(z=z)
#localmin <- matrix(256, 128, 128)
#localmin[example$minindex] <- z[example$minindex]
#image(localmin, main="Local minimum", xlab="", ylab="", 
#col=gray(0:100/100), axes=FALSE)

#localmax <- matrix(0, 128, 128)
#localmax[example$maxindex] <- z[example$maxindex]
#image(localmax, main="Local maximum", xlab="", ylab="", 
#col=gray(0:100/100), axes=FALSE)

[Package EMD version 1.2.0 Index]