运动Deblur使用Matlab

时间:2017-12-18 17:06:13

标签: matlab image-processing

我了解了deconvlucydeconvwnr技术以消除运动模糊,并且它们在模拟的去模糊图像上运行良好。因此,我尝试在移动捕获的真实片段上检查此算法。我还使用Movavi视频编辑器稳定了视频。

这是我的代码:

    I = imread('mobile_blur13.png');
    imshow(I);
    lengthmin = 12;
    lengthmax = 15;
    thetamin =331;
    thetamax=335;

    figure;
    for length = lengthmin:0.2:lengthmax
        for theta = thetamin:0.5:thetamax
            PSF = fspecial('motion',length,theta);
            res = deconvlucy(I,PSF,100);
            res2 =deconvreg(I,PSF);
            noise_var = 0;
            signal_var = var(double(I(:)));
            estimated_nsr = noise_var/signal_var;
            res1= deconvwnr(I,PSF,estimated_nsr); 
            %res  = medfilt2(rgb2gray(res));
            f = imfilter(res, fspecial('average', [3 3]));
             imshow(f);
        end
    end

但是,结果非常糟糕。我可以知道自己做错了什么。 这是一张图片:

提前致谢

original deblurred

1 个答案:

答案 0 :(得分:0)

使用模拟模糊对图像进行去模糊与拍摄实际相机拍摄的照片非常不同。

由于相机移动造成的运动模糊会严重降低图像质量。由于相机运动的路径可以是任意的,因此运动模糊图像的去模糊是一个难题。有几种方法可以解决这个问题,例如盲目恢复或使用稳定镜片的光学校正。

解决方案是使用盲去卷积和deconvblind命令。

https://www.mathworks.com/help/images/ref/deconvblind.html