I am trying to detect red color using inRange keyword. But I cannot check it inside If statement. If red color comes then print It is red color
- Mat1b mask1, mask2;
- inRange(hsv, Scalar(173, 70, 50), Scalar(179, 255, 255), mask1);
- imshow("RedDetect", mask1);
see tutorial_threshold_inRange
But how can I check inside If statement. For example If color is red then call some function
Also, notice that the H of red color in HSV color space may range from 0~10 and 170~180, you might have to consider these two conditions.
Thank you for help. I will take into account