DIPlib Documentation - ©1995-2013 Quantitative Imaging Group, Delft University of Technology.

# SubpixelMaxima

Gets coordinates of local maxima with sub-pixel precision

## SYNOPSIS

`#include "dip_analysis.h"`

dip_Error dip_SubpixelMaxima ( in, mask, out_coord, out_val, method )

## DATA TYPES

integer, float

## FUNCTION

Detects local maxima in the image, and returns their coordinates, with sub-pixel precision, in the output image `out_coord`. Only pixels where `mask` is on will be examined. Local maxima are detected using `Maxima`, then their position is determined accurately using `SubpixelLocation`. `out_coord` will have `ndims` pixels along the first dimension (`ndims` being the number of dimensions in `in`), and as many pixels along the second dimension as there are local maxima in `in`. Thus, each row of the image `out_coord` contains the coordinates of one local maximum. `out_coord` is always `dip_float`. `out_val`, when not `0`, will contain the interpolated values of the image at the local maxima. `out_val` will have the same size and type as `out_coord`, except only one pixel along the first dimension.

A local maximum can not touch the edge of the image. That is, its integer location must be one pixel away from the edge.

See `SubpixelLocation` for the definition of the `method` parameter.

## ARGUMENTS

Data type | Name | Description
`dip_Image` | `in` | Input grayscale image
`dip_Image` | `mask` | Binary mask for ROI processing
`dip_Image` | `out_coord` | Output coordinates, image will be N_dims x N_maxima
`dip_Image` | `out_val` | Output values, image will be 1 x N_maxima
`dipf_SubpixelExtremumMethod` | `method` | Sub-pixel detection method

## SEE ALSO

`SubpixelMinima`, `SubpixelLocation`, `Maxima`