简体   繁体   English

OpenCV - 用于跟踪红色的 HSV 值范围

[英]OpenCV - HSV range of values for tracking red color

Could you please tell me how to what are ranges for Hue, Saturation and Value indices for intense red?你能告诉我浓红色的色相、饱和度和价值指数的范围是多少吗?

I try to use this values for color tracking and I couldn't find a specific answer via Google.我尝试使用此值进行颜色跟踪,但无法通过 Google 找到具体答案。

you can map any color to OpenCV HSV.您可以将任何颜色映射到 OpenCV HSV。 Actually opencv use 180 0 hue cylinder while ideally it is 360, on the orher hand MS paint use 240 0 cyllinder.实际上,opencv 使用 180 0色相圆柱体,而理想情况下它是 360 色相圆柱体,另一方面,MS Paint 使用 240 0色相圆柱体。
So to get OpenCV HSV value, simply open MS paint, open mixer, and read the value of HSV, now to map this value into OpenCV HSV multiply it with 180/240.所以要获得 OpenCV HSV 值,只需打开 MS Paint,打开混合器,然后读取 HSV 的值,现在将此值映射到 OpenCV HSV 乘以 180/240。
the range to value for saturation and value is 0 0 -180 0饱和度和值的范围是 0 0 -180 0

You are the only one who can answer this question, since we don't know your criteria for "intense red".您是唯一可以回答这个问题的人,因为我们不知道您对“深红色”的标准。 Collect as many samples as you can, some of which you consider intense red and some which are close but just miss the cut.尽可能多地收集样品,其中一些您认为是深红色,而一些很接近但只是错过了切割。 Convert them all to HSL.将它们全部转换为 HSL。 Study the pattern.研究模式。

You might put together a small app that has sliders for the H, S, and L parameters and displays a block of color corresponding to the settings.您可以将一个小应用程序放在一起,其中包含 H、S 和 L 参数的滑块,并显示与设置相对应的颜色块。 That will tell you your limits very quickly.这会很快告诉你你的极限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM