fps test code added

This commit is contained in:
moonanjum26
2018-09-06 11:17:07 +05:30
parent 2261a6e825
commit c7673b723f
15 changed files with 572 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
import numpy as np
import cv2,time
#ser = serial.Serial('COM8',57600)
cap = cv2.VideoCapture(0)
# Define the codec and create VideoWriter object
t_end = time.time() + 60
counter=0
while(cap.isOpened()):
ret, frame = cap.read()
if time.time() < t_end:
if (ret==True):
counter=counter+1
#cv2.imwrite("images/image%d.jpg" %counter,frame)
else:
break
#end_time = time.time()
#print t_e-t_s
print counter
#print str(end_time-start_time)
# Release everything if job is finished
cap.release()
#out.release()
cv2.destroyAllWindows()
#rVideo()