cszn / IRCNN

Learning Deep CNN Denoiser Prior for Image Restoration (CVPR, 2017) (Matlab)
http://openaccess.thecvf.com/content_cvpr_2017/papers/Zhang_Learning_Deep_CNN_CVPR_2017_paper.pdf
587 stars 174 forks source link

Demo_deblur_real_application #9

Open yxxxxxxxx opened 6 years ago

yxxxxxxxx commented 6 years ago

这个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 6 years ago

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.

yxxxxxxxx commented 6 years ago

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

cszn commented 6 years ago

Yes, the blur kernel is saved as an image.

dadachongzi commented 6 years ago

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

Zonobia-A commented 6 years ago

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

cszn commented 6 years ago

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

Zonobia-A commented 6 years ago

Thanks!

cszn commented 6 years ago

The problem has been solved. See the details: https://github.com/cszn/IRCNN/blob/f47a52ae9849265843553639ee8767316f754e61/Demo_deblur_real_application.m#L74

pingfansong commented 5 years ago

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.