颜色检测opencv [英] Color detection opencv
本文介绍了颜色检测opencv的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用opencv,可以在图像或视频帧中执行某种颜色的检测(在一定范围的rgb值之间)吗?
Using opencv, can a detection of a certain colour(Between a certain range of rgb values) be carried out in an image or a video frame?
推荐答案
是的,更好地将图像转换为HSV,并尝试InRangeS函数。以下是同时跟踪两种不同颜色的示例:
Yes, better convert the image to HSV and try the 'InRangeS' function. Here is an example to track two different colors at same time:
https://github.com/abidrahmank/OpenCV-Python/blob/master/Other_Examples/multi_color_two_object.py
希望它有帮助。
这篇关于颜色检测opencv的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文