IRCNN icon indicating copy to clipboard operation
IRCNN copied to clipboard

Demo_deblur_real_application

Open yxxxxxxxx opened this issue 6 years ago • 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);

yxxxxxxxx avatar Apr 15 '18 07:04 yxxxxxxxx

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.

cszn avatar Apr 15 '18 08:04 cszn

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

yxxxxxxxx avatar Apr 15 '18 08:04 yxxxxxxxx

Yes, the blur kernel is saved as an image.

cszn avatar Apr 15 '18 09:04 cszn

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

dadachongzi avatar Apr 18 '18 09:04 dadachongzi

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

Zonobia-A avatar Apr 18 '18 17:04 Zonobia-A

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

cszn avatar Apr 19 '18 01:04 cszn

Thanks!

Zonobia-A avatar Apr 19 '18 01:04 Zonobia-A

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

cszn avatar Apr 30 '18 14:04 cszn

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.

pingfansong avatar Aug 10 '18 17:08 pingfansong