Woolz Image Processing Version 1.4.0
|
Data Structures | |
struct | _WlzChord |
A cord described by the equation:
| |
struct | _WlzConvHullValues |
A 2D convex hull. Typedef: WlzConvHullValues. More... | |
Files | |
file | WlzConvexHull.c |
Functions for computing the convex hull of objects. | |
file | WlzConvexHullClarkson.c |
Functions to compute convex hulls using the Clarkson's algorithm. | |
file | WlzMwrAngle.c |
Computes the minimum width rectangle from a convex hull. | |
Functions | |
WlzObject * | WlzObjToConvexHull (WlzObject *obj, WlzErrorNum *dstErr) |
Computes the convex hull of the given object. | |
WlzObject * | WlzObjToConvexPolygon (WlzObject *obj, WlzErrorNum *dstErr) |
Construct the minimal convex polygonal cover from interval domain. | |
int | WlzConvHullClarkson2D (WlzDVertex2 *vtx, int n, int **dstIdx, WlzErrorNum *dstErr) |
Computes the convex hull of a given array of vertices which is returned as an array of indices into the array of vertices. This index array should be freed using AlcFree(). The vertex array is not changed. | |
double | WlzMwrAngle (WlzObject *cvh, WlzErrorNum *dstErr) |
extract angle (as scaled sin, cos) of minimum width rectangle from convex hull (it is relatively obvious that minimum width rectangle long side must be parallel to a chord of convex hull, and all sides must have at least one vertex of convex hull lying within them). |
WlzObject* WlzObjToConvexHull | ( | WlzObject * | obj, |
WlzErrorNum * | dstErr | ||
) |
Computes the convex hull of the given object.
obj | Given object. |
dstErr | Destination error pointer, may be NULL. |
References _WlzValues::c, _WlzObject::domain, _WlzDomain::p, _WlzPlaneDomain::type, _WlzObject::type, _WlzObject::values, WLZ_2D_POLYGON, WLZ_3D_DOMAINOBJ, WLZ_CONV_HULL, WLZ_ERR_NONE, WLZ_PLANEDOMAIN_CONV_HULL, WlzAssignValues(), and WlzObjToConvexPolygon().
WlzObject* WlzObjToConvexPolygon | ( | WlzObject * | obj, |
WlzErrorNum * | dstErr | ||
) |
Construct the minimal convex polygonal cover from interval domain.
obj | Given object. |
dstErr | Destination error pointer, may be NULL. |
References _WlzValues::core, _WlzDomain::core, _WlzObject::domain, _WlzDomain::i, _WlzIntervalWSpace::intrmn, _WlzIntervalDomain::lastln, _WlzIntervalWSpace::lftpos, _WlzIntervalDomain::line1, _WlzIntervalWSpace::linpos, _WlzPolygonDomain::nvertices, _WlzIntervalWSpace::nwlpos, _WlzValues::obj, _WlzDomain::p, _WlzDomain::poly, _WlzIntervalWSpace::rgtpos, _WlzPlaneDomain::type, _WlzObject::type, _WlzObject::values, _WlzIVertex2::vtX, _WlzPolygonDomain::vtx, _WlzIVertex2::vtY, WLZ_2D_DOMAINOBJ, WLZ_2D_POLYGON, WLZ_3D_DOMAINOBJ, WLZ_EMPTY_OBJ, WLZ_ERR_DOMAIN_NULL, WLZ_ERR_DOMAIN_TYPE, WLZ_ERR_EOO, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, WLZ_ERR_OBJECT_TYPE, WLZ_PLANEDOMAIN_DOMAIN, WLZ_POLYGON_INT, WLZ_RASTERDIR_DLDC, WLZ_RASTERDIR_ILIC, WLZ_TRANS_OBJ, WlzInitRasterScan(), WlzMakeEmpty(), WlzMakeMain(), WlzMakePolygonDomain(), and WlzNextInterval().
Referenced by WlzObjToConvexHull().
int WlzConvHullClarkson2D | ( | WlzDVertex2 * | vtx, |
int | n, | ||
int ** | dstIdx, | ||
WlzErrorNum * | dstErr | ||
) |
Computes the convex hull of a given array of vertices which is returned as an array of indices into the array of vertices. This index array should be freed using AlcFree(). The vertex array is not changed.
vtx | Given array of vertices. |
n | Number of vertices in the given array. |
dstIdx | Destination pointer for array of indices to the convex hull vertices. The convex hull vertices are ordered counter-clockwise. |
dstErr | Destination error pointer, may be NULL. |
References AlcFree(), AlcMalloc(), WLZ_CONVHULL_CLARKSON_SM_2D, WLZ_ERR_MEM_ALLOC, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, and WLZ_ERR_PARAM_NULL.
Referenced by WlzGeomInterpolatePoly2D().
double WlzMwrAngle | ( | WlzObject * | cvh, |
WlzErrorNum * | dstErr | ||
) |
extract angle (as scaled sin, cos) of minimum width rectangle from convex hull (it is relatively obvious that minimum width rectangle long side must be parallel to a chord of convex hull, and all sides must have at least one vertex of convex hull lying within them).
cvh | input convex hull |
dstErr | destination error |
References _WlzChord::acon, _WlzChord::bcon, _WlzValues::c, _WlzConvHullValues::ch, _WlzObject::domain, _WlzConvHullValues::nchords, _WlzDomain::poly, _WlzObject::type, _WlzObject::values, WLZ_CONV_HULL, WLZ_EMPTY_OBJ, WLZ_ERR_NONE, WLZ_ERR_OBJECT_NULL, and WLZ_ERR_OBJECT_TYPE.