1. A method for tracking objects in a scene being viewed by a sequence of digital images, said method comprising: separating, by a processor, a region of interest in the digital images into a plurality of spatially smaller, overlapping modules, defining, by a processor, a hidden Markov model for each module, said hidden Markov model having a state space describing a grid of center points of objects within the module, observing, by a processor, detections of positions of possible objects at different times by performing image analysis of the sequence of images, considering, by a processor, a set of states at a point of time (t 1 ) such that the set of states includes a state having a global optimum probability, wherein said point of time (t 1 ) occurs before the entire sequence of digital images has been measured (t 1 <T), and backtracking, by the processor, through the sequence of digital images for each hidden Markov model to shrink the set of states that are possible for earlier parts of the sequence of digital images, wherein said backtracking includes starting backtracking from each state in said set of states at a point of time (t 1 ) until a single optimal state is found for an earlier point of time (t 2 <t 1 ), whereby tracks of detected objects through the scene are determined up to the earlier point of time (t 2 ), wherein only the most probable state sequences are stored and wherein a sum of probabilities of discarded state sequences is calculated to verify that a global optimum is determined.