Trajectories of objects are estimated by determining the optimal solution(s) of a tracking model on the basis of an occupancy probability distribution. The occupancy probability distribution is the probability of presence of objects over a set of discrete points in the spatio-temporal space at a number of time steps. The tracking model is defined by the set of discrete points, a virtual source location and a virtual sink location, wherein objects in the tracking model are creatable in the virtual source location and are removable in the virtual sink location.