From 27c3e0319fa0a36a8f40f2aea4e945dcedf052c5 Mon Sep 17 00:00:00 2001 From: sayampradhan <112542130+sayampradhan@users.noreply.github.com> Date: Fri, 14 Oct 2022 23:37:52 +0530 Subject: [PATCH] Format Code --- Basics/screenCap.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Basics/screenCap.py b/Basics/screenCap.py index 7121ade..4eba578 100644 --- a/Basics/screenCap.py +++ b/Basics/screenCap.py @@ -3,7 +3,7 @@ import cv2 -def captureScreen(bbox=(50,50,690,530)): +def captureScreen(bbox=(50, 50, 690, 530)): capScr = np.array(ImageGrab.grab(bbox)) capScr = cv2.cvtColor(capScr, cv2.COLOR_RGB2BGR) return capScr @@ -12,7 +12,15 @@ def captureScreen(bbox=(50,50,690,530)): while True: timer = cv2.getTickCount() img = captureScreen() - fps = cv2.getTickFrequency() / (cv2.getTickCount() - timer); - cv2.putText(img,'FPS {}'.format(int(fps)), (75, 40), cv2.FONT_HERSHEY_SIMPLEX, 0.7, (20, 230, 20), 2) - cv2.imshow('Screen Capture',img) + fps = cv2.getTickFrequency() / (cv2.getTickCount() - timer) + cv2.putText( + img, + "FPS {}".format(int(fps)), + (75, 40), + cv2.FONT_HERSHEY_SIMPLEX, + 0.7, + (20, 230, 20), + 2, + ) + cv2.imshow("Screen Capture", img) cv2.waitKey(1)