Python代码库OpenCV之03读取和显示图片(含代码)

Python代码库OpenCV之03读取和显示图片(含代码)

代码

import numpy
import cv2
panda_image = cv2.imread("D:\\pythondev\\dev\\opencv\\img\\gray_panda.png")
panda_gray_image = cv2.cvtColor(panda_image, cv2.COLOR_BGR2GRAY)
cv2.imshow("Gray panda", panda_gray_image)
cv2.waitKey(0)
cv2.imshow("Color panda", panda_gray)
cv2.waitKey(0)


cv2.destroyAllWindows()

相关问题

  • opencv图片读取与显示图片窗口未响应问题
    解决方案,cv2.imshow和cv2.waitKey要成对出现
cv2.imshow("Gray panda", panda_gray_image)
cv2.waitKey(0)

更多精彩代码请关注我的专栏

  • selenium & python 源码大全
  • reportlab教程和源码大全
  • python源码大全

你可能感兴趣的:(Python代码库OpenCV之03读取和显示图片(含代码))