资源简介
盲反卷积算法复原图像,可直接对现实中拍摄的模糊图像进行反卷积,对模糊图像进行清晰化,代码MATLAB 附有讲解 适合初学者,还有很多改进空间
代码片段和文件信息
%% Deblurring Images Using the Blind Deconvolution Algorithm
%%盲反卷积算法复原图像
% The Blind Deconvolution Algorithm can be used effectively when no
% information about the distortion (blurring and noise) is known. The
% algorithm restores the image and the point-spread function (PSF)
% simultaneously. The accelerated damped Richardson-Lucy algorithm is used
% in each iteration. Additional optical system (e.g. camera)
% characteristics can be used as input parameters that could help to
% improve the quality of the image restoration. PSF constraints can be
% passed in through a user-specified function
%在不知道图像失真信息(模糊和噪声)信息情况下,盲反卷积算法可以有效地加以利用。该算法
%对图像和点扩展函数(PSF)的同时进行复原。每次迭代都使用加速收敛Richardson-Lucy
%算法。额外的光学系统(如照相机)的特性可作为输入参数,帮助改善图像复原质量。可以通
%过用户指定的函数对PSF进行限制
% Copyright 2004-2005 The MathWorks Inc.
%% Step 1: Read Image
%%第一步:读取图像
% The example reads in an intensity image. The |deconvblind| function can
% handle arrays of any dimension.
%该示例读取一个灰度图像。| deconvblind |函数可以处理任何维数组。
I = imread(‘cameraman.tif‘);
figure;imshow(I);title(‘Original Image‘);
text(size(I2)size(I1)+15 ...
‘Image courtesy of Massachusetts Institute of Technology‘ ...
‘FontSize‘7‘HorizontalAlignment‘‘right‘);
%% Step 2: Simulate a Blur
%%第二步:模拟一个模糊
% Simulate a real-life image that could be blurred (e.g. due to camera
% motion or lack of focus). The example simulates the blur by convolving a
% Gaussian filter with the true image (using |imfilter|). The Gaussian filter
% then represents a point-spread function |PSF|.
%模拟一个现实中存在的模糊图像(例如,由于相机抖动或对焦不足)。这个例子通过对真实
%图像进行高斯滤波器模拟图像模糊(使用|imfilter|)。高斯滤波器是一个点扩展函数,
%|PSF|。
PSF=fspecial(‘gaussian‘710);
Blurred=imfilter(IPSF‘symmetric‘‘conv‘); %对图像I进行滤波处理;
figure;imshow(Blurred);title(‘Blurred Image‘);
%% Step 3: Restore the Blurred Image Using PSFs of Various Sizes
%%第三步:使用不同的点扩展函数复原模糊图像
% To illustrate the importance of knowing the size of the true PSF this
% example performs three restorations. Each time the PSF reconstruction
% starts from a uniform array--an array of ones.
%为了说明知道真实PSF的大小的重要性,这个例子执行三个修复。PSF函数重建每次都是从统一
%的全一数组开始。
%%
% The first restoration |J1| and |P1| uses an undersized array |UNDERPSF| for
% an initial guess of the PSF. The size of the UNDERPSF array is 4 pixels
% shorter in each dimension than the true PSF.
%第一次复原,|J1|和|P1|,使用一个较小数组,| UNDERPSF |,来对PSF的初步猜测。该
%UNDERPSF数组每维比真实PSF少4个元素。
UNDERPSF = ones(size(PSF)-4);
[J1 P1] = deconvblind(BlurredUNDERPSF);
figure;imshow(J1);title(‘Deblurring with Undersized PSF‘);
%%
% The second restoration |J2| and |P2| uses an array of ones |OVERPSF| for an
% initial PSF that is 4 pixels longer in each dimension than the true PSF.
%第二次复原,|J2|和|P2|,使用一个元素全为1的数组,| OVERPSF|,初始PSF每维比真
%实PSF多4个元素。
OVERPSF = padarray(UNDERPSF[4 4]‘replicate‘‘both‘);
[J2 P2] = deconvblind(BlurredOVERPSF);
figure;imshow(J2);title(‘Deblurring with Oversized PSF‘);
%%
% The third restoration |J3| and |P3| uses an array of ones |INITPSF| for an
%
- 上一篇:变分法水平集matlab代码
- 下一篇:切趾光纤光栅仿真
相关资源
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
- k近邻算法matlab实现
- matlab识别系统
评论
共有 条评论