update for bakeup
This commit is contained in:
@ -94,19 +94,19 @@ def draw_all_trajectories(vts, edgeline, save_dir, file, draw5p=False):
|
||||
img1 = drawTrack(vts.tracks, img1)
|
||||
img2 = drawTrack(vts.Residual, img2)
|
||||
|
||||
img = np.concatenate((img1, img2), axis = 1)
|
||||
H, W = img.shape[:2]
|
||||
cv2.line(img, (int(W/2), 0), (int(W/2), H), (128, 255, 128), 2)
|
||||
imgcat = np.concatenate((img1, img2), axis = 1)
|
||||
H, W = imgcat.shape[:2]
|
||||
cv2.line(imgcat, (int(W/2), 0), (int(W/2), H), (128, 255, 128), 2)
|
||||
|
||||
|
||||
# imgpth = save_dir.joinpath(f"{file}_show.png")
|
||||
# cv2.imwrite(str(imgpth), img)
|
||||
|
||||
if not draw5p:
|
||||
return img
|
||||
return imgcat
|
||||
|
||||
''' tracks 5点轨迹'''
|
||||
trackpth = save_dir / Path("trajectory") / Path(f"{file}")
|
||||
trackpth = save_dir / Path("trajectory")
|
||||
if not trackpth.exists():
|
||||
trackpth.mkdir(parents=True, exist_ok=True)
|
||||
for track in vts.tracks:
|
||||
@ -114,19 +114,20 @@ def draw_all_trajectories(vts, edgeline, save_dir, file, draw5p=False):
|
||||
img = edgeline.copy()
|
||||
img = draw5points(track, img)
|
||||
|
||||
pth = trackpth.joinpath(f"{track.tid}.png")
|
||||
pth = trackpth.joinpath(f"{file}_{track.tid}.png")
|
||||
cv2.imwrite(str(pth), img)
|
||||
|
||||
for track in vts.merged_tracks:
|
||||
# if track.cls != 0:
|
||||
img = edgeline.copy()
|
||||
img = draw5points(track, img)
|
||||
# for track in vts.Residual:
|
||||
# # if track.cls != 0:
|
||||
# img = edgeline.copy()
|
||||
# img = draw5points(track, img)
|
||||
|
||||
pth = trackpth.joinpath(f"{track.tid}_.png")
|
||||
cv2.imwrite(str(pth), img)
|
||||
# pth = trackpth.joinpath(f"{file}_{track.tid}_.png")
|
||||
# cv2.imwrite(str(pth), img)
|
||||
|
||||
return imgcat
|
||||
|
||||
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# '''3. moving tracks 中心轨迹'''
|
||||
# filename2 = f"{file}_show_r.png"
|
||||
@ -306,7 +307,7 @@ def draw5points(track, img):
|
||||
|
||||
|
||||
'''=============== 最小轨迹长度索引 ===================='''
|
||||
if track.imgBorder:
|
||||
if track.isBorder:
|
||||
idx = 0
|
||||
else:
|
||||
idx = trajlens.index(min(trajlens))
|
||||
|
Reference in New Issue
Block a user