wk-labs/lab5.ipynb
2021-11-28 20:35:20 +01:00

1.6 KiB

import cv2 as cv
img = cv.imread('img/billboards.jpg')
def click_event(event, x, y, flags, params):
 
    if event == cv2.EVENT_LBUTTONDOWN:
 
        # displaying the coordinates
        # on the Shell
        print(x, ' ', y)
 
        # displaying the coordinates
        # on the image window
        font = cv2.FONT_HERSHEY_SIMPLEX
        cv2.putText(img, str(x) + ',' +
                    str(y), (x,y), font,
                    1, (255, 0, 0), 2)
        cv2.imshow('image', img)