Ctesibius
Ctesibius

Reputation: 1

Tracking two different colors using OpenCV 2.3 and Python

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?

Upvotes: 0

Views: 5042

Answers (2)

jlengrand
jlengrand

Reputation: 12827

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!

Upvotes: 0

Abid Rahman K
Abid Rahman K

Reputation: 52646

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:

enter image description here

Upvotes: 3

Related Questions