extrema2dC: Finding Local Extrema

Description Usage Arguments Details Value References See Also Examples

View source: R/EMD2d.R

Description

This function finds the bidimensional local extrema based on the equivalence relation between neighboring pixels.

Usage

1
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 bidimensional local extrema based on the equivalence relation between neighboring pixels. See Kim et al. (2012) for detalis.

Value

minindex

index of minima. Each row specifies index of local minimum.

maxindex

index of maxima. Each row specifies index of local maximum.

References

Kim, D., Park, M. and Oh, H.-S. (2012) Bidimensional Statistical Empirical Mode Decomposition. IEEE Signal Processing Letters, 19, 191–194, doi: 10.1109/LSP.2012.2186566.

See Also

extrema, , extractimf2d, emd2d.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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)

Example output

Loading required package: fields
Loading required package: spam
Loading required package: dotCall64
Loading required package: grid
Spam version 2.2-2 (2019-03-07) is loaded.
Type 'help( Spam)' or 'demo( spam)' for a short introduction 
and overview of this package.
Help for individual functions is also obtained by adding the
suffix '.spam' to the function name, e.g. 'help( chol.spam)'.

Attaching package: 'spam'

The following objects are masked from 'package:base':

    backsolve, forwardsolve

Loading required package: maps
See https://github.com/NCAR/Fields for
 an extensive vignette, other supplements and source code 
Loading required package: locfit
locfit 1.5-9.1 	 2013-03-22

EMD documentation built on Jan. 4, 2022, 1:08 a.m.

Related to extrema2dC in EMD...