Color detection opencv

混江龙づ霸主 提交于 2019-12-03 15:03:32

You need to the define the treshold in RGB, and process the pixels in the image (hopefully not the whole image but a smaller region of interest, maybe a moving foreground shape) that fit to the deffinition. Something similar to what is discussed here.

I am understanding that you know the color(or colors) you want to detect a priori.

I hope this helps.

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

Hope it helps.

Yes - but it's easier in HSV color space. Tutorials here

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!