modify dotrack module

This commit is contained in:
王庆刚
2024-06-03 15:25:39 +08:00
parent d1ea304491
commit f90ef72cbf
19 changed files with 502 additions and 420 deletions

View File

@ -15,17 +15,9 @@ class frontTrack(Track):
def __init__(self, boxes, features, imgshape=(1024, 1280)):
super().__init__(boxes, features, imgshape)
'''5个关键点中心点、左上点、右上点、左下点、右下点 )轨迹特征'''
# self.compute_cornpts_feats()
self.CART_HIGH_THRESH1 = imgshape[1]/2.98
# if self.tid==10:
# print(f"ID: {self.tid}")
'''y1、y2静止状态区间值是 boxes 中对 axis=0 的索引,不是帧索引'''
det_y1 = np.diff(boxes[:, 1], axis=0)
det_y2 = np.diff(boxes[:, 3], axis=0)
@ -78,69 +70,6 @@ class frontTrack(Track):
condt = all(self.boxes[:, 3] > self.imgshape[1]-20)
return condt
# def is_OutTrack(self):
# isout = False
# if self.posState <= 1:
# isout = True
# return isout
# =============================================================================
# def compute_static_fids(self, det_y, STATIC_THRESH = 8):
# '''
# 前摄时y一般选择为 box 的 y1 坐标,且需限定商品在购物车内。
# inputs
# y1D array
# parameters
# STATIC_THRESH轨迹处于静止状态的阈值。
# outputs
# 输出为差分值小于 STATIC_THRESH 的y中元素的start, end索引
# ranges = [(x1, y1),
# (x1, y1),
# ...]
# '''
# # print(f"The ID is: {self.tid}")
#
# # det_y = np.diff(y, axis=0)
# ranges, rangex = [], []
#
# static_indices = np.where(np.abs(det_y) < STATIC_THRESH)[0]
#
# if len(static_indices) == 0:
# rangex.append((0, len(det_y)))
# return ranges, rangex
#
# start_index = static_indices[0]
#
# for i in range(1, len(static_indices)):
# if static_indices[i] != static_indices[i-1] + 1:
# ranges.append((start_index, static_indices[i-1] + 1))
# start_index = static_indices[i]
# ranges.append((start_index, static_indices[-1] + 1))
#
# if len(ranges) == 0:
# rangex.append((0, len(det_y)))
# return ranges, rangex
#
# idx1, idx2 = ranges[0][0], ranges[-1][1]
#
# if idx1 != 0:
# rangex.append((0, idx1))
#
# # 轨迹的最后阶段是运动状态
# for k in range(1, len(ranges)):
# index1 = ranges[k-1][1]
# index2 = ranges[k][0]
# rangex.append((index1, index2))
#
# if idx2 != len(det_y):
# rangex.append((idx2, len(det_y)))
#
# return ranges, rangex
#
# =============================================================================
def is_static(self):
@ -202,14 +131,6 @@ class frontTrack(Track):
return condt
def is_upward(self):
'''判断商品是否取出,'''
print(f"The ID is: {self.tid}")