在Matlab上进行图像去模糊 [英] Image deblurring on Matlab

查看:4509
本文介绍了在Matlab上进行图像去模糊的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是MatLab的新手。一直在玩并阅读帮助指南,但我似乎无法解决这种情况。

Im new to MatLab. Been playing around and reading through the help guide but i can't seem to solve this situation.

我已经使用高斯算法去除了噪音。这是成功的,但我没有设法让图像清晰,我尝试使用Richardson-Lucy去模糊算法,但它不起作用。知道怎么解决这个问题? Thnx提前。

I have removed the noise by using gaussian algorithm. That was successful but I've not managed to get the image to be clear, i've tried using Richardson-Lucy deblurring algorithm but it doesn't work. Any idea how can i solve this? Thnx in advance.

这是我到目前为止所做的事情。

Here's what i've done so far.

图片大小= 21kb
image dimension = 264 x 126

image size = 21kb image dimension = 264 x 126

img = imread('car_plate.jpg')
subplot(331);
imshow(img), title('Original Image')

PSF = fspecial('gaussian',15,15);
blur = imfilter(img,PSF,'replicate');
subplot(332);imshow(blur);title('Filter image');

motion_noise = fspecial('disk', 7);

luc1 = deconvlucy(img,motion_noise);
subplot(333); imshow(luc1);
title('Disk and Lucy');

LEN = 9; THETA = 1;
motion_noise2 = fspecial('motion', LEN, THETA);


luc2 = deconvlucy(blur,motion_noise2);
subplot(334); imshow(luc2);
title('Motion and Lucy');

当我尝试使用中值滤波器时,我得到了这个输出

When i tried using median filter, i got this output


使用medfilt2时出错

预期输入数字1,A是二维的。

Error using medfilt2
Expected input number 1, A, to be two-dimensional.

medfilt2> parse_inputs中的错误(第106行)

validateattributes(a,{'numeric','logical'},{'2d','real'},mfilename,'A',1);

Error in medfilt2>parse_inputs (line 106)
validateattributes(a, {'numeric','logical'}, {'2d','real'}, mfilename, 'A', 1);

medfilt2中的错误(第48行)

[a,mn,padopt] = parse_inputs(varargin {:});

Error in medfilt2 (line 48)
[a, mn, padopt] = parse_inputs(varargin{:});

a1q21错误(第2行)

J = medfilt2(img);

Error in a1q21 (line 2)
J = medfilt2(img);

我当前的结果就是这样。

and my current results are this.

推荐答案

你正在使用错误的点扩散函数来实现你的debluring算法(碉堡是一个糟糕的选择)。为获得最佳结果,使用中值滤波器滤除S& P噪声,然后用高斯核心进行去模糊。我会跳过运动deblur,因为图像似乎没有强烈的方向模糊。您将需要使用锐化滤镜的sigma来获得最佳效果。

You are using the wrong point spread functions for your debluring algorithm (pillbox is a bad choice). For best results filter with a median filter to remove the S&P noise and then deblur with a gaussian kernal. I would skip the motion deblur as the image doesn't seem to have strongly directional blur. You will need to play with the sigma of the sharpening filter to get the best results.

img = imread('car_plate.jpg')
subplot(331);
imshow(img), title('Original Image')

blur = medfilt2(img,[3 3]);
subplot(332);imshow(blur);title('Filter image');

deblurSigma = 10; %Adjust this to get the most visually pleasing results
motion_noise = fspecial('gaussian', 15,deblurSigma);
luc1 = deconvlucy(img,motion_noise);
subplot(333); imshow(luc1);
title('Disk and Lucy');

这篇关于在Matlab上进行图像去模糊的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆