threshold_value, mask = cv.threshold( gray, 0, 255, cv.THRESH_BINARY_INV | cv.THRESH_OTSU, )