I am trying to detect green colour from images, for that I using cv2, by defining upper and lower limit of green colour as [40, 0, 0]
and [90, 255, 255]
, this works well,
Where is "your" green ?
CodePudding user response:
The problem you are having is because the color [50,0,255] (which is in your range) is white, as seen here. (in this picture divide Hue by 2 and multiply Saturation and value with 2.55.)
If you only want green you should set your limits something like the following: Lower [40,70,120] Upper [90,255,255] This way you make sure that white and black that have a hue between 40 and 90 don't get picked up in your program.