How to get the HSV value of a pixel?

88 views
Skip to first unread message

Nivetha

unread,
Apr 11, 2005, 3:06:51 AM4/11/05
to EE4...@googlegroups.com

Hi
using the cvcvtcolor function, i converted to HSV space, my problem is
where are these converted values The RGB value seems to be stored in
the IplImage -> imageData[] ... is the HSV replaced into this position
or another position?
Also when I convert using CV_BGR2HSV the displayed image becomes
wierdly coloured (somethings become green and red etc) - why is this
since the change in the colour space shouldnt change the way it is
displayed right?
thanks
Nivetha

Eunkwang Park

unread,
Apr 11, 2005, 4:01:09 AM4/11/05
to EE4...@googlegroups.com
Hi,

Converted image is in HSV space, which H is hue value(sort of color), S is
saturation(color intensity), and V is value(gray value).
Three component are in the same places of RGB, for ex, coverted image hsv,
then hsv->imageData string.
You don't display the converted image since the representation is just for
analysis, not display.
The HSV is similar to HSI space and there is some information about these
space in the paper which I already uploaded in okayama.
Please, read the paper to understand HSV space.
If you don't have enough time to read, just use hue vale under the good
lighting condition.
According to my experience, hue value is enough to analysis for color.

There is no meaning when you display the converted image hsv.
You should display the original image with RGB representation.

I hope it help you.
Please, let me know if you have any questions.

Eunkwang

Nivetha

unread,
Apr 11, 2005, 11:55:28 AM4/11/05
to EE4...@googlegroups.com
hi,
thanks for the answer to the first question. I discovered the problem
as to why i was seeing a converted image. I was copying the same image
into the second iplimage variable instead of creating a new one....
after transforming the colour space this seemed to affect the displayed
image. Solved problem by using createImage :).
Thanks
Nivetha

Reply all
Reply to author
Forward
0 new messages