Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to define "lower" and "upper" range of two (or more) different color?

This topic: 134248/how-to-define-the-lower-and-upper-range-of-a-color/ gives me some question

How can I define "lower" and "upper" range of two different color, such as red and blue (because red and blue are not next to each other in the HSV color)

This one belongs to red:

lower_red = np.array([160,20,70])
upper_red = np.array([190,255,255])

and this one belongs to blue:

lower_blue = np.array([101,50,38])
upper_blue = np.array([110,255,255])

I tried to combine them using if condition or make their own function but not work, can you guys show me the solution?