L_LambdaConnectedness

#include "Ltimgcor.h"

L_LTIMGCOR_API L_INT L_LambdaConnectedness(pBitmap, lambdaVal)

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

Parameters

pBITMAPHANDLE pBitmap

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

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

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

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

Platforms

Win32, x64, Linux.

See Also

Functions

Topics

Example

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 
    if(LeadBitmap.Flags.Allocated) 
        L_FreeBitmap(&LeadBitmap); 
    return SUCCESS; 
} 

Help Version 20.0.2019.12.5
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help