3D-Detection-Tracking-Viewer icon indicating copy to clipboard operation
3D-Detection-Tracking-Viewer copied to clipboard

draw motion track

Open lx-ynu opened this issue 2 years ago • 2 comments

Hello, your paper also shows the motion trajectory drawn by you. I would like to ask if you can provide the relevant code for drawing the motion trajectory?

lx-ynu avatar Apr 21 '22 11:04 lx-ynu

have you solved it? thank you!

zzm-hl avatar Aug 11 '22 13:08 zzm-hl

You can add some spheres in the viewer using add_spheres(track_points, del_after_show=False) to represent tracks. An example is as follows:

from viewer.viewer import Viewer
import numpy as np

vi = Viewer() # set box_type='OpenPCDet' if you use OpenPCDet boxes
len_dataset = 1000

for i in range(len_dataset):
    pseudo_boxes = np.array([[i*0.05, -1, 1, 1, 1, 1, 0], [i*0.05, 1, 1, 1, 1, 1, 0]]) # your boxes
    ids = np.array([0,1]) # your boxes ids (optional)

    pseudo_points = np.random.randn(100, 3) # your points

    vi.add_points(pseudo_points, radius=4, scatter_filed=pseudo_points[:, 0])
    vi.add_3D_boxes(pseudo_boxes, ids=ids,caption_size=(0.09,0.09))
    vi.add_spheres(pseudo_boxes[:, 0:3],radius=0.03,res=10,color='red',del_after_show=False, alpha=1) # Draw motion track
    vi.show_3D() # press the Enter key to view

exa

hailanyi avatar Oct 13 '22 11:10 hailanyi

This won't generate the "trace" as you showed right? This will only generate a point in the box at the current time, just like add cars. Correct me if I'm wrong?

Jeremy26 avatar Mar 19 '23 11:03 Jeremy26