cv2.error: OpenCV(3.4.9) /io/opencv/modules/highgui/src/window.cpp:382: error: (-215:Assertion failed) size.width>0 && size.height>0 in function ‘imshow’ 这个报错是把图像处理放在了显示的后面造成的,如我的代码:
flag,frame = video.read()
# frame = equalize(frame)
# 将每帧数据显示出来
cv.imshow("frame",frame)
L_frame = frame[0:240, 0:320]
R_frame = frame[0:240, 320:640]
cv.imshow("lframe",L_frame)
cv.imshow("rframe",R_frame)
其中imshow放在了图像剪切前面顾报错,改成这样错误解决。
flag,frame = video.read()
# frame = equalize(frame)
# 将每帧数据显示出来
L_frame = frame[0:240, 0:320]
R_frame = frame[0:240, 320:640]
cv.imshow("frame",frame)
cv.imshow("lframe",L_frame)
cv.imshow("rframe",R_frame)