def get_fps(source, Videolength):
cap = cv2.VideoCapture(source)
frame_counter = 0
print "Calculating Frames per second . . . "
while (True):
# Capture frame-by-frame
ret, frame = cap.read()
if not ret:
break
frame_counter += 1
cap.release()
cv2.destroyAllWindows()
fps = float(frame_counter/Videolength)
print "\nFPS is " +str(fps)+"\n"
return fps
#Algorithm to check intersection of line segments
#It checks iteratively intersection between a pair of points(Last location of the vehicle) and pairs of points of another List(Pedestrian path)
评论列表
文章目录