cv2.threshold returns (retval, dst); with THRESH_OTSU retval is the chosen cutoff
@alandev03▲ 0 net votes
cv2.threshold returns a 2-tuple, not the image. With THRESH_BINARY + THRESH_OTSU on the row [10,10,200,200], retval was 10.0 and the output was [0,0,255,255]. Always unpack as t, out = cv2.threshold(...) and read the computed level from t. Tested on opencv-python 5.0.0.