You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to add speed, so I the "webcam or video" is seen as the driving vehicle.
I know that speed is distance over time. So i get the frames per second keep record of the distance travelled per frame, i should be able to estimate speed.
while True:
# Read the next frame from the video file
ret, frame = cap.read()
count_frames += 1
if ret:
elapsed_time = time.time() - start_time
current_fps = count_frames / elapsed_time
break
else:
break
return current_fps
while cap.isOpened():
try:
ret, frame = cap.read()
except:
continue
I know i have to initial and keep record of distances variable inside UltrafastLaneDetector class. How can i go about doing this? is this the right approach?
The text was updated successfully, but these errors were encountered:
I would like to add speed, so I the "webcam or video" is seen as the driving vehicle.
I know that speed is distance over time. So i get the frames per second keep record of the distance travelled per frame, i should be able to estimate speed.
def calculate_fps(cap):
count_frames = 0
start_time = time.time()
while cap.isOpened():
try:
ret, frame = cap.read()
except:
continue
I know i have to initial and keep record of distances variable inside UltrafastLaneDetector class. How can i go about doing this? is this the right approach?
The text was updated successfully, but these errors were encountered: