+2  A: 

You have read in an image using imread. So it is probably coming in as uint8? The help for imread says the result will be integer of some order for a tiff image. What class was I when it was returned?

You then filtered the image. It appears that imfilter will return an integer image for an integer input image.

Next, you add noise, using imnoise. From the online help for imnoise, it internally converts the image to a [0,1] (double) number, adds the Gaussian noise, then converts back to integer output. So your blurred image should still be integer, probably uint8 elements.

The help for fspecial says it will return a double precision output for PSF.

You called deconvolucy with only two arguments, so it is using the default value for DAMPAR. (I'll argue that this should not fail here. The author of deconvolucy appears not to have supplied a default value that was consistent in type with the inputs.)

Not knowing enough about the IPT or deconvolucy, I might first suggest re-running this code, using two different calls.

J1 = deconvlucy(BlurredNoisy,PSF,[],0);

J1 = deconvlucy(BlurredNoisy,PSF,[],uint8(0));

If one of these calls did not fix the problem, it suggests that deconvolucy expects a double input for the image, BlurredNoisy. The online help for deconvolucy was not specific here. It says only that I may be an N dimensional array or a cell array. Further on in the help, it calls the result a numeric array. So I believe that the image for deconvolucy is expected to be a floating point image. (By my standards, this is a flaw in the help.)

I would then probably try scaling your image to [0,1] as a double. It is just a guess however. So something like:

BlurredNoisy = double(BlurredNoisy)/255;

This assumes your image was uint8 in class originally.

woodchips