1 | initial version |
Have you tried using the RGB colour space? If you have the image in RGB then only look at channel 3 of the image. Then you would say, if the blue component is greater than a certain threshold then we have detected a blue colour. Anything less than the threshold and its probably a mix of colours.
mask = cv2.inRange(img, lower_magnitude_threshold, 255);
Hope this helps!