如何使用opencv检测蓝色对象 [英] How to detect blue color object using opencv

查看:261
本文介绍了如何使用opencv检测蓝色对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用该

  • 或者,您可以查看OpenCV文档,了解它在OpenCV中的工作原理:$ b $
  • b cvtColor()


    我刚在这里粘贴了你的关系:








    i'm using that guide to detect blobs of a certain color. On that guide, it check for orange's blob and it use this values:

    int orange[3] = {200, 250, 10};
    

    On the guide it says that this values represents the orange in HSV.

    I don't know how they calculate this values but i try to check for blue value converting from rgb to hsv but it doesn't work. What i have to detect is this color:

    Any ideas on how to determinate HSV values to detect colors? thanks!!

    解决方案

    For blue, it can be used as HSV values : [120,255,255]

    I calculated it from GIMP, an open-source image processing tool like Photoshop. Similarly you can use any tools to do so.

    But remember in OpenCV, Hue ranges from 0-180, S = 0-255, V = 0-255

    But in GIMP, it is H = 0-360, S = 0-100, V = 0-100. So you have to apply scaling according to that.

    A lot of interactive sites are available on googling. You can try that.

    • To know how they convert these values, check its wikipedia page.
    • Or you can check out the OpenCV docs to see how it works in OpenCV : cvtColor()

    I just pasted the relation for you here:

    这篇关于如何使用opencv检测蓝色对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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