Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to define the “lower” and “upper” range of a color?

Hi, could you please help me with a question defining the range of a certain color?

Learning from the question and answers in the site /31305/why-is-this-simple-mask-not-working/

The lines limiting the red are 2 arrays:

lower = n.array([0,100,100])
upper = n.array([20,255,255])

how are these arrays are formed?

The RGB of red is (255, 0, 0) and its HSV is (0°, 100°, 100°)

How’s the RGB 255,0,0 to be relevant into ([0,100,100]) and ([20,255,255])? (reading it BGR shall be 0,0,255)

Thank you.

How to define the “lower” and “upper” range of a color?

Hi, could you please help me with a question defining the range of a certain color?

Learning from the question and answers in the site /31305/why-is-this-simple-mask-not-working/

The lines limiting the red are 2 arrays:

lower = n.array([0,100,100])
upper = n.array([20,255,255])

how are these arrays are formed?

The RGB of red is (255, 0, 0) and its HSV is (0°, 100°, 100°)

How’s the RGB 255,0,0 to be relevant into ([0,100,100]) and ([20,255,255])? (reading it BGR shall be 0,0,255)

Thank you.