-2

I have tried to use the following values to threshold an image to find a tennis ball but I find nothing.

Here are the values I am using in my inRange call

cvScalar(0.11*256, 0.60*256, 0.20*256, 0)

cvScalar(0.14*256, 1.00*256, 1.00*256, 0)

How can I find better values for a tennis ball?

Clip
  • 3,018
  • 8
  • 42
  • 77

1 Answers1

0

You should check only the H and S component, ignore the luma component. Furthermore, rather than hard coding the threshold values, you should use trackbars to set the values.

bikz05
  • 1,575
  • 12
  • 17