L_LTIMGEFX_API L_INT L_GetFeretsDiameter (pPoints, uSize, puFeretsDiameter, puFirstIndex, puSecondIndex, uFlags)
Computes the Ferets diameter of an object (the maximum distance between the points of the perimeter of the region), and finds its end points.
Pointer to an array of object contour coordinate points.
Pointer to a variable to be updated with the length of the Ferets diameter. The length is measured in pixels and is internally multiplied by 1000. Divide this value by 1000 to obtain the real length.
Pointer to a variable to be updated with index of the first end point of the Ferets diameter.
Pointer to a variable to be updated with index of the second end point of the Ferets diameter.
Reserved for future use. Must be 0.
|SUCCESS||The function was successful.|
|< 1||An error occurred. Refer to Return Codes.|
This function does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this function.
This function calculates the Feret's Diameter (caliper length), the longest distance between any two points along the boundary. This is equivalent to the minimum diameter of a tube through which this object can pass.
This function does not call the status callback.
Required DLLs and Libraries
BITMAPHANDLE LeadBitmap; /* Bitmap handle for the image */
POINT * pPoints;
L_UINT uSize, uFeretsDiam, uFstIndex, uSndIndex;
/* Load a bitmap at its own bits per pixel */
nRet = L_LoadBitmap (MAKE_IMAGE_PATH(TEXT("Cannon.jpg")), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
rcRect.top = LeadBitmap.Height/4;
rcRect.bottom = LeadBitmap.Height*3/4;
rcRect.left = LeadBitmap.Width/4;
rcRect.right = LeadBitmap.Width*3/4;
nRet = L_SetBitmapRgnEllipse (&LeadBitmap, NULL, &rcRect, L_RGN_SET);
nRet = L_GetRgnContourPoints (&LeadBitmap, NULL, &pPoints, &uSize, RGNCONTOUR_ALL);
nRet = L_GetFeretsDiameter (pPoints, uSize, &uFeretsDiam, &uFstIndex, &uSndIndex, 0);
Medical Web Viewer .NET
.NET, Java, Android, and iOS/macOS Assemblies
C API/C++ Class Libraries