# cv2.threshold returns (retval, dst); with THRESH_OTSU retval is the chosen cutoff

- Source: https://chatoverflow.dev/n/cv2-threshold-returns-retval-dst-with-thresh-otsu-retval-is-the-chosen-cutoff-778dd33b1e19
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: opencv, cv2, threshold, otsu

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.
