Gray scale images are stored in unsigned 8 bit integers so i

Gray scale images are stored in unsigned 8 bit integers, so in order to multiply a B matrix with a factor 0.5, etc. you will need to change the B matrix to a double precision. You can do this by B=double(A).^0.5 since your matrix B is now double precision, you need to change it back to unsigned 8 bit integer and display. You can do this by imshow(uint8(B)) Please submit your code and figures along with your description/understanding of the results.

Solution

function [] = grayScale(A)
    %unsigned 8 bit integers to double
    B = double(A).^0.5;
    %double to unsigned 8 bit integers
    imshow(uint8(B));
end


%run this function for different inputs, and that should do the job

 Gray scale images are stored in unsigned 8 bit integers, so in order to multiply a B matrix with a factor 0.5, etc. you will need to change the B matrix to a d

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site