opencv3 with Python 3, imshow() displaying no image

asked 2017-06-07 20:45:09 -0600

cv2.imshow seems to not work correctly when running on Python3 but no errors are logged and it works correctly when I use opencv3 with python 2.7.

running this:

import cv2

cap = cv2.VideoCapture(0)

while True:
    ret, frame = cap.read()
    cv2.imshow('frame', frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

cap.release()
cv2.destroyAllWindows()

simply displays:

image description

even creating a blank image doesn't work:

import numpy as np
import cv2

blank_image = np.zeros((600,600,3), np.uint8)
cv2.imshow("blank image", blank_image)
cv2.waitKey(0)

cv2.destroyAllWindows()

image description

I'm running on macOS 10.11, python 3.6.1

edit retag flag offensive close merge delete