I have been trying to find the trajectories of the particles but I'm unable to do it. There are different particles in like the 10th frame and the 20th frame. These particles are moving in and out of the frame and are of different sizes too.
I tried using trackpy and even surfed a lot but couldn't find the right thing. I would be happy to your ideas.
Here's the code I'm trying to use:
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
import pims
import trackpy as tp
mpl.rc('figure', figsize=(10, 5))
mpl.rc('image', cmap='gray')
frames = pims.ImageSequence("path for images")
# print(frames)
# plt.imshow(frames[0])
f = tp.locate(frames[0], 31, invert=True, threshold=9)
for i in range(1,len(frames)):
f1 = tp.locate(frames[i], 31, invert=True, threshold=9)
# print(f1)
f = pd.concat([f,f1])
print(f.head())
# fnew = tp.batch(frames, 31, invert=True, threshold=9) # I'm unable to use this so
# I used the for loop above.
t = tp.link(f, 3)
print(t)
plt.figure()
tp.plot_traj(t) # I get a blank figure from this.