When doing stitching step after 2D_tracking steps, error comes out as:
given inputs -
params file name: params_file.yml
action: stitching
starting at 60 trajectories
with 63.7 samples per trajectory on average
searching for candidates to connect:
Traceback (most recent call last):
File "workflow.py", line 1028, in
wf = workflow(fname, action)
File "workflow.py", line 93, in init
self.do_stitching()
File "workflow.py", line 926, in do_stitching
ts.stitch_trajectories()
File "C:\ProgramData\Anaconda3\lib\site-packages\myptv\traj_stitching_mod.py", line 368, in stitch_trajectories
self.calc_dij()
File "C:\ProgramData\Anaconda3\lib\site-packages\myptv\traj_stitching_mod.py", line 161, in calc_dij
v = gradient(x, axis=0)
File "<__array_function__ internals>", line 6, in gradient
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\function_base.py", line 1065, in gradient
"Shape of array too small to calculate a numerical gradient, "
ValueError: Shape of array too small to calculate a numerical gradient, at least (edge_order + 1) elements are required.
I guess it may relate to the disagreement between 3D and 2D stitching or improper setting parameters. Here I set them as:
When doing stitching step after 2D_tracking steps, error comes out as:
given inputs - params file name: params_file.yml action: stitching
starting at 60 trajectories with 63.7 samples per trajectory on average
searching for candidates to connect: Traceback (most recent call last): File "workflow.py", line 1028, in
wf = workflow(fname, action)
File "workflow.py", line 93, in init
self.do_stitching()
File "workflow.py", line 926, in do_stitching
ts.stitch_trajectories()
File "C:\ProgramData\Anaconda3\lib\site-packages\myptv\traj_stitching_mod.py", line 368, in stitch_trajectories
self.calc_dij()
File "C:\ProgramData\Anaconda3\lib\site-packages\myptv\traj_stitching_mod.py", line 161, in calc_dij
v = gradient(x, axis=0)
File "<__array_function__ internals>", line 6, in gradient
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\function_base.py", line 1065, in gradient
"Shape of array too small to calculate a numerical gradient, "
ValueError: Shape of array too small to calculate a numerical gradient, at least (edge_order + 1) elements are required.
I guess it may relate to the disagreement between 3D and 2D stitching or improper setting parameters. Here I set them as:
stitching: trajectory_file: trajectories_2D max_time_separation: 3 max_distance: 5 save_name: trajecotries_stitched