Turning a modified image into a matrix

Hi,
I have made changes to an image but it comes across as not what i want.
To solve this i took the original image and said x = imshow(image, [0 255]);
how can i turn 'x' into a matrix of values, such that when i type y=imshow(x) it returns the modified image.

 Respuesta aceptada

Guillaume
Guillaume el 25 de Abr. de 2017
x = uint8(x);
If the class of x is double, matlab assumes the intensity range is 0-1. When the class is uint8, matlab assumes the range is 0-255 since that the range of 8-bit unsigned integers.

4 comentarios

Optical_Stress
Optical_Stress el 25 de Abr. de 2017
Thanks for the fast response, i got the following error: Conversion to uint8 from matlab.graphics.primitive.Image is not possible.
Optical_Stress
Optical_Stress el 25 de Abr. de 2017
nevermind, i managed to fix it!
Guillaume
Guillaume el 25 de Abr. de 2017
Sounds like you're calling the function image instead of converting whichever variable contains your image. Either your image variable is not in scope, or it's not called image.
This is why we recommend not to use image as a variable name (or sum, mean, min, etc.) since it's too easy to run into these sort of bugs.
Thirunisha Thirumurugan
Thirunisha Thirumurugan el 22 de Mzo. de 2019
@Optical_Stress How did you fix it?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Images en Centro de ayuda y File Exchange.

Preguntada:

el 25 de Abr. de 2017

Comentada:

el 22 de Mzo. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by