I need a way to threshold
or combine 2 inRange()
functions to detect the range of a red color in HSV
color space
In HSV
space, the red color wraps around 180. So i need the H values to be both in [0,10] and [170, 180].
How to combine these to functions:
inRange(hsv, Scalar(0, 70, 50), Scalar(10, 255, 255), mask1);
inRange(hsv, Scalar(170, 70, 50), Scalar(180, 255, 255), mask2);
If it is not possible to combine them how to Threshold
values to get the desired output of red color.