Width and Height constants aren't available

asked 2018-02-28 13:36:40 -0600

this is my code:

capture = cv2.VideoCapture(0)
if not(capture.isOpened()):
    capture.open()

capture.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, 640)
capture.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, 480)

And this is the system output:

AttributeError: 'module' object has no attribute 'CV_CAP_PROP_FRAME_WIDTH'

When I tested other projects with the same constants that I had done long ago, didn't work either. But when I code them days ago, worked. Anybody can help me?

I use OpenCV 3.4

edit retag flag offensive close merge delete