我正在从相机捕捉图像并使用opencv保存如下。
cv::Mat leftImage(height, width, CV_8UC3);
//capturing image here
vector<int> compression_params;
compression_params.push_back(CV_IMWRITE_PXM_BINARY);
compression_params.push_back(1);
//writing as ppm image
cv::imwrite("Image_1.ppm", leftImage, compression_params);
答案 0 :(得分:1)
解决!!!
从BRGA到BGR的转换成功了。
cv::Mat leftImage;
cvtColor(leftImage, leftImage, COLOR_BGRA2BGR);