单目标追踪——【手工特征和深度特征】

写在前面

最近看了几篇单目标追踪领域的综述论文,想着对单目标追踪领域的经典论文按照时间线进行梳理一下,以便能快快找到现在单目标追踪的研究热点,未来方向。总的是从【相关滤波】和【孪生网络】两个框架为中心进行梳理。此篇先梳理一下目标追踪领域的一些常用特征。

在梳理框架前,首先关注一下在单目标领域中常用的特征。有时,虽然CNN特征应用广泛,但是CNN特征也花费了较大的时间成本,所以在实际的算法落地时,CNN中看不中用。反而应用HOG特征、CN特征的追踪器也能在保证追踪效果不下降太多而达到高fps。

手工特征

HOG(梯度特征)——基于形状边缘特征的描述算子

论文来源:Histograms of Oriented Gradients for Human Detection
参考博客:行人检测之HOG
80行Python实现-HOG梯度特征提取

HOG算法思想
在计算机视觉以及数字图像处理中梯度方向直方图(HOG)是一种能对物体进行检测的基于形状边缘特征的描述算子

### 基于深度学习的目标跟踪算法工作原理详解 #### 3.1 深度多目标跟踪算法概述 在计算机视觉领域,基于深度学习的多目标跟踪(MOT)旨在通过利用神经网络的强大表征能力来实现更精确鲁棒的目标检测与轨迹关联。这类方法通常分为两个主要阶段:检测关联。 #### 3.2 目标检测 对于每一个时间帧内的图像数据,采用预训练好的卷积神经网络(CNN),如Faster R-CNN、YOLO 或 SSD等模型来进行物体实例级别的分类与边界框回归预测[^1]。这些先进的架构能够提供高精度的位置估计,并且可以处理不同尺度下的对象。 #### 3.3 特征提取 为了更好地捕捉时空上下文中关于个体身份的信息,在完成初步的对象定位之后,会进一步应用特征嵌入模块。此过程涉及将每个候选区域映射到低维空间中的向量表示形式——即所谓的外观描述子或re-ID embedding。这一步骤有助于区分相似外形但实际不同的实体,从而提高跨帧匹配性能。 #### 3.4 轨迹管理与更新 当获得了当前时刻所有可能的兴趣点及其对应的特征表达后,则需解决如何有效地建立历史记录之间的联系这一挑战。一种常见策略是构建图结构的数据集,其中节点代表观测到的目标实例而边则编码它们之间潜在的关系;另一种方式则是运用卡尔曼滤波器或其他贝叶斯推断机制来维护动态系统的状态估计并据此做出最优决策。此外,还有一些研究探索了端到端可微分框架的设计思路,试图直接从原始像素输入中习得完整的追踪逻辑而不依赖手工设计规则。 #### 3.5 实例化说明 - SORT算法 作为一类典型的在线实时跟踪方案,SORT采用了较为简单的两步走方针:先由DPM(Detection of People in Motion)获取初始假设集合,再借助匈牙利算法最小化代价矩阵以达成最佳分配效果。具体而言,该算法定义了一个线性运动学模型用于预测下一刻位置变化趋势,并结合IOU交并比测度评估新旧矩形重叠程度进而决定是否属于同一连续路径的一部分[^2]。 ```python import numpy as np from scipy.optimize import linear_sum_assignment class Sort(object): def __init__(self, max_age=1, min_hits=3): self.max_age = max_age self.min_hits = min_hits self.trackers = [] def update(self, dets=np.empty((0, 5))): # Predict the location of trackers at current time step. trks = np.zeros((len(self.trackers), 5)) to_del = [] for t,trk in enumerate(trks): pos = self.trackers[t].predict()[0] trk[:] = [pos[0], pos[1], pos[2], pos[3], 0] matched, unmatched_dets, unmatched_trks = associate_detections_to_trackers(dets, trks) # Update matched trackers with assigned detections. for m in matched: self.trackers[m[1]].update(dets[m[0], :]) # Create and initialise new trackers for unmatched detections. for i in unmatched_dets: trk = KalmanBoxTracker(dets[i,:]) self.trackers.append(trk) # Remove dead tracklet. i = len(self.trackers) for trk in reversed(self.trackers): i -= 1 if (trk.time_since_update > self.max_age): self.trackers.pop(i) ret = [] for trk in self.trackers: if ((trk.hits >= self.min_hits) or (trk.time_since_update == 0)): d = trk.get_state()[0] ret.append(np.concatenate((d,[trk.id+1])).reshape(1,-1)) if(len(ret)>0): return np.concatenate(ret) return np.empty((0,5)) def convert_bbox_to_z(bbox): """ Takes a bounding box in the form [x1,y1,x2,y2] and returns z in the form [x,y,s,r] where x,y is the centre of the box and s is scale/area and r is aspect ratio """ w = bbox[2]-bbox[0] h = bbox[3]-bbox[1] x = bbox[0]+w/2. y = bbox[1]+h/2. s = w*h r = w/float(h) return np.array([x,y,s,r]).reshape((4,1)) def convert_x_to_bbox(x,score=None): """ Takes a bounding box in the centre form [x,y,s,r] and returns it in the form [x1,y1,x2,y2] where x1,y1 is the top left and x2,y2 is the bottom right """ w = np.sqrt(x[2]*x[3]) h = x[2]/w if(score==None): return np.array([x[0]-w/2.,x[1]-h/2.,x[0]+w/2.,x[1]+h/2.]).reshape((1,4)) else: return np.array([x[0]-w/2.,x[1]-h/2.,x[0]+w/2.,x[1]+h/2.,score]).reshape((1,5)) def associate_detections_to_trackers(detections,trackers,iou_threshold = 0.3): # IOU matrix between all pairs of detection boxes vs tracker prediction boxes. iou_matrix = np.zeros((len(detections),len(trackers)),dtype=np.float32) for d,det in enumerate(detections): for t,trk in enumerate(trackers): iou_matrix[d,t] = iou(det,trk) # Solve assignment problem using Hungarian algorithm. row_ind,col_ind = linear_sum_assignment(-iou_matrix) matches,mismatched_det,mismatched_trk=[],[],[] for idx,row in enumerate(row_ind): if iou_matrix[row,col_ind[idx]]<iou_threshold: mismatched_det.append(row) mismatched_trk.append(col_ind[idx]) else: matches.append([row,col_ind[idx]]) for idx,det in enumerate(detections): if idx not in row_ind: mismatched_det.append(idx) for idx,trk in enumerate(trackers): if idx not in col_ind: mismatched_trk.append(idx) return matches,mismatched_det,mismatched_trk ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值