我正在计算两幅图像的平均图像,但不知道在 OpenCV 中使用函数 mean() 的正确方法。
Mat img1,img2,img3;
img1=imread("picture1.jpg");
img2=imread("picture2.jpg");
img3=mean(img1,img2);
不管怎么说
R6010
-abort() has been recalled
如何获得 img1 和 img2 的平均值? 谢谢。
最佳答案
你可以使用 cv::accumulate
:
Mat img3 = Mat::zeros(img1.size(), CV_32F); //larger depth to avoid saturation
cv::accumulate(img1, img3);
cv::accumulate(img2, img3);
img3 = img3/2;
关于c++ - 如何在 OpenCV 中获取多个图像的平均图像(使用 C++)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30997401/