#include "Ltimgcor.h"
L_LTIMGCOR_API L_INT L_LambdaConnectedness(pBitmap, lambdaVal)
pBITMAPHANDLE pBitmap; |
pointer to the bitmap handle |
L_INT lambdaVal; |
represents Lambda factor |
Performs image segmentation using a special region-growing algorithm called Lambda Connectedness.
Parameter |
Description |
pBitmap |
Pointer to the bitmap handle referencing the bitmap to be converted. |
lambdaVal |
Valid values for Lambda range from 1 to 1000. By default, the value is 950, Small values of lambda can result in one region. Large values can result in an over-segmented image. |
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
Lambda-connectedness is a technique used to find the connectivity between an image's pixels and then clusters them into groups.
Low values for lambda can result in one region.
High values for lambda can result in an over-segmented image.
This function can only process entire images. It does not support regions.
This function supports 12- and 16-bit grayscale and 48- and 64-bit color images.
This command supports signed/unsigned images.
Required DLLs and Libraries
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. |
Win32, x64, Linux.
Functions: | L_LevelsetBitmapRgn, L_ShrinkWrapTool, L_WatershedBitmap, L_KMeansBitmapSegmentation, L_GWireGetMinPath, L_OtsuThreshold |
Topics: | Raster Image Functions: Image Analysis |
Processing an Image |
#define MAKE_IMAGE_PATH(pFileName) TEXT("C:\\Users\\Public\\Documents\\LEADTOOLS Images\\")pFileName
L_INT LambdaConnectednessExample(L_VOID)
{
L_INT nRet;
BITMAPHANDLE LeadBitmap; /* Bitmap handle to hold the loaded image. */
/* Load the bitmap, keeping the bits per pixel of the file */
nRet = L_LoadBitmap (MAKE_IMAGE_PATH(TEXT("ImageProcessingDemo\\NaturalFruits.jpg")), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
if(nRet != SUCCESS)
return nRet ;
// apply lambda filter
nRet = L_LambdaConnectedness(&LeadBitmap, 985);
if(nRet != SUCCESS)
return nRet;
nRet = L_SaveBitmap(MAKE_IMAGE_PATH(TEXT("Result.BMP")), &LeadBitmap, FILE_BMP, 24, 0, NULL);
if(nRet !=SUCCESS)
return nRet ;
//free bitmap
if(LeadBitmap.Flags.Allocated)
L_FreeBitmap(&LeadBitmap);
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