//图像的二值化 #include <opencv2/opencv.hpp> using namespace std; IplImage *g_pGrayImage = NULL; IplImage *g_pBinaryImage = NULL; const char *pstrWindowsBinaryTitle = "二值图"; void on_trackbar(int pos) { // 转为二值图 cvThreshold(g_pGrayImage, g_pBinaryImage, pos, 255, CV_THRESH_BINARY); ...