fitting trajectory to the first frame