I'm building an image processing pipeline and one step in the process requires thresholding the image based on saturation.
Example code using OpenCV-Python:
H, S, V = cv2.split(img)
mask = cv2.threshold(S, low, 255, cv2.THRESH_BINARY)
I know how to set the low value manually, if I look at the histogram:
(the red arrow indicates the value I would pick)
My question is: how can I programatically find that value?
Some non-rigorous descriptions of the problem:
- find the lower boundary of the right-most "hump"
- find the minimum value that's not at the edges
