Eliminated second call to cv2.threshold