DIPlib Documentation - ©1995-2010 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
DIP_SEM_PARABOLIC_SEPARABLEFits a parabola to 3 pixels around the extremum
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.

SEE ALSO

SubpixelMaxima, SubpixelMinima