Unable to use flags in OpenCV Python?

自作多情 提交于 2019-12-13 16:04:37

问题


I'm unable to use flags in OpenCV.

For example:

import cv2

image = cv2.imread('k.jpg',cv2.CV_LOAD_IMAGE_GRAYSCALE)

cv2.namedWindow('Pic',cv2.CV_WINDOW_NORMAL)

cv2.imshow('Pic', image)

cv2.waitKey()

In this program I'm able to use cv2.CV_LOAD_IMAGE_GRAYSCALE but I'm not able to use flags for namedWindow here. This one gives error:

module has no attribute CV_WINDOW_NORMAL

回答1:


Just a short update:

Since OpenCV 3.0, these are cv2.IMREAD_GRAYSCALE and cv2.WINDOW_NORMAL (use help(cv2) for the whole list).



来源:https://stackoverflow.com/questions/16696251/unable-to-use-flags-in-opencv-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!