I'm trying convert RGB image to HSV with the function cvCvtColor(), but the results are unexpected. For example, white are converted to something near to red.
cvCvtColor(img, hsv, CV_BGR2HSV);
cvSplit( hsv, h, s, v, NULL );
cvInRangeS(h,cvScalar(0,0,0,0),cvScalar(20,0,0,0),imgthresh);
cvShowImage("image", img);
cvShowImage("hsv", hsv);
cvShowImage("threshold", imgthresh);
Is the image converted correctly and only displayed wrong? And about the threshold, the better way to do this is using the 3 channels or only the hue? I want track red objects. Sorry about the english. Thanks.