Find local spatial maximas.
Local spatial maximas should not be mistaken with regional maxima.
See imregionalmax
for the later.
A local spatial maxima is defined as an image point with a value that is larger than all neighbouring values in a square region of width 2*radius+1. By default radius is 1, such that a 3 by 3 neighbourhood is searched. If the thresh input argument is supplied, only local maximas with a value greater than thresh are retained.
The output vectors r and c contain the row-column coordinates of the local maximas. The actual values are computed to sub-pixel precision by fitting a parabola to the data around the pixel. If im is N-dimensional, then N vectors will be returned.
If im is N-dimensional, and N+1 outputs are requested, then the last output will contain the image values at the maximas. Currently this value is not interpolated.
See also: imregionalmax, ordfilt2, ordfiltn.
Package: image