I am using a Scalar to define the color of a rectangle I am drawing with OpenCV:
Scalar
OpenCV
rectangle(imgOriginal, Point(0, 0), Point(25, 50),
Use this to convert a single value:
cv::Vec3f rgb; cv::Vec3f hsv; hsv[0] = H; hsv[1] = S; hsv[2] = V; cvtColor(hsv, rgb, CV_HSV2BGR);
Then you can use it:
rectangle(imgOriginal, Point(0, 0), Point(25, 50), Scalar(rgb[0], rgb[1], rgb[2]), CV_FILLED);