8 #define DGM_HSV(h, s, v) cv::Scalar(h, s, v, 0 ) 17 namespace colorspaces {
26 bgr.val[0] = rgb.val[2];
27 bgr.val[1] = rgb.val[1];
28 bgr.val[2] = rgb.val[0];
29 bgr.val[3] = rgb.val[3];
46 double hh, p, q, t, ff;
50 if (hsv.val[1] <= 0.0) {
51 out.val[0] = hsv.val[2];
52 out.val[1] = hsv.val[2];
53 out.val[2] = hsv.val[2];
57 if (hh >= 360.0) hh = 0.0;
61 p = hsv.val[2] * (1.0 - hsv.val[1] / 255.0);
62 q = hsv.val[2] * (1.0 - (hsv.val[1] * ff) / 255.0);
63 t = hsv.val[2] * (1.0 - (hsv.val[1] * (1.0 - ff)) / 255.0);
67 out.val[0] = hsv.val[2];
73 out.val[1] = hsv.val[2];
78 out.val[1] = hsv.val[2];
85 out.val[2] = hsv.val[2];
90 out.val[2] = hsv.val[2];
94 out.val[0] = hsv.val[2];
cv::Scalar rgb2bgr(cv::Scalar rgb)
Transforms color from RGB to BGR.
cv::Scalar bgr2rgb(cv::Scalar bgr)
Transforms color from RGB to BGR.
cv::Scalar hsv2rgb(cv::Scalar hsv)
Transforms color from HSV to RGB space.
cv::Scalar hsv2bgr(cv::Scalar hsv)
Transforms color from HSV to BGR space.