#include "Ltimgcor.h"

L_LTIMGCOR_API L_INT L_LambdaConnectedness(pBitmap, lambdaVal)


pointer to the bitmap handle

L_INT lambdaVal;

represents Lambda factor

Performs image segmentation using a special region-growing algorithm called Lambda Connectedness.




Pointer to the bitmap handle referencing the bitmap to be converted.


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


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.

See Also

Functions: L_LevelsetBitmapRgnL_ShrinkWrapTool, L_WatershedBitmap, L_KMeansBitmapSegmentation, L_GWireGetMinPathL_OtsuThreshold
Topics: Raster Image Functions: Image Analysis
Processing an Image


This example loads a bitmap and applies lambda segmentation.

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 
    return SUCCESS; 

Help Version 20.0.2018.7.30
Products | Support | Contact Us | Copyright Notices
© 1991-2018 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help