MCPcopy Create free account
hub / github.com/alpha2phi/python-apps / calculate_fps

Function calculate_fps

computer-vision/04_pose.py:6–19  ·  view source on GitHub ↗
(img, pTime, pos=(50, 80), color=(0, 255, 0), scale=4, thickness=4)

Source from the content-addressed store, hash-verified

4
5
6def calculate_fps(img, pTime, pos=(50, 80), color=(0, 255, 0), scale=4, thickness=4):
7 cTime = time.time()
8 fps = 1 / (cTime - pTime)
9 pTime = cTime
10 cv2.putText(
11 img,
12 f"FPS: {int(fps)}",
13 pos,
14 cv2.FONT_HERSHEY_PLAIN,
15 scale,
16 color,
17 thickness,
18 )
19 return pTime, img
20
21
22def show_video(capture):

Callers 1

show_videoFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected