Problem with the class of my data

Hello, I am working with images and using 'deconvreg','deconvblind','deconvvwnr','deconvlucy'.
My images are '.bmp', so the matrix which I'm working are of the class 'uint8'.
If I work with the default values of DAMPAR, WEIGHT, ecc... it's ok, but when I want to change these I have always the same error, because DAMPAR or WEIGHT are double and they have to be of the same class of the matrix (I have been searching and I found this: I and PSF can be uint8, uint16, int16, double,or single. DAMPAR and READOUT musthave the same class as the input image. Other inputs have to be double.The output image J (or the first array of the outputcell) has the same class as the input image I)
The problem come when I change the class, using 'uint8', for example:
x=8; %double
x=uint8(x)
x=8 %now x's class is uint8. That's ok
y=8.3
y=uint8(y)
y=8 *%THIS IS THE PROBLEM*
For working with deconvlucy and the WEIGHT, I could work with values from 0.0 to 1, but I lose the decimals if I changed to uint8 class. What can I do? (change the class of the matrix could be a disaster, I think, because this part it's a little part of my program)

 Accepted Answer

Image Analyst
Image Analyst on 26 Mar 2015
Just cast (the badly-named) "I" to be a double before using it in any convolution routine.

1 Comment

Ok. Thank you. I have to do it. Thank you again

Sign in to comment.

More Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Asked:

on 26 Mar 2015

Commented:

on 7 Apr 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!