QString appPath = QCoreApplication::applicationDirPath(); imagePath = appPath + "/A.jpg"; img = cv::imread(imagePath.toStdString()); if (img.empty()) return; double minv, maxv; Point minLoc, maxLoc; std::vector<Mat> mv; split(img, mv); for (int i = 0; i < mv.size(); i++) { //图像必须单通道 minMaxLoc(mv[i], &minv, &maxv, &minLoc, &maxLoc, cv::Mat()); std::cout << "channel" << i << "min value" << minv << "max value" << maxv<<std::endl ; } Mat mean, stddev; //计算均值方差 meanStdDev(img,mean,stddev); std::cout << "mean" << mean << "stddev" << stddev << std::endl;