dip::ConvexHull class

A convex hull is a convex polygon. It can be constructed from a dip::Polygon, and a const reference to the underlying dip::Polygon object can be obtained. It is guaranteed clockwise.

Constructors, destructors, assignment and conversion operators

ConvexHull() defaulted
Default-constructed ConvexHull (without vertices)
ConvexHull(dip::Polygon const& polygon)
Constructs a convex hull of a polygon

Functions

auto Polygon() const -> dip::Polygon const&
Returns the polygon representing the convex hull
auto Area() const -> dip::dfloat
Returns the area of the convex hull
auto Perimeter() const -> dip::dfloat
Returns the perimeter of the convex hull
auto Feret() const -> dip::FeretValues
Returns the Feret diameters of the convex hull

Function documentation

dip::FeretValues Feret() const

Returns the Feret diameters of the convex hull

The Feret diameters of the convex hull correspond to the Feret diameters of the original polygon. Feret diameters are the lengths of the projections. This function determines the longest and the shortest projections, as well as the length of the projection perpendicular to the shortest.

These values are obtained by enumerating anti-podal pairs using the “rotating calipers” algorithm by Preparata and Shamos (1985).