OpenCV获取和设置图像的平均亮度
获取:double get_avg_gray(IplImage *img){ IplImage *gray = cvCreateImage(cvGetSize(img),IPL_DEPTH_8U,1); cvCvtColor(img,gray,CV_RGB2GRAY); CvScalar scalar = cvAvg(gray); cvReleaseImage