detection_crop_window.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:Kaggle_the_Nature_Conservancy_Fisheries_Monitoring 作者: Sapphirine 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号