当前位置: 首页 > wzjs >正文

一站式采购平台官网竞价推广开户公司

一站式采购平台官网,竞价推广开户公司,行业网站策划,珠海网站建设推广服务deepsort 算法详解 Unmatched Tracks(未匹配的轨迹) 本质角色: 是已存在的轨迹在当前帧中“失联”的状态,即预测位置与检测结果不匹配。 生命周期阶段: 已初始化: 轨迹已存在多帧,可能携带历史信息(如外观特征、运动模型)。 未被观测到: 当前帧中未找到对应的检测框…
deepsort 算法详解
Unmatched Tracks(未匹配的轨迹)

本质角色:已存在的轨迹在当前帧中“失联”的状态,即预测位置与检测结果不匹配。
生命周期阶段:
已初始化: 轨迹已存在多帧,可能携带历史信息(如外观特征、运动模型)。
未被观测到: 当前帧中未找到对应的检测框,可能因
遮挡、目标消失或检测漏检
导致。
处理逻辑:
未匹配计数增加: 记录连续未匹配的帧数(如time_since_update)。
删除条件: 若未匹配次数超过阈值(如max_age),轨迹被删除。
预测继续: 即使未匹配,算法仍会预测下一帧的位置,以尝试重新匹配。

Unmatched Detections(未匹配的检测框)

本质角色: 是新检测到的候选目标,未被任何现有轨迹“认领”。

生命周期阶段:

  • 新出现的候选: 当前帧的检测结果,尚未被关联到已有轨迹。
  • 可能初始化为新轨迹:若未匹配到任何轨迹,需决定是否将其作为新轨迹的起点。

处理逻辑:

  • 初始化为新轨迹:
    • SORT:直接初始化为新轨迹(无确认机制)。
    • DeepSORT:需满足连续匹配次数阈值(如n_init=3)才能转为“确认态”。
  • 外观特征记录:DeepSORT会保存检测框的外观特征(如深度学习提取的向量),用于后续匹配。
维度Unmatched TracksUnmatched Detections
本质历史存在但暂时未被观测到的目标新出现但未被关联到任何目标的候选
处理逻辑删除或保留决策初始化新轨迹或忽略
算法目标保持轨迹连续性与鲁棒性发现新目标与抗干扰
2. 卡尔曼滤波代码分析
2. 1 初始化状态转移矩阵 F F F和观测矩阵 H H H
class KalmanFilterXYAH:"""A KalmanFilterXYAH class for tracking bounding boxes in image space using a Kalman filter.Implements a simple Kalman filter for tracking bounding boxes in image space. The 8-dimensional state space(x, y, a, h, vx, vy, va, vh) contains the bounding box center position (x, y), aspect ratio a, height h, and theirrespective velocities. Object motion follows a constant velocity model, and bounding box location (x, y, a, h) istaken as a direct observation of the state space (linear observation model).Attributes:_motion_mat (np.ndarray): The motion matrix for the Kalman filter.    F_update_mat (np.ndarray): The update matrix for the Kalman filter.    H_std_weight_position (float): Standard deviation weight for position.  标准差的权重[x  y  a  h  dx dy da dh ]_std_weight_velocity (float): Standard deviation weight for velocity.Methods:initiate: Creates a track from an unassociated measurement.predict: Runs the Kalman filter prediction step.project: Projects the state distribution to measurement space.multi_predict: Runs the Kalman filter prediction step (vectorized version).update: Runs the Kalman filter correction step.gating_distance: Computes the gating distance between state distribution and measurements.Examples:Initialize the Kalman filter and create a track from a measurement>>> kf = KalmanFilterXYAH()>>> measurement = np.array([100, 200, 1.5, 50])>>> mean, covariance = kf.initiate(measurement)>>> print(mean)>>> print(covariance)"""def __init__(self):"""Initialize Kalman filter model matrices with motion and observation uncertainty weights.The Kalman filter is initialized with an 8-dimensional state space (x, y, a, h, vx, vy, va, vh), where (x, y)represents the bounding box center position, 'a' is the aspect ratio, 'h' is the height, and their respectivevelocities are (vx, vy, va, vh). The filter uses a constant velocity model for object motion and a linearobservation model for bounding box location.Examples:Initialize a Kalman filter for tracking:>>> kf = KalmanFilterXYAH()"""ndim, dt = 4, 1.0# Create Kalman filter model matricesself._motion_mat = np.eye(2 * ndim, 2 * ndim)   # F[8,8]for i in range(ndim):self._motion_mat[i, ndim + i] = dtself._update_mat = np.eye(ndim, 2 * ndim)       # H[4,8]# Motion and observation uncertainty are chosen relative to the current state estimate. These weights control# the amount of uncertainty in the model.self._std_weight_position = 1.0 / 20self._std_weight_velocity = 1.0 / 160
  • ndim = 4:表示位置相关状态的数量,即 x , y , a , h x, y, a, h x,y,a,h(中心坐标、宽高比、高度)。
  • dt = 1.0:时间步长,默认为1秒。
  • 状态转移矩阵 F F F_motion_mat
  • 观测矩阵 H H H_update_mat),4×8的单位矩阵,仅保留前4行(对应位置和尺寸 x x x, y y y, a a a, h h h
  • std_weight_position:位置噪声权重(默认 0.05)。
  • std_weight_velocity:速度噪声权重(默认 0.00625)
2.2 initiate 方法分析

initiate 方法用于根据初始观测值(未关联的检测框)创建一个新的跟踪轨迹的初始状态(均值向量和协方差矩阵)
输入: 观测值为 z 0 = [ x , y , a , h ] z_0 = [x, y, a, h] z0=[x,y,a,h]
输出:

  • 均值向量 μ 0 \mu_0 μ0: 8维(包含位置和速度的初始估计)
  • 协方差矩阵 P 0 P_0 P0 :8×8维,表示初始状态的不确定性均值向量。
   def initiate(self, measurement: np.ndarray) -> tuple:"""Create a track from an unassociated measurement.Args:measurement (ndarray): Bounding box coordinates (x, y, a, h) with center position (x, y), aspect ratio a,and height h.Returns:(tuple[ndarray, ndarray]): Returns the mean vector (8-dimensional) and covariance matrix (8x8 dimensional)of the new track. Unobserved velocities are initialized to 0 mean.Examples:>>> kf = KalmanFilterXYAH()>>> measurement = np.array([100, 50, 1.5, 200])>>> mean, covariance = kf.initiate(measurement)   # x_k,  p_k"""mean_pos = measurement               # [4,] [x, y, a, h]mean_vel = np.zeros_like(mean_pos)   # [4,] [0, 0, 0, 0]mean = np.r_[mean_pos, mean_vel]     # [8,]  np.r_[] 按行放在一起    [100,50,1.5,200,0,0,0,0]std = [2 * self._std_weight_position * measurement[3], 	# x 方向2 * self._std_weight_position * measurement[3], 	# y 方向1e-2,												# a 2 * self._std_weight_position * measurement[3], 	# h方向 10 * self._std_weight_velocity * measurement[3],	# v_x10 * self._std_weight_velocity * measurement[3],	# v_y1e-5,												# v_a10 * self._std_weight_velocity * measurement[3],	# v_h]   # [20.0, 20.0, 0.01, 20.0, 12.5, 12.5, 1e-05, 12.5]covariance = np.diag(np.square(std))    # [8,8] 对角矩阵  [20^2, 20^2 , 0.01^2, 20^2, 12.5^2, 12.5^2, (1e−5)^2, 12.5^2]return mean, covariance                 # (8,), (8, 8) 
2.3 predict方法分析

predict方法实现了卡尔曼滤波的预测步骤,通过状态转移矩阵 F \mathbf{F} F 和过程噪声协方差 Q \mathbf{Q} Q 对下一时刻的状态进行预测

  • 计算下一时刻的均值(位置 = 当前位置 + 速度)。
  • 更新协方差矩阵,结合状态转移和过程噪声。
  • 假设宽高比变化极小,速度噪声较低,确保滤波的鲁棒性。
def predict(self, mean: np.ndarray, covariance: np.ndarray) -> tuple:"""Run Kalman filter prediction step.Args:mean (ndarray): The 8-dimensional mean vector of the object state at the previous time step.covariance (ndarray): The 8x8-dimensional covariance matrix of the object state at the previous time step.Returns:(tuple[ndarray, ndarray]): Returns the mean vector and covariance matrix of the predicted state. Unobservedvelocities are initialized to 0 mean.Examples:    x_k+1 = F* x_k  ; P_K+1 = F* p_k * F^T>>> kf = KalmanFilterXYAH()>>> mean = np.array([0, 0, 1, 1, 0, 0, 0, 0])>>> covariance = np.eye(8)>>> predicted_mean, predicted_covariance = kf.predict(mean, covariance)"""std_pos = [self._std_weight_position * mean[3],self._std_weight_position * mean[3],1e-2,self._std_weight_position * mean[3],]     # [0.05, 0.05, 0.01, 0.05]std_vel = [self._std_weight_velocity * mean[3],self._std_weight_velocity * mean
http://www.dtcms.com/wzjs/470794.html

相关文章:

  • dedecms网站安装合肥网站制作推广
  • 青海疫情最新数据消息长沙正规竞价优化推荐
  • 防城港做网站的合肥网络seo
  • 做网站哪家公司好苏州百度客户电话
  • 官方网站怎么推广市场营销试题库(带答案)
  • wordpress删除后台菜单seo点击器
  • 网站美工培训课程百度seo优化规则
  • 分析一个网站小学生班级优化大师
  • 做dnf辅助网站武汉it培训机构排名前十
  • 化妆品网站设计模板app如何推广以及推广渠道
  • 沈阳唐朝网络的服务内容电商网站seo优化
  • h5网站建设哪家好网推什么平台好用
  • 宁波网站建设在线湖南专业关键词优化服务水平
  • 舟山 做企业网站注册教育培训机构需要什么条件
  • 站长工具爱情岛怎么搞自己的网站
  • 全国网站集约化建设试点建立一个网站需要多少钱?
  • 网页qq无法使用快捷登录北京seo百科
  • 我的世界手机做图的网站手机优化专家
  • 西部数码网站管理助手3.1免费创建个人网站
  • 百度推广投诉电话客服24小时武汉seo优
  • 广州优化网站推广seo网站优化培训厂家报价
  • 衡阳网站建设专家东莞头条最新新闻
  • 佛山网站建设与设计公司网络营销产品的首选产品
  • 东莞+网站建设+定制水北京seo顾问
  • wordpress 切换域名关键词优化怎么操作
  • 科技有限公司可以做网站建设吗百度推广优化师培训
  • 专业企业建站系统云南疫情最新数据消息中高风险地区
  • 特色的网站建设蚂蚁链接bt链接
  • 网络营销销售常州seo外包公司
  • 哪些网站做的好处竞价推广开户公司