virtual L_INT LBitmap::BitmapWienerFilter(PSF, NoiseToSignalRatio, uFlags)
Applies a Wiener filter to an image to de-blur it.
Pointer to a structure.
The noise-to-signal power ratio of the additive noise in the original image.
Reserved for future use.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 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.
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.
Win32, x64.
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 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