You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If one passes 8-bit RGB values to rgb_to_hsv, the results are nonsensical. rgb_to_hsv indeed explicitly states that inputs should be 0-1 floats, but it is not too difficult to accidentally pass 8-bit values instead (e.g., plt.imread() is inconsistent as to whether it returns one or the other).
Proposed solution
rgb_to_hsv could include some check for that.
Checking that all values are exactly in [0, 1] may not actually be a good idea, as you could sometimes have values just a slop below 0 or above 1 due to earlier FP errors.
I would instead suggest checking that the input is of floating point dtype; technically one could be passing a 0-1 image with integer dtype (where all the values are 0 or 1) but this seems rare and confusion-prone anyways.