how to convert a double matrix image to a unit8 matrix ?

Illustration
Ralph - 2020-10-03T11:49:46+00:00
Question: how to convert a double matrix image to a unit8 matrix ?

I have an image ,a matrix with values between -0.0934 and 0 and i want to convert it to unit8 matrix with values between 0 ans 255.  

Expert Answer

Profile picture of Neeta Dsouza Neeta Dsouza answered . 2025-11-20

A=imread('yourimage')
B=uint8(A)

EDIT

d=linspace(min(im(:)),max(im(:)),256)
im1=uint8(arrayfun(@(x) find(abs(d(:)-x)==min(abs(d(:)-x))),im))


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!