uint8 and double in case of image
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
vaishali
el 27 de Nov. de 2014
Editada: Image Analyst
el 27 de Nov. de 2014
Hello
In one of the image encryption method I need to convert an image from uint8 to double. But after converting the whole, image is losing some information only white colour with some coloured dots will appear in that double image. so after the required task how to convert it to original image? please guide..
Thanks
0 comentarios
Respuesta aceptada
Más respuestas (1)
Image Analyst
el 27 de Nov. de 2014
Look at the variable in the workspace/variable editor and tell me if there is data loss there. Chances are you're just not displaying it correctly. For double, if it's not in the range o-1, you need to use [] as the second argument in imshow():
imshow(doubleImage, []);
2 comentarios
Image Analyst
el 27 de Nov. de 2014
Editada: Image Analyst
el 27 de Nov. de 2014
The badly-named "a" must be a color image. You cannot display double RGB images unless they're in the range 0-1. You must cast to uint8 first. And since it's color, you won't need the [] - it will ignore them.
imshow(uint8(b));
Or you can divide your array by 255 (which is intmax('uint8')) like per showed.
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!