How i can plot gray-scale image values?
11 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Haseeb Hassan
il 2 Mag 2018
Commentato: Ameer Hamza
il 4 Mag 2018
I want to 2-D plot the grayscale image values.The below code plot the 3-D values of a grayscale image.What i can use
instead of meshgrid function to plot 2-D values of a gray scale image.Please see the pictures for more details.
Ix = imread('C:\Users\Haseeb\Desktop\images\capture.jpg');
I= rgb2gray(Ix);
x = 1:size(I,1);
y = 1:size(I,2);
[X,Y] = meshgrid(x,y);
figure,plot3(X,Y,I)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/190265/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/190266/image.png)
0 Commenti
Risposta accettata
Ameer Hamza
il 2 Mag 2018
You can plot it using histcounts().
counts = histcounts(grayImage, 0:256)
plot(counts)
4 Commenti
Ameer Hamza
il 4 Mag 2018
You cannot recover an image back from this plot because the information about the location of each pixel is lost. Can you think of a way by which I can know which pixel belongs to which location by just looking at this plot?
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!