#include "ltwrappr.h"
virtual L_INT LBitmap::FreeKmeansOutput(pOutCenters)
L_COLORREF** pOutCenters; |
pointer to kmeans generated clusters |
Frees the data generated by the LBitmap::KMeansBitmapSegmentation function.
Parameter | Description | |
pOutCenters | Pointer to the data generated by the LBitmap::KMeansBitmapSegmentation function. |
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Use this function to free the data generated by the LBitmap::KMeansBitmapSegmentation function.
Required DLLs and Libraries
LTDIS For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
Win32, x64.
#define MAKE_IMAGE_PATH(pFileName) TEXT("C:\\Users\\Public\\Documents\\LEADTOOLS Images\\")pFileName
L_INT LBitmap__FreeKmeansOutputExample()
{
L_INT nRet;
LBitmap LeadBitmap;
nRet =LeadBitmap.Load(MAKE_IMAGE_PATH(TEXT("Clean.tif")), 0, ORDER_BGRORGRAY);
if(nRet !=SUCCESS)
return nRet;
L_UINT nCluster = 4;
L_COLORREF OutCenter = (L_COLORREF) RGB(25,50,70);
L_COLORREF* pOutCenters = &OutCenter;
L_INT nOutCentersCount = -1;
nRet = LeadBitmap.KMeansBitmapSegmentation(nCluster, &pOutCenters, &nOutCentersCount, NULL, KMEANS_RANDOM);
if(nRet != SUCCESS)
return nRet;
//free the pOutCenters data
LeadBitmap.FreeKmeansOutput(pOutCenters);
nRet = LeadBitmap.Save (MAKE_IMAGE_PATH(TEXT("Result.BMP")), FILE_BMP, 24, 0, NULL);
if(nRet !=SUCCESS)
return nRet;
pBITMAPHANDLE pBitmapHandle = LeadBitmap.GetHandle();
//free bitmap
if(pBitmapHandle->Flags.Allocated)
L_FreeBitmap(pBitmapHandle);
return SUCCESS;
}
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET