I have two related questions:
I'm doing color object detection in OpenCV with the
inRange
threshold function. I'm getting excellent results if I manually choose the lower and upper HSV bounds, but this is very sensitive to the lighting conditions. Is there an algorithm that can determine the optimal threshold bounds given the HSV values of the target and the background?As an example, here are the values I'm working with:
Target HSV value: [15, 37, 51]
Background HSV value: [90, 21, 211]
inRange
is simple pixel-by-pixel filter. It doesn't change the threshold conditions dynamically. Is there a color equivalent of adaptive threshold or Otsu threshold? Or an algorithm that can make use of the a priori HSV values of the target and the background?