heisenberg_1995
New Coder
I want to change my cursor style from default to cross while parsing through an image. To do that I came across Tkinter, So, how can I integrate the following code with Tkinter? I can change the cursor style in a Tkinter window. Any other solution is also acceptable for me.
Code:
import cv2
clicks = []
def click_event(event, x, y, flags, params):
if event == cv2.EVENT_LBUTTONDOWN:
clicks.append((x,y))
if len(clicks) > 3:
print(str(clicks).strip('[]').strip('()').replace('), (', ','))
clicks.clear()
if __name__=="__main__":
img = cv2.imread("/home/heisenberg/Study/Database/New_Rsearch/Data/train_img_608.jpg")
cv2.imshow('image', img)
cv2.setMouseCallback('image', click_event)
cv2.waitKey(0)
cv2.destroyAllWindows()
Last edited by a moderator: