I am doing a project which detects helmets using raspberry pi camera.So I have blue and red color helmets.Now I need to detect both the colors and apply mask. But I know how to detect only one color at a time.
Asked
Active
Viewed 64 times
0
-
Please be more specific and post the code what you have tried with. – Mohanavel T Jan 29 '19 at 12:25
-
it would be useful if you could add your input image and the code you have for detecting a single colour. – Mark Setchell Jan 29 '19 at 12:32
-
Use `cv2.inRange()` twice and **or** the results together. – Mark Setchell Jan 29 '19 at 12:53
-
1See here... https://stackoverflow.com/a/48117624/2836621 – Mark Setchell Jan 29 '19 at 13:35
1 Answers
0
You just need to call the color detector 2 times with the differents colors ranges. Don't forget that use the image returned from the first detection on the second.
I have an example here

Marcos Pinho
- 45
- 9