Fixing Old Motion Picture Film

Thief of BaghdadI’ve been reading papers lately about using image processing techniques to remove artifacts and damage from old motion picture film. Some old films are remarkably pristine, but some, like my copy of Douglas Fairbanks’ 1924 version of Thief of Bagdhad show lots of wear and tear.

I think it will be possible to write an automated system for removing many of these artifacts, so I thought I’d give it a whirl. The first baby step is to be able to read individual frames off the DVD and convert them into a canonical format. Luckily, the ffmpeg project has a pair of libraries which can read a wide variety of video formats and convert them into standard grayscale, RGB or YUV colors spaces. Tonight, I wrote a program which slurps off the first 1000 frames from a DVD .vob file, and saves them out as PGM files (grayscale only, since this film is black and white). You can see a small example on the right, or full frame version here. You can see a couple of artifacts: dust, dirt, and vertical scratches. The exposure of the title slide is also rather
uneven.

This is just a baby step, but a necessary one. My next step is to scan the DVD and determine the scene breaks. I suspect I can do this simply by summing the squared differences between adjacent frames, and splitting the sequence at peaks. Once I have this, then I can begin on a scene by scene processing. I envision a system that will eliminate the film weave, uneven exposures, and vertical scratches. If I get that far, I’ll be very, very proud.