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

3 visualizzazioni (ultimi 30 giorni)
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.

Risposte (1)

Jinal
Jinal il 16 Feb 2023
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.

Categorie

Scopri di più su Modify Image Colors in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by