def click_and_crop(event, x, y, flags, param):
global refPt, cropping
if event == cv2.EVENT_LBUTTONDOWN: # indicates that the left mouse button is pressed
refPt = [(x, y)]
cropping = True
elif event == cv2.EVENT_RBUTTONDOWN: # indicates that the right mouse button is pressed
refPt.append((x, y))
cropping = False
cv2.rectangle(image, refPt[0], refPt[1], (0, 255, 0), 2)
cv2.imshow("image", image)
# <=====================================================================================>
# Here is the process to crop the window and get the position of the graph
# after the classification of the fish boat
detection_crop_window.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录