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

SubpixelLocation

Gets coordinates of an extremum with sub-pixel precision

SYNOPSIS

#include "dip_analysis.h"

dip_Error dip_SubpixelLocation ( in, pos, coords, val, method, polarity )

DATA TYPES

integer, float

FUNCTION

Determines the sub-pixel location of a local maximum or minimum close to pos. pos should point to a pixel that is larger than its direct neighbours (if polarity is DIP_SEP_MAXIMUM) or smaller than its direct neighbours (polarity is DIP_SEP_MINIMUM). coords will contain the the sub-pixel location of this local extremum. val will contain the interpolated grey value at the location of the extremum. method determines which method is used.

ARGUMENTS

Data typeNameDescription
dip_ImageinInput grayscale image
dip_IntegerArrayposInput coordinates
dip_FloatArraycoordsOutput coordinates
dip_float*valOutput grey value
dipf_SubpixelExtremumMethodmethodSub-pixel detection method
dipf_SubpixelExtremumPolaritypolMaximum or minimum?

The dipf_SubpixelExtremumMethod flag can be any of these values:

NameDescription
DIP_SEM_DEFAULTSame as DIP_SEM_PARABOLIC_SEPARABLE.
DIP_SEM_LINEARComputes the center of gravity of 3 pixels around the extremum, in each dimension independently. The val returned is that of the pixel at pos.
DIP_SEM_PARABOLIC_SEPARABLEFits a parabola to 3 pixels around the extremum, for each dimension independently. The val returned is the maximum (minimum) value of these 1D extrema, and thus not equivalent to the grey value obtained by true interpolation.
DIP_SEM_PARABOLICFits a parabolic patch to a region 3x3 or 3x3x3 pixels around the extremum (only for 2D or 3D images).
DIP_SEM_GAUSSIAN_SEPARABLESame as DIP_SEM_PARABOLIC_SEPARABLE, but using the log of the pixel values, very accurate if peak is a Gaussian.
DIP_SEM_GAUSSIANSame as DIP_SEM_PARABOLIC, but using the log of the pixel values (only for 2D or 3D images).
DIP_SEM_BSPLINEFits a B-spline to 11 pixels around the extremum, in each dimension independently. The val returned is the maximum (minimum) value of these 1D extrema, and thus not equivalent to the grey value obtained by true interpolation

SEE ALSO

SubpixelMaxima, SubpixelMinima