Main Content

deconvwnr

Deblur image using Wiener filter

描述

例子

j= deconvwnr(,,,,PSF,,,,NSRdeconvolves image使用Wiener滤波器算法,返回Deblurred图像jPSF是点传播功能(PSF)was convolved.NSRis the noise-to-signal power ratio of the additive noise. The algorithm is optimal in a sense of least mean square error between the estimated and the true images.

j= deconvwnr(,,,,PSF,,,,ncorr,,,,icorrdeconvolves image, 在哪里ncorr是噪声和icorris the autocorrelation function of the original image.

j= deconvwnr(,,,,PSFdeconvolves image使用无估计噪声的Wiener滤波器算法。在没有噪声的情况下,维纳过滤器等效于理想的反过滤器。

例子

全部收缩

Read image into the workspace and display it.

i = im2double(imread('cameraman.tif');imshow(i);标题(“原始图像(由麻省理工学院提供)”);

图包含一个坐标轴对象。坐标轴对象with title Original Image (courtesy of MIT) contains an object of type image.

模拟运动模糊。

len = 21;theta = 11;psf = fspecial('运动',Len,Theta);模糊= imfilter(i,psf,'conv',,,,'圆');图,Imshow(模糊)

图包含一个坐标轴对象。轴对象包含类型图像的对象。

Simulate additive noise.

noise_mean = 0; noise_var = 0.0001; blurred_noisy = imnoise(blurred,“高斯”,,,,...noise_mean, noise_var); figure, imshow(blurred_noisy) title(“模拟模糊和噪音”

图包含一个坐标轴对象。坐标轴对象with title Simulate Blur and Noise contains an object of type image.

Try restoration assuming no noise.

estated_nsr = 0;wnr2 = deconvwnr(blurred_noisy,psf,estected_nsr);图,imshow(WNR2)标题('Restoration of Blurred, Noisy Image Using NSR = 0'

图包含一个坐标轴对象。使用nsr = 0的模糊,嘈杂图像的标题恢复的轴对象包含一个类型图像的对象。

尝试更好地估计噪声与信号功率比率的恢复。

estionated_nsr = noings_var / var / var(i(:));wnr3 = deconvwnr(blurred_noisy,psf,estionated_nsr);图,imshow(WNR3)标题(“使用估计的NSR恢复模糊,嘈杂的图像”);

图包含一个坐标轴对象。坐标轴对象with title Restoration of Blurred, Noisy Image Using Estimated NSR contains an object of type image.

输入参数

全部收缩

模糊图像,指定为任何维数的数字阵列。

数据类型:单身的|双倍的|int16|UINT8|UINT16

点传播函数,指定为数字阵列。

数据类型:双倍的

噪声与信号比率,,,,specified as a nonnegative scalar or numeric array of the same size as the image,。如果NSR是一个数组,然后代表光谱域。指定0for theNSRis equivalent to creating an ideal inverse filter.

数据类型:双倍的

噪声的自相关功能,,,,specified as a numeric array of any size or dimension, not exceeding the original image.

  • 如果尺寸ncorr匹配图像的维度,然后这些值对应于每个维度内的自相关。

  • 如果ncorr是向量和PSF也是向量,然后是ncorrrepresent the autocorrelation function in the first dimension.

  • 如果ncorr是向量和PSF是一个数组,然后通过对称性将1-D自相关函数推到所有非单明子尺寸PSF

  • 如果ncorr是标量,然后值表示图像噪声的幂。

数据类型:双倍的

图像的自相关函数,指定为任何大小或尺寸的数字阵列,不超过原始图像。

  • 如果尺寸icorr匹配图像的维度,然后这些值对应于每个维度内的自相关。

  • 如果icorr是向量和PSF也是向量,然后是icorrrepresent the autocorrelation function in the first dimension.

  • 如果icorr是向量和PSF是一个数组,然后通过对称性将1-D自相关函数推到所有非单明子尺寸PSF

  • 如果icorr是标量,然后值表示图像噪声的幂。

数据类型:双倍的

输出参数

全部收缩

Deblurred图像,返回为数字阵列。jhas the same data type as

提示

  • 输出图像jcould exhibit ringing introduced by the discrete Fourier transform used in the algorithm. To reduce the ringing, usei = edgetaper(i,psf)打电话之前deconvwnr

References

[1]Gonzalez,R。C.和R. E. Woods。数字图像处理。Addison-Wesley Publishing Company,Inc.,1992年。

版本历史记录

我ntroduced before R2006a