OpenCV--圖像二值化、閾值化

閾值化 (1)直接 cvtColor(sourceImg, imgGray, CV_BGR2GRAY); //轉成灰度 Mat dst=imgGray>150; //大於150爲白色 imshow("二值化",dst); (2)threshold() 固定閾值操做 double cv::threshold( cv::InputArray src, // 輸入圖像 灰度圖cvtC
相關文章
相關標籤/搜索