how can i plot a histogram of pixel values?

2 vues (au cours des 30 derniers jours)
sanaz
sanaz le 20 Juil 2014
Commenté : sanaz le 21 Juil 2014
i'm working on a simulation and it contains a histogram of pixel differences for original image and marked one. but i do not understand this plot (that comes in attachment). can anybody please review it and guide me on that?
  2 commentaires
Wayne King
Wayne King le 20 Juil 2014
Did you attach anything?
sanaz
sanaz le 20 Juil 2014
i had but seems like it was not attached, i did again, can you see it now?

Connectez-vous pour commenter.

Réponse acceptée

Image Analyst
Image Analyst le 20 Juil 2014
Modifié(e) : Image Analyst le 20 Juil 2014
Your plot shows that there is a pixel-to-pixel difference (same location) of anywhere from -4 to +0.5 gray levels.
diffImage = double(image1) - double(image2);
minValue = min(diffImage(:));
maxValue = max(diffImage(:));
edges = linspace(minValue, maxValue, 500); % 500 bins
counts = histc(diffImage(:));
plot(edges, counts, 'b-');
grid on;
  3 commentaires
Image Analyst
Image Analyst le 21 Juil 2014
Yes.
sanaz
sanaz le 21 Juil 2014
i corrected it and got the right answer. thank you very much.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by