LBitmap::FreeKmeansOutput

#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.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Use this function to free the data generated by the LBitmap::KMeansBitmapSegmentation function.

Required DLLs and Libraries

LTDIS
LTFIL
LTIMGCOR

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Win32, x64.

See Also

Functions:

LBitmap::LevelsetBitmapRgn, LBitmap::LambdaConnectedness, LBitmap::ShrinkWrapTool, LBitmap::WatershedBitmap, LBitmap::KMeansBitmapSegmentation, LBitmap::GWireGetMinPath, Class Members

Topics: Raster Image Functions: Image Analysis
Processing an Image

Example

#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; 
} 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Raster Imaging C++ Class Library Help