我想从相机中读取输入并在列表中附加帧,显示列表中的帧。代码在添加到列表中后,读取并显示帧需要花费大量时间
def test(source_file):
ImagesSequence=[]
i=0
capture = VideoCapture(source_file)
while(1):
ret, frame = capture.read()
while(True):
imshow('Input', frame)
ImagesSequence.append(frame)
imshow('Output',ImagesSequence[i].astype(np.uint8))
i=i+1
if cv2.waitKey(60) & 0xFF == ord('q'):
break
return ImagesSequence
test(0)
正如Christoph指出的,程序中运行着一个实际的无限循环,删除它将修复程序
相关问题 更多 >
编程相关推荐