Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import cv2
- import copy
- import time
- image = cv2.imread("/Users/matijakrivosic/Documents/JOB/ParkingLotDetection/image.jpg")
- cv2.imshow("image", image)
- tuple_list = [(100, 120), (20, 30)]
- """Pritiskom na slovo m ulazi se u funkciju u kojoj se kordinate pomicu sa wsad izlazi se iz
- te funkcije s pritiskom na m i isto tako se ponovo ulazi u modifikacije"""
- def move_points(tuple_list):
- new_tup = []
- while True:
- key = cv2.waitKey()
- print(key)
- if key == ord('w') or key == 56:
- print("W")
- for tup in tuple_list:
- x, y = tup
- x = x - 1
- new_tup.append((x, y))
- tuple_list = copy.copy(new_tup)
- new_tup = []
- print(tuple_list)
- elif key == ord('s') or key == 50:
- print("S")
- for tup in tuple_list:
- x, y = tup
- x = x + 1
- new_tup.append((x, y))
- tuple_list = copy.copy(new_tup)
- new_tup = []
- print(tuple_list)
- elif key == ord('a') or key == 52:
- print("A")
- for tup in tuple_list:
- x, y = tup
- y = y - 1
- new_tup.append((x, y))
- tuple_list = copy.copy(new_tup)
- new_tup = []
- print(tuple_list)
- elif key == ord('d') or key == 54:
- print("D")
- for tup in tuple_list:
- x, y = tup
- y = y + 1
- new_tup.append((x, y))
- tuple_list = copy.copy(new_tup)
- new_tup = []
- print(tuple_list)
- if key == ord('m'):
- break
- print(tuple_list)
- while True:
- k = cv2.waitKey()
- if k == ord('m'):
- print("Ušo sam u fine tuning")
- move_points(tuple_list)
- print("Izašao sm iz fine tuning-a")
- continue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement