Tracking two different colors using OpenCV 2.3 and

2020-06-29 17:47发布

问题:

I'm looking for a way to track two different colors at the same time using a single camera with OpenCV 2.3 (python bindings).

I've read through a number of papers regarding OpenCV but can't find any mention as to whether or not it's capable of analyzing multiple histograms at once.

Is this is even technically possible or do I need a separate camera for each color?

回答1:

You don't need two cameras. Instead threshold image for two colours and add it. Then use contours to find the blobs. Below is an example,which tracks blue and yellow color separately.

https://github.com/abidrahmank/OpenCV-Python/blob/master/Other_Examples/multi_color_two_object.py

Below is its output:



回答2:

I don't really understand your concern.

With the camera, you would get an image object. With this image object, you can calculate as much different histograms as you want.

Each histogram would be a different output object :). Basicaly, you could track hundreds of colors at the same time!



标签: python opencv