6
\$\begingroup\$

I am trying to implement a blur detection algorithm for my imaging pipeline. The blur that I want to detect is both -

  1. Camera Shake: Pictures captured using hand which moves/shakes when shutter speed is less.

  2. Motion blur: Fast moving objects in the scene, captured using a not high enough shutter speed. E.g. A moving car a night might show a trail of its headlight/tail light in the image as a blur.

How can one detect this blur and quantify it in some way to make some decision based on that computed 'blur metric'?

What is the theory behind blur detection?

I am looking of good reading material using which I can implement some algorithm for this in C/Matlab.

\$\endgroup\$
3
  • 7
    \$\begingroup\$ This is interesting, and clearly relates to photography, but generally this site is more on the taking pictures and on using tools to process them, and not so heavy on the math side. It's very possible that one of our more math-heavy users will show up with a good answer, but you might do better simply over on Stack Overflow, where they've got thousands of questions on image processing. stackoverflow.com/questions/tagged/image-processing \$\endgroup\$
    – mattdm
    Mar 2, 2011 at 19:20
  • \$\begingroup\$ That said, you can find some interesting materials which might help by searching google for "motion blur fourier". \$\endgroup\$
    – mattdm
    Mar 2, 2011 at 19:28
  • 2
    \$\begingroup\$ The answers at photo.stackexchange.com/q/9432/1356 may be of some help. Briefly: blur detection algorithms appear mainly to be local contrast/edge detectors with post-processing to estimate amount of blurriness. \$\endgroup\$
    – whuber
    Mar 4, 2011 at 21:04

1 Answer 1

8
\$\begingroup\$

To detect blur you want to detect the lack of sharpness, the easiest way to do this is to look at the first and second image derivatives as fine details will show up as strong gradient. I would have a look at using something like a laplacian filter.

If you want to specifically detect motion blur you need to use an anisotropic kernel that will detect where there is detail in one direction but not the other (as linear motion blur reduces detail along a particular axis). Something like the Harris corner detector is good for this.

Both can (I think) be easily implemented by convolution, there is a function to do this in matlab I think it's called something like conv2

\$\endgroup\$
2
  • \$\begingroup\$ Both blurs will have lack of sharpness in only one direction. However, while camera shake will have the uniform spread of the effect, motion blur will have only parts of the image out-of-sharpness (the moving subject). I don't see how the 2nd derivative comes to help here. \$\endgroup\$
    – ysap
    Mar 3, 2011 at 0:02
  • \$\begingroup\$ BTW, the motion direction need not be horizontal or vertical, so it is not sufficient to just compare the gradient at the X and Y directions. One really needs to consider the full vector gradient. I think, where a motion induced blur exists, you will get a grad vector with a noticeable magnitude (as the image changes more rapidly perpendicular to the motion direction and very slowly in the motion direction). OTOH, if no motion induced blur is present, then the rate of change is equal in all direction, and hence the magnitude of the grad vector is smaller. (???!!?!?? so many years ago...) \$\endgroup\$
    – ysap
    Mar 3, 2011 at 2:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.