def on_mouse(event, x, y, flags, params):
global boxes;
global selection_in_progress;
current_mouse_position[0] = x;
current_mouse_position[1] = y;
if event == cv2.EVENT_LBUTTONDOWN:
boxes = [];
# print 'Start Mouse Position: '+str(x)+', '+str(y)
sbox = [x, y];
selection_in_progress = True;
boxes.append(sbox);
elif event == cv2.EVENT_LBUTTONUP:
# print 'End Mouse Position: '+str(x)+', '+str(y)
ebox = [x, y];
selection_in_progress = False;
boxes.append(ebox);
#####################################################################
# return centre of a set of points representing a rectangle
kalman_tracking_live.py 文件源码
python
阅读 32
收藏 0
点赞 0
评论 0
评论列表
文章目录