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

ConvexHullGetFeret

Convex hull measurement function

SYNOPSIS

#include "dip_chaincode.h"

dip_Error dip_ConvexHullGetFeret ( polygon, feret )

FUNCTION

This function measures the longest and shortest projections of the object encoded by polygon. A "rotating calipers" algorithm finds all antipodal edges and vertices. Then the distances between each of these pairs is computed. These distances correspond to the lengths of the projection under an orientation perpendicular to the edge used. The maximum and minimum distance, as well as the corresponding orientations, are returned in the feret structure, which contains the following elements:

Data typeNameDescription
dip_floatmaxDiameterThe widest projection of the object
dip_floatminDiameterThe narrowest projection of the object
dip_floatmaxPerpendicularThe width of the projection perpendicular to minDiameter
dip_floatmaxAngleThe angle of the projection for maxDiameter
dip_floatminAngleThe angle of the projection for minDiameter

ConvexHullGetFeret is the function used by Measure for the FeatureFeret measurement.

ARGUMENTS

Data typeNameDescription
dip_PolygonpolygonInput convex polygon
dip_Feret*feretOutput measurements

NOTE

This function is more accurate than ChainCodeGetFeret, given a correct polygonal representation of the convex hull of the object. Because antipodal pairs are identified, and the angle of the edges is used, this algorithm doesn't depend on an angle step size, as ChainCodeGetFeret does.

LITERATURE

Algorithm A3.7 in M.I. Shamos, "Computational geometry," Ph.D. thesis, Yale University, 1978.

SEE ALSO

ChainCodeConvexHull, ConvexHullGetArea, ConvexHullGetPerimeter, ChainCodeGetFeret