使用OpenCV 2.3和Python跟踪两种不同的颜色 [英] Tracking two different colors using OpenCV 2.3 and Python

查看:95
本文介绍了使用OpenCV 2.3和Python跟踪两种不同的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种使用带有OpenCV 2.3(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).

我已经阅读了许多有关OpenCV的论文,但没有提及它是否能够一次分析多个直方图.

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?

推荐答案

您不需要两个摄像头.而是将两种颜色的图像阈值化并添加.然后使用轮廓找到斑点.下面是一个示例,该示例分别跟踪蓝色和黄色.

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

下面是它的输出:

这篇关于使用OpenCV 2.3和Python跟踪两种不同的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆