[英]Image Deconvolution Using FFT
I'm trying to blind unblur an image using a gauss filter using the following code but I know I've a problem whenever the filter contains zero, so I wonder if there is any other method of deconvolution but using the FFT 我正在尝试使用以下代码使用高斯滤波器对图像进行模糊模糊处理,但我知道每当滤波器包含零时都会出现问题,因此我想知道是否还有其他反卷积方法,但使用FFT
function [ out ] = imblur( file)
img = im2double(imread(file));
h = fspecial('gaussian', [15 15], 3);
img_red = img(:,:,1);
img_blue = img(:,:,2);
img_green = img(:,:,3);
[m,n] = size(img_red);
[mb,nb] = size(h);
% output size
mm = m + mb - 1;
nn = n + nb - 1;
x1(:,:,1) = (ifft2(fft2(img_red,mm,nn)./ fft2(h,mm,nn)));
x2(:,:,2) = (ifft2(fft2(img_blue,mm,nn)./ fft2(h,mm,nn)));
x3(:,:,3) = (ifft2(fft2(img_green,mm,nn)./ fft2(h,mm,nn)));
out = cat(3, x1(:,:,1), x2(:,:,2), x3(:,:,3));
imshow(out);
用epsilon代替零效果很好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.