I am having an hsv mat file in opencv and I want to separate the channels. I found cvSplit( hsv, h, s, v, NULL ), but it doesn't work with Mat files. How is it then, to keep just the first channel h of from the Mat image file?? My result is the above. Basically is the image that I convert, I can see the face but in weird tones.
The code used:
cvtColor(cropped_rgb, cropped_hsv, CV_BGR2HSV);
split(cropped_hsv, channels);
cropped_hsv = channels[0];
imshow("cropped_hsv", cropped_hsv);
You can simply use split:
channels[0], channels[1], channels[2] will contain your H, S, V respectively.