diff --git a/parking_space_picker.py b/parking_space_picker.py index 7928fe9..74f8ce3 100644 --- a/parking_space_picker.py +++ b/parking_space_picker.py @@ -1,37 +1,34 @@ -import cv2 #till 24 min import pickle - -width,height=107,48 +import cv2 + +width, height = 107, 48 + try: - with open('CarParkPos','rb') as f: - posList=pickle.loads(f) + with open('CarParkPos', 'rb') as f: + posList = pickle.load(f) except: - posList= [] - -path="Assets/carParkImg.png" -# print(img.shape) - -#get mouse click -def mouseClick(events,x,y,flags,params): - if events==cv2.EVENT_LBUTTONDOWN: - posList.append((x,y)) - if events==cv2.EVENT_RBUTTONDOWN: + posList = [] + + +def mouseClick(events, x, y, flags, params): + if events == cv2.EVENT_LBUTTONDOWN: + posList.append((x, y)) + if events == cv2.EVENT_RBUTTONDOWN: for i, pos in enumerate(posList): - x1, y1=pos - if x1