histogram plot not working for my image

조회 수: 2 (최근 30일)
u-will-neva-no
u-will-neva-no 2012년 10월 12일
댓글: Zahra Saman 2018년 4월 12일
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.
  댓글 수: 1
Zahra Saman
Zahra Saman 2018년 4월 12일
Please any one help me in this problem

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2012년 10월 12일
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
Matthew Gill
Matthew Gill 2017년 10월 28일
I wasn't either! Good question and thanks for answer!
Matthew Gill
Matthew Gill 2017년 10월 28일
Actually, I was also setting histogram = to something

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by