how to draw 3d histogram of an image ad shown in figure

조회 수: 6 (최근 30일)
Parveiz Lone
Parveiz Lone 2021년 2월 21일
댓글: Image Analyst 2021년 3월 14일

채택된 답변

Walter Roberson
Walter Roberson 2021년 2월 26일
Histogram implies that you are binning the data, and the coordinates are associated with the edge or central value of the bin. 3D histogram implies that you are binning the data with respect to two different coordinates.
However, in the diagrams you show, at least to the resolution you present, there is no binning of data. We can see that one of the independent axes is length 600 and the other is length 800, but uint8 has at most 256 different values, and int16 or uint16 there is no obvious reason why you would bin in widths of 41 input values in one direction and in widths of 55 input values in the other direction.
It does not seem likely that you want histograms at all. I would suggest that you are instead looking for bar charts.
a = imread('flamingos.jpg');
a = imresize(a, 0.25);
h = bar3(a(:,:,1)); set(h, 'EdgeColor', 'none'); title('red')
  댓글 수: 4
Parveiz Lone
Parveiz Lone 2021년 3월 14일
thanku very much
Image Analyst
Image Analyst 2021년 3월 14일
You could also replace
r = a(:,:,1);
g = a(:,:,2);
b = a(:,:,3);
with
[r, g, b] = imsplit(a);

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

추가 답변 (1개)

Image Analyst
Image Analyst 2021년 2월 21일
This is done by the histogram2() function. Check out the help for examples. Let us know if you can't figure it out for your data, and attach your data after reading this:
  댓글 수: 5
Parveiz Lone
Parveiz Lone 2021년 2월 22일
Most propbably these histograms can be drawn by " surf "command
Image Analyst
Image Analyst 2021년 2월 26일
What you said abount histogram doesn't make sense. But perhaps you want to do something like the attached demo. Or else see Walter's answer. Otherwise, give us an example of what you'd like to see.

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

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by