sir,i need to draw the horizontal and vertical histogram of a binary image..plz help?

조회 수: 1 (최근 30일)
sir,i need to draw the horizontal and vertical histogram of a binary image..plz help?
  댓글 수: 1
Geoff Hayes
Geoff Hayes 2015년 3월 29일
aejaz - start by looking at imhist (if you have the Image Processing Toolbox) or hist or histogram depending on your version of MATLAB.
Also, please stop copying and pasting your question title into the body of your question and as tags to your question. There is no benefit to doing so.

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

답변 (1개)

Image Analyst
Image Analyst 2015년 3월 29일
I don't even know what that is . Do you mean that you want the bar chart of the counts to go vertically or horizontally across the screen??? Do you mean that you want the histogram of one or more specified rows or columns instead of the entire image? Please clarify. And, anyway, since a binary image has only two values, true and false, you can simply get the counts like this
numWhitePixels = sum(binaryImage(:));
numBlackPixels = numel(binaryImage) - numWhitePixels;
If you want a certain sub-image of the binary image, then use this instead of binaryImage
binaryImage(row1:row2, col1:col2);
  댓글 수: 5
Image Analyst
Image Analyst 2015년 3월 30일
[rows, columns] = size(grayImage);
for row = 1 : rows
rowMeans(row) = mean(grayImage(row,:));
end
bar(rowMeans); % Plot gray level means
aejaz khan
aejaz khan 2015년 3월 30일
thanking you a lot sir...i will definitely remember u in my prayers.

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

카테고리

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