OpenCV - 第一帧覆盖第二帧

时间:2016-02-16 21:08:35

标签: python python-2.7 opencv

我想拍2张照片,但结果我先看了两张照片。我已经尝试将两个变量用于帧并将它们保存为文件。我该如何解决这个问题?

#!/usr/bin/python

import cv2
import time


cap = cv2.VideoCapture(0)
time.sleep(0.25)
ret1, t1 = cap.read()
print 'ret1:', ret1
cv2.imshow('test',t1)

cv2.waitKey(0)

ret1, t1 = cap.read()
print 'ret1:', ret1
cv2.imshow('test1',t1)
cap.release()


while True:
    time.sleep(1)
    if cv2.waitKey(1) == 27:
        break

cv2.destroyAllWindows()

0 个答案:

没有答案