Locating moving objects in a scene is a generic task needed in numerous applications. Whenever the viewing system is static, detecting moving objects in the scene simply leads to detecting moving regions in the image plane. We describe an original framework to solve this labeling problem. The framework is based on a statistical regularization approach using spatiotemporal Markov fields. It takes temporal variations of the intensity function as observations and delivers two-symbol label maps. The solution is derived by minimizing an energy function using an iterative deterministic relaxation scheme and it is independent of the size, intensity distribution, motion magnitude, and direction of the image of the moving objects. Experiments carried out on real image sequences depicting outdoor scenes are reported. The computations are local and can be easily parallelized. This motion detection algorithm can also lead to an elementary, straightforward but useful tracking procedure applied at the moving object mask level.