histogram plot not working for my image
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
u-will-neva-no
il 12 Ott 2012
Commentato: Zahra Saman
il 12 Apr 2018
Hi eveyone, I originally had a .tiff image (CMYK format) that I converted to RGB. I then converted to gray scale. On the grayscale image, I tried to plot a histogram of the data but returned the following error in matlab:
Error using .*
Integers can only be combined with integers
of the same class, or scalar doubles.
Let me know if you would like me to provide my code. The format that my RGB image is an uint8.
Thanks for reading.
Risposta accettata
Image Analyst
il 12 Ott 2012
Then the grayscale image should also most likely be an uint8 array if you just took one color channel or used rgb2gray(). Which histogram function did you use? Did you do something like this:
% Let's compute and display the histogram.
[pixelCount grayLevels] = imhist(grayImage);
bar(grayLevels, pixelCount);
grid on;
title('Histogram of gray scale image', 'FontSize', 15);
xlim([0 grayLevels(end)]); % Scale x axis manually.
If you did something different (which I guess you must have, because your code doesn't work, while mine does), then you'll have to let us see your code.
3 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Histograms in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!