I am trying to take and display 2 photos, but as result I see first one two times. I have tried using two variables for frames and saving them as file. How can I fix the problem?
#!/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()
↧