opencv imread() flags

本文详细介绍了OpenCV中imread()函数的各种加载标志,包括IMREAD_UNCHANGED、IMREAD_GRAYSCALE、IMREAD_COLOR等,讨论了如何根据不同的标志决定图像的色彩空间、深度和尺寸转换,以及如何处理图像的EXIF方向信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

默认值为1:即
always convert image to the 3 channel BGR color image
enum ImreadModes {
  
       IMREAD_UNCHANGED            = -1, //!< If set, return the loaded image as is (with alpha channel, otherwise it gets cropped).//原始图像有alpha通道的话,就保存该通道数据,否则,别的flags会直接将alpha通道丢弃。
       IMREAD_GRAYSCALE            = 0,  //!< If set, always convert image to the single channel grayscale image.
       IMREAD_COLOR                = 1,  //!< If set, always convert image to the 3 channel BGR color image.
       IMREAD_ANYDEPTH             = 2,  //!< If set, return 16-bit/32-bit image when the input has the corresponding depth, otherwise convert it to 8-bit.
       IMREAD_ANYCOLOR             = 4,  //!< If set, the image is read in any possible color format.
       IMREAD_
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值