how to visualize a matrix containing digital data as grayscale image (having the same grey values)

4 次查看(过去 30 天)
i have a data like this 47 49 47 43 50 50 42 39 42 46 45 46 55 53 46 40 40 43 44 46 54 50 46 43 40 40 43 41 50 44 37 39 45 40 44 44 50 47 34 37 54 45 49 49 46 45 40 40 54 51 52 52 48 43 40 38 55 56 55 59 44 40 34 38
I want to visualize the given matrix an a grayscale image with the same grey values. Can anyone help? Thanks.

回答(1 个)

Jinal
Jinal 2023-2-16
Hi Bidlee Devi,
I understand that you have an 8-by-8 matrix of pixel values for an image, and you wish to convert the matrix values into a greyscale image.
This can be achieved using the mat2gray function. You will need to store the grey values in a matrix in MATLAB and then use the following command to obtain the required greyscale image.
I = mat2gray(A)
Where A is the matrix containing pixel values of image.
You can refer the following link for more information.

类别

Help CenterFile Exchange 中查找有关 Modify Image Colors 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by