I successfully use cv2.imread to read an image. I can display in the console using matplotlib.imshow. When I use cv2.imshow, nothing happens, no errors, no window opens. Script ends normally, but no image. I tried using different integers with cv2.waitKey() and leaving it empty, but no luck. Works great on Windows, but not on my Mac.
Using Python 2.7, Spyder 3.3.6, openCV 4.2.0
- import cv2
- import numpy as np
- import matplotlib.pyplot as plt
- img =cv2.imread('/Users/Paul/Documents/Photos/F15.jpg',cv2.IMREAD_GRAYSCALE)
- cv2.imshow('test',img)
- cv2.waitKey()
- cv2.destroyAllWindows()