error in using imhist in matlab 2015a. i cant understnad why error is coming
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/270432/image.png)
0 Kommentare
Antworten (1)
Image Analyst
am 7 Feb. 2020
Probably because it's color. Use histogram() or else use imhist() on each color channel one at a time.
% Extract the individual red, green, and blue color channels.
redChannel = im(:, :, 1);
greenChannel = im(:, :, 2);
blueChannel = im(:, :, 3);
[countR, grayLevelsR] = imhist(redChannel);
[countG, grayLevelsG] = imhist(greenChannel);
[countB, grayLevelsB] = imhist(blueChannel);
Or convert to gray scale:
grayImage = rgb2gray(im);
[countR, grayLevelsR] = imhist(grayImage);
0 Kommentare
Siehe auch
Kategorien
Mehr zu Design Condition Indicators Interactively finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!