LBitmap::SRADAnisotropicDiffusion

Summary

Applies a 2-Dimensional Anisotropic Diffusion filter on an image in order to reduce noise and speckling, while preserving the edges.

Syntax

#include "ltwrappr.h"

virtual L_INT LBitmap::SRADAnisotropicDiffusion(nIter, nLambda, pRect)

Parameters

L_INT nIter

Number of iterations the filter will perform. The default value is 10.

L_INT nLambda

The smoothing time step value. Valid values range from 0 to 100. A value of 0 means nothing will be done to the image. By default, nLambda is set at 50.

LPRECT pRect

The homogeneous region of uniform speckles.

Returns

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

Comments

The Speckle Reducing Anisotropic Diffusion (SRAD) function is similar to the LBitmap::AverageFilter function, but is used to reduce noise and speckling in images while preserving the edges instead of blurring.

LEADTOOLS offers three functions that implement anisotropic diffusion:

All three reduce noise and preserve edges and perform better than the LBitmap::MedianFilter or LBitmap::GaussianFilter functions. With the anisotropic functions, areas within regions are smoothed, but the edges are not affected.

The number of iterations controls the number of times the filter will be applied to an image. The lower the number of iterations, the faster the filter will perform. Higher iterations typically mean clearer results.

This function can only process the entire image. It does not support regions.

This function supports 8- and 16-bit grayscale images and 24- and 32-bit colored images.

This function supports signed/unsigned images.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Example

#if defined (LEADTOOLS_V19_OR_LATER) 
L_INT LBitmap__SRADAnisotropicDiffusionExample(L_VOID) 
{ 
    L_INT nRet; 
    LBitmap LeadBitmap; 
 
    nRet = LeadBitmap.Load(MAKE_IMAGE_PATH(TEXT("IMAGE3.dcm")), 0,ORDER_BGR); 
    if(nRet !=SUCCESS) 
        return nRet ; 
 
    /* Apply SRADAnisotropicDiffusion filter */ 
    RECT rc ; 
    rc.left   = 150; 
    rc.right  = 180; 
    rc.top    = 300; 
    rc.bottom = 330; 
    nRet = LeadBitmap.SRADAnisotropicDiffusion(10, 50, &rc); 
 
    return nRet ; 
} 
#endif // LEADTOOLS_V19_OR_LATER 
Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.