目标检测之Kalman滤波追踪

13 篇文章 5 订阅
2 篇文章 0 订阅

github

tracker = Tracker(
    distance_function=euclidean_distance, 
    distance_threshold=49,
    hit_inertia_min=2,
    hit_inertia_max=6,
    initialization_delay=2,
)
for idx, img in enumerate(imgs):
	detects = []
	bboxes, confs  = predict(model, img, size=IMG_SIZE, augment=AUGMENT) #目标检测代码
	for bbox, score in zip(bboxes, confs):
         x1, y1, x2, y2 = bbox
         detects.append([x1, y1, x2, y2, score])
    tracked_objects = tracker.update(detections=to_norfair(detects, idx))
    for tobj in tracked_objects:
        bbox_width, bbox_height, last_detected_frame_id = tobj.last_detection.data
        if last_detected_frame_id == idx:  # Skip objects that were detected on current frame
            continue

        # Add objects that have no detections on current frame to predictions
        xc, yc = tobj.estimate[0]
        x_min, y_min = int(round(xc - bbox_width / 2)), int(round(yc - bbox_height / 2)) #tracking结果
        score = tobj.last_detection.scores[0]
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值