MATLAB Answers

0

Turning a modified image into a matrix

Asked by Optical_Stress on 25 Apr 2017
Latest activity Commented on by Thirunisha Thirumurugan on 22 Mar 2019
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.

  0 Comments

Sign in to comment.

1 Answer

Answer by Guillaume
on 25 Apr 2017
 Accepted Answer

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 Comments

Show 1 older comment
nevermind, i managed to fix it!
Guillaume
on 25 Apr 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.

Sign in to comment.