Ex


cv::Mat img,binary;
︙
cv::threshold(img, binary, threshold, maxValue, cv::THRESH_BINARY);