. I am using anaconda 4.8.3, spyder 4.1.3 and opencv-python 4.2.0.34. When I am trying to read simple image, then the python process is suspend. when I am trying to read the video there is the same problem. After each run of program I must restart the kernel.
my code for image:
import cv2
img = cv2.imread("lena.png")
cv2.imshow("Output",img)
cv2.waitKey(0)
my code for video:
import cv2
frameWidth = 640
frameHeight = 480
cap = cv2.VideoCapture("test.mp4")
while True:
success, img = cap.read()
img = cv2.resize(img, (frameWidth, frameHeight))
cv2.imshow("Result", img)
if cv2.waitKey(1) and 0xFF == ord('q'):
break
The video and image are in the same folder as project. Have you got any idea why this is happening? Thanks for help.