Opencv: Converting hue image to RGB image

Posted by jhaip on Stack Overflow See other posts from Stack Overflow or by jhaip
Published on 2010-06-11T02:57:34Z Indexed on 2010/06/11 3:02 UTC
Read the original article Hit count: 306

Filed under:
|
|
|

I am trying to show the hue component of the image from my webcam. I have split apart the image into the hue component but I can't figure out how to show the hue component as the pure colors. For example if one pixel of the image was B=189 G=60 R=60 then in HSV, H=0. I don't want the draw image to be the the gray values of hue but the RGB equivalent of the hue or H=0 -> B=0 G=0 R=255

IplImage *image, *imageHSV, *imageHue;
image = cvQueryFrame(capture); //image from webcam
imageHSV = cvCreateImage( cvGetSize(image), IPL_DEPTH_8U, 3 );
imageHue = cvCreateImage( cvGetSize(image), IPL_DEPTH_8U, 1 );
cvCvtColor( image, imageHSV, CV_BGR2HSV );
cvSplit( imageHSV, imageHue, 0, 0, 0 );

I have a feeling there is a simple solution so any help is appreciated.

© Stack Overflow or respective owner

Related posts about convert

Related posts about color