Mat m = imread("2.jpg", CV_LOAD_IMAGE_COLOR); IplImage src(m); cvNamedWindow("showImage"); IplImage* gimg = cvCreateImage(cvGetSize(&src), 8, 1); cvCvtColor(&src, gimg, CV_BGR2GRAY); cvSaveImage("1.jpg", gimg); cvShowImage("showImage", gimg); cvWaitKey(0); cvReleaseImage(...
opencv 4.1 使用 CV_BGR2GRAY提示:未声明的标识符 添加以下引用 include "opencv2/imgproc/imgproc.hpp" include "opencv2/imgproc/types_c.h"