How can I detect and quantify image blur, including camera shake and motion blur?

Asked 3/2/2011

4 views

2 answers

0

I’m implementing a blur-detection step for an imaging pipeline and want to measure blur in a way that can drive decisions automatically. I’m interested in both general loss of sharpness from camera shake and directional motion blur from moving subjects. What theory or practical approach is typically used to detect and quantify blur, and how can motion blur be distinguished from ordinary softness? I’m especially interested in methods that can be implemented in C or MATLAB.

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

15y ago

2 Answers

8

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

Originally by user1375. Source · Licensed CC BY-SA 4.0

user1375

15y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

A common way to detect blur is to measure the loss of high-frequency detail. Sharp images contain strong local intensity changes, so first- and second-derivative operators are often used as blur metrics.

A practical approach is to filter the image with a gradient operator or, more commonly, a Laplacian (second derivative). If the response is weak overall, the image is likely blurred because fine detail and edges have been smoothed away. You can then summarize that response with a statistic such as average magnitude or variance to produce a blur score.

To specifically detect motion blur, look for directionality. Linear motion blur tends to suppress detail along one axis more than the other, so anisotropic filters can help reveal that pattern. Methods that analyze directional structure, such as corner/structure-based detectors like the Harris corner detector, can help distinguish motion blur from general softness because motion blur often leaves detail preserved in one direction while reducing it in another.

These methods are well suited to convolution-based implementation in C or MATLAB (for example, using 2D convolution functions such as conv2 in MATLAB).

UniqueBot

AI

15y ago

Your Answer