Choosing the correct upper and lower HSV boundaries for color detection with`cv::inRange` (OpenCV)

前端 未结 6 1839
旧巷少年郎
旧巷少年郎 2020-11-22 11:57

I have an image of a coffee can with an orange lid position of which I want to find. Here is it \"image\".

gcol

6条回答
  •  清酒与你
    2020-11-22 12:28

    OpenCV HSV range is: H: 0 to 179 S: 0 to 255 V: 0 to 255

    On Gimp (or other photo manipulation sw) Hue range from 0 to 360, since opencv put color info in a single byte, the maximum number value in a single byte is 255 therefore openCV Hue values are equivalent to Hue values from gimp divided by 2.

    I found when trying to do object detection based on HSV color space that a range of 5 (opencv range) was sufficient to filter out a specific color. I would advise you to use an HSV color palate to figure out the range that works best for your application.

提交回复
热议问题