cszn/IRCNN

Demo_deblur_real_application

yxxxxxxxx opened this issue · 9 comments

这个demo跑不通,您知道为什么吗?
Error using edgetaper
Expected input number 2, PSF, to be nonzero.

Error in edgetaper>parse_inputs (line 128)
validateattributes(PSF,{'uint8','uint16','int16','double','single'},...

Error in edgetaper (line 34)
[I, PSF, sizeI, classI, sizePSF, numNSdim] = parse_inputs(varargin{:});

Error in Demo_deblur_real_application (line 76)
y = edgetaper(y, k);

cszn commented

Make sure you also provide the blur kernel because IRCNN takes the blurred image and blur kernel as input.
For your own blurred image, please estimate the blur kernel by a blind deblurring method first, then you can use this code for non-blind deblurring.

我是直接跑的demo,然后出现了上述错误,那这个blur kernel是一张图片吗?比如说:kerneltestsets/Deblur_set2/im01_ker01_out_kernel.png

cszn commented

Yes, the blur kernel is saved as an image.

i am also encounter this question,how to solve it?thanks!

Can you tell me how to estimate the blur kernel by a blind deblurring method?

cszn commented

Some blind deblurring codes: https://github.com/rgbitx/image_deblur_code

Thanks!

cszn commented

The problem has been solved.
See the details:

%% handle boundary

I ever got similar errors in other codes.

Error using edgetaper
Expected input number 2, PSF, to be nonzero.

Error in edgetaper>parse_inputs (line 128)
validateattributes(PSF,{'uint8','uint16','int16','double','single'},...

Error in edgetaper (line 34)
[I, PSF, sizeI, classI, sizePSF, numNSdim] =
parse_inputs(varargin{:});

Actually, the error means that PSF is required not to contain zero elements by the function validateattributes(PSF,{'uint8','uint16','int16','double','single'},...

So, we need to check PSF to make sure it does not contain zeros. Alternatively, we can add PSF with very small numbers to eliminate zeros. It works in this way.