彩色滤光片的HSV范围 [英] HSV ranges for color filter

查看:83
本文介绍了彩色滤光片的HSV范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究一个有关在opencv中检测交通标志的项目.我需要一个良好的HSV范围,以过滤掉城市环境中的红色,蓝色和黄色交通标志.只是为了让我有一个较小的兴趣范围.因此,我不希望有一个非常准确的范围,而是一个大概的估计.谁能帮我吗??

I am working on a project on detecting traffic signs in opencv. I need a good HSV range to filter out red, blue and yellow traffic signs in the urban environment. This is just so that I have a smaller region of interest. So I do not want a highly accurate range but a rough estimate. Can anyone help me out??

推荐答案

您可能想阅读

You might want to read this link. I extract the interesting part here:

如何找到要跟踪的HSV值?

How to find HSV values to track?

这是在stackoverflow.com中发现的常见问题.这非常简单,您可以使用相同的功能cv2.cvtColor().无需传递图像,只需传递所需的BGR值即可.例如,要查找Green的HSV值,请在Python终端中尝试以下命令:

This is a common question found in stackoverflow.com. It is very simple and you can use the same function, cv2.cvtColor(). Instead of passing an image, you just pass the BGR values you want. For example, to find the HSV value of Green, try following commands in Python terminal:

green = np.uint8([[[0,255,0 ]]])

hsv_green = cv2.cvtColor(green,cv2.COLOR_BGR2HSV)

print hsv_green

[[[ 60 255 255]]]

现在将[H-10, 100,100][H+10, 255, 255]分别作为下限和上限.除了这种方法之外,您还可以使用GIMP等任何图像编辑工具或任何在线转换器来找到这些值,但不要忘记调整HSV范围.

Now you take [H-10, 100,100] and [H+10, 255, 255] as lower bound and upper bound respectively. Apart from this method, you can use any image editing tools like GIMP or any online converters to find these values, but don’t forget to adjust the HSV ranges.

这篇关于彩色滤光片的HSV范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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