L_MultiScaleEnhancementBitmap

#include "l_bitmap.h"

L_LTIMGCOR_API L_INT L_MultiScaleEnhancementBitmap (pBitmap, uContrast, uEdgeLevels, uEdgeCoeff, uLatitudeLevels, uLatitudeCoeff, uFlags)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

L_UINT uContrast;

/* amount of contrast enhancement */

L_UINT uEdgeLevels;

/* number of levels used in edge enhancement */

L_UINT uEdgeCoeff;

/* degree of edge enhancement */

L_UINT uLatitudeLevels;

/* number of levels used in latitude reduction */

L_UINT uLatitudeCoeff;

/* degree of latitude reduction */

L_UINT uFlags;

/* flags that determine function behavior */

Enhances an images contrast, edges, and density range for use in Computed Radiography (CR), in a way that all relevant image features are rendered with an appropriate level of visibility.

Parameter

Description

pBitmap

Pointer to the bitmap handle.

uContrast

Amount of contrast enhancement.

uEdgeLevels

Number of levels used in edge enhancement.

uEdgeCoeff

Degree of edge enhancement.

uLatitudeLevels

Number of levels used in latitude reduction.

uLatitudeCoeff

Degree of latitude reduction.

uFlags

Reserved for future use. Must be 0.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

It also can process the whole image or a region of the image. If a bitmap has a region, the effect is applied only to the region.

This function does not support 32-bit grayscale images. It returns the error code ERROR_GRAY32_UNSUPPORTED if a 32-bit grayscale image is passed to this function.

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.

Platforms

Windows 2000 / XP/Vista.

See Also

Functions:

L_ChangeBitmapContrast, L_ChangeBitmapIntensity, L_GammaCorrectBitmap, L_StretchBitmapIntensity, L_RemapBitmapIntensity, L_InvertBitmap, L_ChangeBitmapHue, L_ChangeBitmapSaturation, L_HistoEqualizeBitmap, L_FillBitmap, L_GetPixelColor, L_PutPixelColor, L_GetBitmapHistogram, L_WindowLevel, L_HistoContrastBitmap, L_AddWeightedBitmaps, L_MultiplyBitmap, L_SelectiveColorBitmap, L_AllocFTArray, L_ChangeHueSatIntBitmap, L_ColorReplaceBitmap, L_ColorThresholdBitmap, L_DirectionEdgeStatisticalBitmap, L_FFTBitmap, L_FreeFTArray, L_FTDisplayBitmap, L_FrqFilterBitmap, L_FrqFilterMaskBitmap, L_MathFunctionBitmap, L_SubtractBackgroundBitmap, L_UserFilterBitmap, L_AdaptiveContrastBitmap, L_ApplyMathLogicBitmap, L_ColorIntensityBalance, L_ColorizeGrayBitmap, L_ContBrightIntBitmap, L_DigitalSubtractBitmap, L_DynamicBinaryBitmap, L_EdgeDetectEffectBitmap, L_FunctionalLightBitmap, L_SelectBitmapData, L_ShiftBitmapData

Topics:

Raster Image Functions: Modifying Intensity Values

 

Removing Noise

Example

This example loads a bitmap and applies multiscale enhancement.

 L_INT MultiScaleEnhancementBitmapExample(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 (TEXT("%UserProfile%\\My Documents\\LEADTOOLS Images\\IMAGE1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGRORGRAY, NULL, NULL); 
   if(nRet !=SUCCESS)
      return nRet;

   // Apply multiscale enhancement
   nRet = L_MultiScaleEnhancementBitmap(&LeadBitmap, 2000, 4, MSE_DEFAULT , 0, 0, MSE_GAUSSIAN | MSE_EDGEENH);
   if(nRet !=SUCCESS)
      return nRet;
   nRet = L_SaveBitmap(TEXT("%UserProfile%\\My Documents\\LEADTOOLS Images\\Result.BMP"), &LeadBitmap, FILE_BMP, 24, 0, NULL);
   if(nRet !=SUCCESS)
      return nRet;
   //free bitmap 
   if(LeadBitmap.Flags.Allocated)  
      L_FreeBitmap(&LeadBitmap);  
   return SUCCESS;
}