OpenCV设置保存图像压缩率

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(
100); cv::imwrite("outImage.jpg", frame, compression_params);

 

posted @ 2018-07-31 22:56  一度逍遥  阅读(4503)  评论(0编辑  收藏  举报