OpenCV_01 数据保存

OpenCV_01 数据保存

函数解读

  • 图像保存函数 imwrite
bool imwrite( const String& filename, InputArray img,
              const std::vector<int>& params = std::vector<int>());
              // filename:图片地址和文件名
              // img:将要保存的Mat矩阵
              // params: 保存图片格式属性设置标志
              //params 用法:	
            /*
            std::vector<int> compression_params;
			compression_params.push_back(cv::IMWRITE_PNG_COMPRESSION); //(见ImwriteFlags)
			compression_params.push_back(9);
			*/
  • imwrite函数第三个参数可选的标志
//! Imwrite flags
enum ImwriteFlags {
   
       IMWRITE_JPEG_QUALITY        = 1,  //!< For JPEG, it can be a quality from 0 to 100 (the higher is the better). Default value is 95.
       IMWRITE_JPEG_PROGRESSIVE    = 2,  //!< Enable JPEG features, 0 or 1, default is False.
       IMWRITE_JPEG_OPTIMIZE       = 3,  //!< Enable JPEG features, 0 or 1, default is False.
       IMWRITE_JPEG_RST_INTERVAL   = 4,  //!< JPEG restart interval, 0 - 65535, default is 0 - no restart.
       IMWRITE_JPEG_LUMA_QUALITY   = 5,  //!< Separate luma quality level, 0 - 100, default is 0 - don't use.
       IMWRITE_JPEG_CHROMA_QUALITY = 6,  //!< Separate chroma quality level, 0 - 100, default is 0 - don't use.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值