Tuesday, January 19, 2010

Pattern recognition

The human nervous system is wonderful at pattern recognition. That's bad news when photographic damage forms a distinctive pattern because even when restoration removes nearly all of the damage our brilliant brains still see a pattern. There's a trick to overcome that effect.

There are always more good images to restore than time to restore them. A friend is collaborating on the Haitian restoration and the Indonesian restoration is nearly finished. Today's post looks at a different part of the Indonesian portrait where the challenge looks difficult and is actually even harder than it seems. Here's what we're dealing with:

Vertical streaks at close parallel are a tough kind of damage. We want to erase those streaks without losing the folds of the garment or the shape of the earring. I worked on this with a healing brush at six pixels diameter, which was just the right width to erase those lines.

Healing brushes work by sampling one area of an image and performing a complex mathematical operation to blend data from that region with a different area. If you think of this intuitively, the way to heal a scratch that goes from a light section of fabric to a dark section of fabric is to choose a source region that has similar light and dark areas. One by one those scratches start to disappear.

The progress feels rewarding for a while until you reach a point where the scratches are nearly gone. But darnit, you still see 'em.

This is one situation where reviewing an area at 200% resolution is not sufficient: subtle patterns emerge when you pull back to 50% resolution. Our brains recognize lines--especially lots of parallel lines. We distinguish lines even when they're faint and discontinuous. This gets very frustrating when you're trying to erase them.

Fortunately you don't have to sit at the computer for hours until you start climbing the wall.

The secret to finishing work on this area is to recognize that your brain is just reacting to a pattern. All you really need to do at this point is break up that pattern and randomize it. So instead of editing in an endless series of vertical strokes, increase the pixel selection and follow the curves of the garment. Clone stamp the delicate areas such as the necklace.

That looks wonderful! Would you consider placing samples of your work under copyleft license for upload to Wikimedia Commons? If you provide high resolution material under a suitable license some of it could get selected as featured pictures and run on Wikipedia's main page in the Picture of the Day section. (Wikipedia's main page gets about five million page views each day).

I just found you via Blog of Note, and am really impressed. I'll have to forward the link to your blog on to my mother, who follows photography and other similar blogs a lot more closely. She would really enjoy this.