algo.py 文件源码

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

项目:MultiObjectTracker 作者: alokwhitewolf 项目源码 文件源码
def get_points(event,x,y,flags,param):
    global lpnts,rpnts

    if event == cv2.EVENT_LBUTTONDOWN:
        lpnts = np.append(lpnts, np.array([[x, y]]), axis=0)
        cv2.polylines(img, [lpnts], False, (0, 0, 255))



    if event == cv2.EVENT_RBUTTONDOWN:
        rpnts = np.append(rpnts, np.array([[x, y]]), axis=0)
        cv2.polylines(img, [rpnts], False, (255, 0, 0))

        if rpnts.size>2:
            check(lpnts, rpnts[-1], rpnts[-2])



#check if the new point crosses a line
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号