




已阅读5页,还剩17页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
上次: 一、引言二、图像运算三、图像变换四、图像增强五、二值形态学及其应用六、图像复原图像复原又称图像恢复,是图像处理中的重要技术。所谓的图像复原就是在研究图像退化原因的基础上,以退化图像为依据,根据一定的先验知识设计一种算子,从而估计出理想场景的操作。为了刻画成像系统的特征,通常将成像系统看成是一个线性平移不变系统(因为线性平移不变系统已经有了完整的理论体系,能使用F-变换,便于谱域处理,便于计算机处理,而且能够反映出系统的主要特性),从中推导出物体输入与图像的输出关系的通用数学表达式,从而建立成像系统的退化模型,在此基础上研究图像的复原技术。图像复原在电子监测、医疗摄像等领域具有重要用途。景物在成像过程中可能出现畸变、模糊、失真或混入噪声,使所得成像图像降质,这种现象称为图像退化。图像复原的关键是在于建立图像退化模型。1图像退化模型图像复原一定是建立在图像退化的数学模型基础上的,这个退化数学模型应该能够反映退化的原因。h(x,y)f(x,y) f*(x,y) g(x,y) n(x,y) 输入图像图经过一个退化系统,输出图像为,即叠加系统噪声,就构成了退化图像,即 而 (1.0)表示的是一副退化图像,式中一般假设系统噪声为加性噪声,且为白噪声。上图表示的就是图像的退化模型。从上图中可以看出,图像的退化就是成像系统的退化加上额外的系统噪声而形成的,根据这个模型可知,图像复原就是在退化图像的基础上已知成像系统和系统噪声,然后进行反演运算,得到一个的最佳估计。或图像复原就是在退化图像经过复原滤波器,得到恢复的图像,即由于数字图像都是离散的,所以在实际应用中都是采用的离散形式进行计算,退化图像其表达形式如下: (1.1)式中,函数,分别是周期为M和N的函数。是与,具有相同周期的函数,将函数矩阵,和各行堆叠成维列向量分别记为:,则(1.1)式写成矩阵形式为: (1.2)其中H为维矩阵。H包括个子矩阵,每个子矩阵的大小为,排列顺序如下:式中每一个子矩阵都是由的第j行元素构成的上述离散图像退化模型是在线性平移不变性的条件下得到的。图像复原就是根据给定的g,利用H和n来估计f。但是对于实际应用,直接估计出是一项十分繁杂的计算工作,必须寻找简化实现的方法。(讲)上面为时域模型,而频域模型为:,而 (1.3)(讲)因为点光源可近似为一个单位脉冲,而单位脉冲响应即点冲激响应的F-变换为,可表示为点冲激响应函数的退化模型。点冲激响应的退化函数也称为点扩展函数简称PSF,PSF决定了系统的成像质量。(讲)图像复原过程中的主要困难有两点:其一,要确定引起退化的点扩散函数h(x,y)。分两种情况:1)如果对于图像缺乏先验知识,则退化过程(模糊和加噪)建立一个模型,然后寻找产生退化的原因或削弱其影响的逆过程。在这种情况下建立的模型只可能是估计性的,所以其复原工作很困难;2)如果已经具有足够的先验知识,则可以对原始图像建立一个数学模型,并将它与退化图像进行比较,从而找出退化的因素来确定点扩散函数。其二,如果退化模型是一个病态积分方程。这就是说,在频域中,当H(u,v)(h(x,y)的频域)很小或等于零时,噪声将被放大。换句话说,退化模型的这种病态性质意味着退化图像中小的干扰在H(u,v)取值小的那些频谱上会对图像的恢复产生很大的影响,这给图像复原带来不少麻烦。因此,任何一种图像复原的方法都要考虑当存在病态性时如何控制噪声对复原结果的干扰。评价估计效果的标准有很多,不同的复原方法实际上就是针对不同的估计评价准则而言的。例如最小二乘滤波方法原理:(1) 无约束复原方程,求,使称得到的复原图像为原图像的无约束最小二乘滤波方法复原。解:若H可逆,(讲)(2) 有约束复原方程令Q为的线性操作数向量,求,使 且满足约束条件。称得到的复原图像为原图像的有约束最小二乘滤波方法复原。解:用Lagrange乘数法解条件极值取准则函数:其中为Lagrange乘数。实际上来调节参数和Q,设法得到最佳的。(讲)在matlab中:有四种算法对图像复原处理:带约束的最小二乘滤波算法维纳滤波算法盲去卷积算法Lucy-Richardson迭代算法可以通过调用deconvreg函数,其利用带约束的最小二乘滤波方法对图像复原处理。可以通过调用deconvwnr函数,其利用维纳滤波方法对图像复原处理。当图像的频率特性和噪声已知时,维纳滤波的效果非常好。但是实际生活中,这些特征我们是不知道的,因此我们必须对这些特性作出模糊的估计以求达到最佳复原效果。可以通过调用deconvblind函数,该函数使用盲去卷积算法,可以在对失真(包括有噪声和模糊的情况下)毫无所知的情况下进行复原操作。可以通过调用deconvlucy函数,其利用加速收敛的Lucy-Richardson迭代算法可以对图像进行复原。当PSF已知,但是图像的噪声信息未知时,该算法对图像的复原重建效果是很好的。案例五: Deblurring Images Using the Blind Deconvolution AlgorithmThe 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.Key concepts: blind deconvolution; image recovery; PSF; accelerated, damped Lucy-Richardson algorithm Key functions: deconvblind, edge, imdilate, imfilterdeconvblind Restore image using the blind deconvolution algorithm SyntaxJ,PSF = deconvblind(I,INITPSF)J,PSF = deconvblind(I,INITPSF,NUMIT)J,PSF = deconvblind(I,INITPSF,NUMIT,DAMPAR)J,PSF = deconvblind(I,INITPSF,NUMIT,DAMPAR,WEIGHT)其中I为输入图像、INITPSF 为估计的PSF(即点扩展函数)、J为输出图像、PSF为得到的PSF;可选参数NUMIT 为算法的迭代次数、DAMPAR 为偏移阈值、WEIGHT 为用于屏蔽坏像素。Step 1: Read in ImagesThe example reads in an intensity image. The deconvblind function can handle arrays of any dimension. I = imread(cameraman.tif);figure;imshow(I);title(Original Image);Step 2: Simulate a blurSimulate 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. PSF = fspecial(gaussian,7,10);% gaussian:Gaussian lowpass filter% h = fspecial(gaussian,hsize,sigma) returns a rotationally %symmetric Gaussian lowpass filter of size hsize with standard %deviation sigma (positive). hsize can be a vector specifying %the number of rows and columns in h, or it can be a scalar, in %which case h is a square matrix. The default value for hsize is %3 3; the default value for sigma is 0.5.Blurred = imfilter(I,PSF,symmetric,conv);figure;imshow(Blurred);title(Blurred Image);Step 3: Restore the Blurred Image Using PSFs of Various SizesTo 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. 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. UNDERPSF = ones(size(PSF)-4);J1 P1 = deconvblind(Blurred,UNDERPSF);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. OVERPSF = padarray(UNDERPSF,4 4,replicate,both);% replicate:Pad by repeating border elements of array.% both:Pads before the first element and after the last array % element along each dimensionJ2 P2 = deconvblind(Blurred,OVERPSF);figure;imshow(J2);title(Deblurring with Oversized PSF);The third restoration, J3 and P3, uses an array of ones, INITPSF, for an initial PSF that is exactly of the same size as the true PSF.INITPSF = padarray(UNDERPSF,2 2,replicate,both);J3 P3 = deconvblind(Blurred,INITPSF);figure;imshow(J3);title(Deblurring with INITPSF);可以看出PSF对图像复原质量有着非常重要的影响。在实际应用中,可以通过分析,使用不同大小的PSF对图像进行重建,从中选择一个最合适的PSF值。Analyzing the Restored PSFAll three restorations also produce a PSF. The following pictures show how the analysis of the reconstructed PSF might help in guessing the right size for the initial PSF. In the true PSF, a Gaussian filter, the maximum values are at the center (white) and diminish at the borders (black). figure;subplot(221);imshow(PSF,notruesize);title(True PSF);The PSF reconstructed in the first restoration, P1, obviously does not fit into the constrained size. It has a strong signal variation at the borders. The corresponding image, J1, does not show any improved clarity vs. the blurred image, Blurred.subplot(222);imshow(P1,notruesize);title(Reconstructed Undersized PSF); The PSF reconstructed in the second restoration, P2, becomes very smooth at the edges. This implies that the restoration can handle a PSF of a smaller size. The corresponding image, J2, shows some deblurring but it is strongly corrupted by the ringing.subplot(223);imshow(P2,notruesize);title(Reconstructed Oversized PSF);Finally, the PSF reconstructed in the third restoration, P3, is somewhat intermediate between P1 and P2. The array, P3, resembles the true PSF very well. The corresponding image, J3, shows significant improvement; however it is still corrupted by the ringing.subplot(224);imshow(P3,notruesize);title(Reconstructed true PSF);Step 4: Improving the Restoration、复原的图像都存在一定的“环”,这些环是由图像灰度变换较大的部分或图像的边界产生的。可以使用参数WEIGHT来消除环的存在,以提高图像的复原质量。首先要调用edge函数找出图像中灰度变换较大的部分或图像的边界;接着对图像进行膨胀操作以扩充图像的处理区域;最后灰度变换较大的像素和图像边界的像素被设置为0。The ringing in the restored image, J3, occurs along the areas of sharp intensity contrast in the image and along the image borders. This example shows how to reduce the ringing effect by specifying a weighting function. The algorithm weights each pixel according to the WEIGHT array while restoring the image and the PSF. In our example, we start by finding the sharp pixels using the edge function. By trial and error, we determine that a desirable threshold level is 0.3.WEIGHT = edge(I,sobel,.3);To widen the area, we use imdilate and pass in a structuring element, se. se = strel(disk,2);WEIGHT = 1-double(imdilate(WEIGHT,se);The pixels close to the borders are also assigned the value 0. WEIGHT(1:3 end-0:2,:) = 0;WEIGHT(:,1:3 end-0:2) = 0;figure;imshow(WEIGHT);title(Weight array);The image is restored by calling deconvblind with the WEIGHT array and an increased number of iterations (30). Almost all the ringing is suppressed. J P = deconvblind(Blurred,INITPSF,30,WEIGHT);figure;imshow(J);title(Deblurred Image);clear all,close allI = imread(cameraman.tif);figure(1);imshow(I);title(Original Image);pausePSF = fspecial(gaussian,7,10);Blurred = imfilter(I,PSF,symmetric,conv);figure(2);imshow(Blurred);title(Blurred Image); pauseUNDERPSF = ones(size(PSF)-4);J1 P1 = deconvblind(Blurred,UNDERPSF);figure(3);imshow(J1);title(Deblurring with Undersized PSF); pauseOVERPS
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 人美版(常锐伦)美术九下《6 体育场馆设计》听评课记录1
- 人教版小学数学一年级下册《认识人民币》第四课时听评课记录
- 人教版高中数学选择性必修第三册4.1《数列的概念》(2)听评课记录
- 初中人音版音乐七年级下册(2013)-第四单元“美洲乐声”《化装舞会》听评课记录
- 人教B版高中数学(选修2-3)听评课记录:第2章-章末分层突破
- 二年级数学下册听评课记录《3 图形的运动》35-人教版
- 部编人教版七年级下册语文 对联知识 听评课记录
- 新人教版八下物理第九章第2节液体的压强听评课记录
- 部编版语文七年级上册《再塑生命的人》听评课记录
- CNASPD3801D1实验动物机构认可评审报告
- 关于术中知晓预防和脑功能监测专家共识
- 心理健康评定量表
- 河道修防工高级工试题
- 女性生殖脏器
- 保障农民工工资支付协调机制和工资预防机制
- GB/T 9258.1-2000涂附磨具用磨料粒度分析第1部分:粒度组成
- GB/T 4458.3-2013机械制图轴测图
- GB/T 311.2-2013绝缘配合第2部分:使用导则
- GB/T 13912-2002金属覆盖层钢铁制件热浸镀锌层技术要求及试验方法
- GB/T 13890-2008天然石材术语
- 重症急性胰腺炎急性反应期液体复苏策略课件
评论
0/150
提交评论