What is the benefit of casting image into double after reading in Matlab
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Tahir
el 16 de Feb. de 2015
Comentada: Image Analyst
el 16 de Feb. de 2015
Hello, I asked several questions here.in every answer it is recommended that caste the image to double.
So i want to know what is the benefit of casting image to double. My segmentation results are not good.so i am thinking on every factor. plz help.Thank you
0 comentarios
Respuesta aceptada
Image Analyst
el 16 de Feb. de 2015
It's not necessarily true that you should cast to double. It depends on the circumstances and what you're trying to do or measure. I don't think it should make the segmentation worse though.
4 comentarios
Image Analyst
el 16 de Feb. de 2015
Just make a little experiment to see. Look at this code and see the two different results:
R = uint8(9);
G = uint8(19);
B = uint8(139);
img_BlueRation = ((100 * B)./(1+R+G)) .* (256./(1+B+R+G))
whos img_BlueRation
R = double(9);
G = double(19);
B = double(139);
img_BlueRation = ((100 * B)./(1+R+G)) .* (256./(1+B+R+G))
whos img_BlueRation
img_BlueRation =
18
Name Size Bytes Class Attributes
img_BlueRation 1x1 1 uint8
img_BlueRation =
730.377668308703
Name Size Bytes Class Attributes
img_BlueRation 1x1 8 double
So it seems to me you should case img to double before you do that kind of math on it.
Más respuestas (0)
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!