import cv2 cap= cv2.VideoCapture(0) while(True): ret,frame = cap.read() w =frame.shape[1] h =frame.shape[0] w=w/2 h=h/2 print(frame.shape) p1=(w-50.0,h-50.0) p2=(w+50.0,h+50.0) color = (255, 0, 0) cv2.rectangle(frame,p1,p2,color,2) cv2.imshow("Kamera",frame) if cv2.waitKey(1)==ord("e"): break cap.release() cv2.destroyAllWindows()