This commit is contained in:
王庆刚
2024-11-25 18:05:08 +08:00
parent c47894ddc0
commit 8bbee310ba
109 changed files with 1003 additions and 305 deletions

View File

@ -138,7 +138,7 @@ class TrackFrag:
return False
def is_static(self):
def is_static(self, THRESH=50):
box1 = self.boxes[0, :4]
box2 = self.boxes[-1, :4]
@ -148,7 +148,7 @@ class TrackFrag:
ptd2 = np.linalg.norm((ptd[2], ptd[1]))
ptd3 = np.linalg.norm((ptd[0], ptd[3]))
ptd4 = np.linalg.norm((ptd[2], ptd[3]))
condt1 = ptd1<50 and ptd2<50 and ptd3<50 and ptd4<50
condt1 = ptd1<THRESH and ptd2<THRESH and ptd3<THRESH and ptd4<THRESH
if not self.isCornpoint:
self.trajdist_min < 120
@ -179,16 +179,22 @@ class MoveDetect:
tracks = self.tracks
'''减去静止轨迹'''
'''1. 提取手部轨迹轨迹'''
hand_tracks = [t for t in tracks if t.cls==0]
tracks = self.sub_tracks(tracks, hand_tracks)
'''2. 提取静止轨迹'''
tracks_static = [t for t in tracks if t.is_static()]
tracks = self.sub_tracks(tracks, tracks_static)
'''更新轨迹点聚类'''
'''3. 更新轨迹点聚类'''
for track in tracks:
track.update_groups(18)
self.hand_tracks = hand_tracks
self.track_motion = [t for t in tracks if len(t.groups)>=3]
def draw(self):