OpenCV写入静态图片时,imwrite函数第三个参数可以设置压缩率,默认值为95.

cv::Mat inImage= cv::imread("lena.jpg");

vector<int> compression_params;       
compression_params.push_back(CV_IMWRITE_JPEG_QUALITY);
compression_params.push_back(); cv::imwrite("outImage.jpg", frame, compression_params);
05-08 08:02