Analog video digitized from noisy sources can suffer of line registration problems due to bad synchronization pulses. The effect is that the image lines are randomly shiftedwith respect to their original location. Since the vertical lines become jagged, the quality is very bad for the viewer. In this paper a new algorithm for recovering the original image is proposed, based on a dynamic programming method. The recovered image is obtained by a global optimization of a cost function composed of terms computed by correlating adjacent triplets of lines. Experiments show that this process is able to recover images nearly correctly, and that it is tolerant to moderate amount of added luminance noise and to various distributions ofjitters.