imreadimreadcv2.imread()cv2.i

电脑杂谈  发布时间:2018-01-28 02:04:36  来源:网络整理

imread_imshow_python imread

imreadimread

cv2.imread()

cv2.imshow()

cv2.imwrite()

Use the function cv2.imread() to read an image. The image should be in the working directory or a full path of image should be given.

Second argument is a flag which specifies the way image should be read.

imshow_imread_python imread

cv2.IMREAD_COLOR : Loads a color image. Any transparency of image will be neglected. It is the default flag.

实际值为1,加载彩像。任何透明度的图像将被忽略(默认)

cv2.IMREAD_GRAYSCALE : Loads image in grayscale mode

实际值为0,灰度模式

cv2.IMREAD_UNCHANGED : Loads image as such including alpha channel

imread_imshow_python imread

实际值为-1,加载图像,包括 Alpha 通道

1 0 -1

cv2.destroyAllWindows() # 消灭所有窗口

cv2.destroyAllWindow() # 消灭指定窗口

cv2.imwrite('name.png',img) # 保存图片

cv2.waitKey(0) # 等待时间 单位毫秒 0:无限等待


本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/jisuanjixue/article-63300-1.html

    相关阅读
      发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

      热点图片
      拼命载入中...