Hi
I am trying to plot the hue histogram of my image. It currently looks like this.
I would like it to look like the one below.
Or at least just the bar below should be in color. I tried changing the colormap option but nothing changed. Help thanks !

답변 (2개)

Walter Roberson
Walter Roberson 2016년 1월 26일

0 개 추천

[ind, map] = rgb2ind(YourRGBImage);
imhist(ind, map)

댓글 수: 4

RuiQi
RuiQi 2016년 1월 27일
Not sure what im supposed to write for the arguments.
YourRGBImage = imread('FG.png'); [ind, map] = rgb2ind(YourRGBImage,hsv); imhist(ind, map); colormap(hsv);
and i got this below. its wrong. help thanks !
Image Analyst
Image Analyst 2016년 1월 27일
What is the "hue histogram"? Is it the histogram of the hue channel after your image has been converted from red,green,blue to hue,saturation,value with rgb2hsv()? Or is it the histogram of a gray scale image where you just want the bars in the bar chart to appear with a certain color ordering applied to them?
RuiQi
RuiQi 2016년 1월 27일
편집: RuiQi 2016년 1월 27일
Hi,
Thanks for the reply. Id like to plot a histogram of the hue channel of my image after it has been converted from RGB to HSV. In my first plot, the bar below is gray in color and I have no idea how to change its color to represent the hue like the 2nd image from wikipedia.
EDIT: My first plot is a plot of the hue of the image. I just need to change the bar from gray to color(hue).
Walter Roberson
Walter Roberson 2016년 1월 27일
I don't think you can do it with imhist() then. You will probably need to bar() each different bar separately.

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

Image Analyst
Image Analyst 2016년 1월 27일

0 개 추천

See attached demo where I change each bar individually. Feel free to adapt.

카테고리

도움말 센터File Exchange에서 Histograms에 대해 자세히 알아보기

태그

질문:

2016년 1월 26일

답변:

2016년 1월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by