#include "l_ltimgcor.h"
L_LTIMGCOR_API L_INT L_BitmapWienerFilter(pBitmap, pPSF, dNoiseToSignalRatio, uFlags)
Applies a Wiener filter to an image to de-blur it.
Pointer to the bitmap handle referencing the bitmap to which the Wiener filter will be applied.
Pointer to a POINTSPREADFUNCTION structure.
The noise-to-signal power ratio of the additive noise in the original image.
Reserved for future use.
Value | Meaning |
---|---|
SUCCESS | |
< 1 | An error occurred. Refer to Return Codes. |
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.
Use the L_BitmapAdaptiveWienerFilter to remove noise from images. Use the L_BitmapWienerFilter to de-blur an 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
Win32, x64, Linux.
L_INT BitmapWienerFilterExample(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_BGR, NULL, NULL);
if(nRet !=SUCCESS)
return nRet;
pPOINTSPREADFUNCTION pPointSpreadFunction = { 0 };
nRet = L_CreatePreDefinedFilter(&pPointSpreadFunction, 5, 0.8, CREATE_MOTION_FILTER);
if (nRet != SUCCESS)
{
L_FreeBitmap(&LeadBitmap);
return nRet;
}
nRet = L_BitmapWienerFilter(&LeadBitmap, *pPointSpreadFunction, 0.001, 0);
if (nRet == SUCCESS)
L_SaveBitmap(MAKE_IMAGE_PATH(TEXT("test.cmp")), &LeadBitmap, FILE_CMP, 24, 2, NULL);
L_FreePredefinedFilter(pPointSpreadFunction);
L_FreeBitmap(&LeadBitmap);
return nRet;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document