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 filter type */

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

Value that determine the type of filter that will be used when applying the MultiScale enchancment filter, one or more flag can be used. Possible values are:

 

Flags

Meaning

 

MSE_GAUSSIAN

[0x0000] Uses Gaussian filter.

 

MSE_RESAMPLE

[0x0001] Uses Resmaple filter.

 

MSE_BICUBIC

[0x0002] Uses Bicubic filter.

 

MSE_NORMAL

[0x0003] Uses Normal filter.

 

MSE_EDGEENH

[0x0010] Adds the latitude reduction option. When this flag is set, the uLatitudeLevels and uLatitudeCoeff parameters will be used.

 

MSE_LATRED

[0x0020] Adds the edge enhancement option. When this flag is set, the uEdgeLevels and uEdgeCoeff properties will be used.

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

Win32, x64.

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 (MAKE_IMAGE_PATH(TEXT("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(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;
}