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

조회 수: 3 (최근 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