问题
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