Shake Reduction

Blur reduction is the next step in improving my astrophography. In fact, I’ve spent lots of time reading and researching blue reduction techniques. With most of what I do, the camera is actually in focus, but the distortions in the lens distort the picture in ways related to the shape of the glass.

Although not directly applicable, I tried out Photoshop‘s shake reduction tool which implements a similar method of deblurring – iterative deconvolution based on inferring a blur kernel from the image. A friend sent me the following test image, taken while on the road and providing plenty of motion blur to eliminate.

You can click on the photos to enlarge them. I’ve also been wanting to get more familiar with ImageMagick‘s tools for similar problems. Specifically we can use Fred’s deconvolution script to perform a non-iterative deconvolution of a source image and a given filter, or in this case the blur kernel. Because this method takes a much simpler approach to deconvolution, it’s very sensitive to noise and small values in the kernel. The noise parameter controls a sort of “fudge-factor” to prevent those divisions from blowing up.

./fftdeconvol -n 0.01 hudson.jpg blur_kernel.png deblurred.jpg

Although this approach takes more work than Photoshop’s (as if ImageMagick ever seemed easier at first glance), the result is stunningly better than I was able to get out of Photoshop. The extra work involved manually figuring out the motion path for the blur and creating a kernel image. It wasn’t that hard: the top left corner of the wooden sign gave away a motion of around forty pixels at a positive thirty-degree angle.

convert -size 2736x2736 xc:black -fill white -draw "line 1350,1378 1385,1358" -alpha off blur_kernel.png

Finding the right noise value did take some trial-and-effort, though I imagine it wouldn’t be too hard to make some form of automation for this step.

Finally, here is the comparison between the original, Photoshop’d, and ImageMagick’d images.

3 thoughts on “Shake Reduction

  1. I used your method to deblur image with Fred’s deconvolution script but it is not giving me any output? Script looks executing fine, there is no error when i pass the command but it gives me nothing after execution.
    Please help!

    1. Thanks for the comment @jhzsite! It’s hard to say what could be happening without diving into it. One way I would start the diagnosis is to check the image formats and images. Are you able to get it running on small JPG images? How about the blur kernel? How did you generate that? It’s important to remember that deconvolution is an operation that inherently involves the potential for divide-by-zero. I’d be happy to take a look at some of the images or intermediate images if you were to post them somewhere (have you tried Cloudup.com? that’s a nice simple place to share files). Best wishes!

Leave a Reply

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close