Summer Start

by VonSchnauzer

submit your photo

Hall of Fame
View past winners from this year

Please participate in Meta
and help us grow.

Take the 2-minute tour ×
Photography Stack Exchange is a question and answer site for professional, enthusiast and amateur photographers. It's 100% free, no registration required.

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.

share|improve this question
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. –  mattdm Mar 2 '11 at 19:20
That said, you can find some interesting materials which might help by searching google for "motion blur fourier". –  mattdm Mar 2 '11 at 19:28
The answers at 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. –  whuber Mar 4 '11 at 21:04

1 Answer 1

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

share|improve this answer
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. –  ysap Mar 3 '11 at 0:02
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...) –  ysap Mar 3 '11 at 2:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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