LBitmap::BitmapWienerFilter

Summary

Applies a Wiener filter to an image to de-blur it.

Syntax

#include "ltwrappr.h"

virtual L_INT LBitmap::BitmapWienerFilter(PSF, NoiseToSignalRatio, uFlags)

Parameters

POINTSPREADFUNCTION PSF

Pointer to a structure.

L_DOUBLE NoiseToSignalRatio

The noise-to-signal power ratio of the additive noise in the original image.

L_UINT uFlags

Reserved for future use.

Returns

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

Comments

The Wiener filter can be useful when the point spread function and added noise are either known or can be estimated.

Use the Run method to apply the Wiener filter on the distorted image.

This function supports 24-bit color images and 8-bit grayscale images.

This function does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this function.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

L_INT LBitmap__BitmapWienerFilterExample() 
{ 
   L_INT nRet; 
   LBitmap LeadBitmap; 
    
   nRet = LeadBitmap.Load(MAKE_IMAGE_PATH(TEXT("IMAGE1.CMP")), 0,ORDER_BGR); 
   if(nRet !=SUCCESS) 
      return nRet; 
 
   pPOINTSPREADFUNCTION pPointSpreadFunction = { 0 }; 
 
   nRet = LeadBitmap.CreatePreDefinedFilter(&pPointSpreadFunction, 5, 0.8, CREATE_MOTION_FILTER); 
   if (nRet != SUCCESS) 
   { 
      LeadBitmap.Free(); 
      return nRet; 
   } 
 
   nRet = LeadBitmap.BitmapWienerFilter(*pPointSpreadFunction, 0.001, 0); 
 
   if (nRet == SUCCESS) 
      LeadBitmap.Save(MAKE_IMAGE_PATH(TEXT("test.cmp")), FILE_CMP, 24, 2, NULL); 
 
   LeadBitmap.FreePredefinedFilter(pPointSpreadFunction); 
   LeadBitmap.Free(); 
   return nRet; 
} 
Help Version 22.0.2023.2.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 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.