程序停止响应?
import cv2lena = cv2.imread('/Users/sz/Desktop/OpenCV/lena.jpg')
cv2.imshow('demo',lena)
key = cv2.waitKey()
if key == ord('A'):
cv2.imshow('pressA',lena)
elif key == ord('B'):
cv2.imshow('pressB',lena)
按下A,程序就停止响应了(一直显示正在运行) 不确定这个库是否 需要手动关闭?比如show之后是否需要close? 在if里面加一句
cv.destroyAllWindows()? 本帖最后由 zltzlt 于 2020-7-27 08:30 编辑
import cv2
lena = cv2.imread('/Users/sz/Desktop/OpenCV/lena.jpg')
cv2.imshow('demo',lena)
key = cv2.waitKey()
if key == ord('A'):
cv2.imshow('pressA',lena)
cv2.waitKey(0)
elif key == ord('B'):
cv2.imshow('pressB',lena)
cv2.waitKey(0)
页:
[1]