python opencv imshow not responding
import numpy as np
import cv2
# 载入图像
img = cv2.imread('1.jpg')
cv2.imshow('123', img)
加上cv2.waitKey()
import numpy as np
import cv2
# 载入图像
img = cv2.imread('1.jpg')
cv2.imshow('123', img)
cv2.waitKey()
如果尝试手动关闭cv2.imshow()出的图片,会出现not responding,然后环境崩溃
解决:使用cv2.destroyAllWindows()关闭图片