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)

 Réponse acceptée

Image Analyst
Image Analyst le 26 Mar 2015

0 votes

Just cast (the badly-named) "I" to be a double before using it in any convolution routine.

1 commentaire

Maria
Maria le 7 Avr 2015
Ok. Thank you. I have to do it. Thank you again

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Convert Image Type dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by