我学习了 deconvlucy
和 deconvwnr
技术来消除运动模糊,它们在模拟的去模糊图像上工作得很好 . 因此,我试图在移动捕获的真实片段上检查此算法 . 我还使用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
但是,我的结果非常糟糕 . 我可以知道自己做错了什么 . 这是一张图片:
提前致谢
1 回答
使用模拟模糊对图像进行去模糊与对实际相机拍摄的照片进行去模糊是非常不同的 .
由于相机运动引起的运动模糊会显着降低图像质量 . 由于相机运动的路径可以是任意的,因此运动模糊图像的去模糊是一个难题 . 有几种方法可以解决这个问题,例如使用稳定透镜的盲恢复或光学校正 .
解决方案是使用盲去卷积和deconvblind命令 .
https://www.mathworks.com/help/images/ref/deconvblind.html