2

I am trying to find the correct lowerbounds/upperbounds threshold values of a ball, so that I can use it in the OpenCV inRange function.

I've read Choosing correct HSV values for OpenCV thresholding with InRangeS, but I still dont understand how to do this in my case:

enter image description here

inRange function:

inRange(frmHsv, Scalar(lowerH, lowerS, lowerV), Scalar(upperH, upperS, upperV), rangeRes);

OpenCV HSV ranges:

H: 0 - 180

S: 0 - 255

V: 0 - 255

How can I find lowerH, lowerS, lowerV, upperH, upperS, upperV?

Community
  • 1
  • 1
Engo
  • 899
  • 3
  • 19
  • 49

1 Answers1

3

Take a look of this tutorial is really good!

It create a trackbar to move the upper and lower value online and check what is the best response for your object. I used for a cylinder color coded detection and works really well.

http://opencv-srf.blogspot.com.au/2010/09/object-detection-using-color-seperation.html