Opencv3 Python imread函数

2016年9月12日 8521点热度 28人点赞 0条评论

 

cv2.imread()函数可以读取图像,第一个参数为读取的文件路径,第二个为读取的模式。无论那种方式模式,imread()都会删除所有的alpha通道信息(透明的)。

  • IMREAD_COLOR : Loads a color image. Any transparency of image will be neglected. It is thedefault flag. = 4
  • IMREAD_GRAYSCALE : Loads image in grayscale mode = 0
  • IMREAD_UNCHANGED : Loads image as such including alpha channel =-1
  • IMREAD_LOAD_GDAL =8
  • IMREAD_ANYDEPTH =2

在默认情况下,imread()函数也会返回BGR格式的图像。BGR与red-green-blue所表示的彩色空间相同,但字节顺序相反。

 

 

 

Dong Wang

I will work as a PhD student of TU Graz in Austria. My research interests include Embedded/Edge AI, federated learning, computer vision, and IoT.

文章评论

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据