views:

167

answers:

2

Anyone know of an algorithm that can return fuzzy true/false to if a image has motion blur / camera shake in a image?

Ideally it would be particular to motion blur, as lots of the images in the set might have blurred (Bokeh) backgrounds.

A language preference would be C, Perl, Shell Utility, or Python, but I'm open to anything really.

With my current knowledge of Math / Programming, I don't think I really have a hope of writing such an algorithm, only using one that takes some parameters...

+1  A: 

There are multiple ways to do this, maybe one of the imaging gurus here has a much better answer. Anyways...

My first shot would be to have a frequency analysis of the image (read: 2d fourier transform). Then define a threshold for the high frequencies (i.e. fast changes from one pixel to the next) for true/false. Motion blur filters the high frequencies out. Your mileage may vary, e.g. a completely black picture will have no high frequencies although it is not blurred. Depending on the lens and aperture used, parts of the image may be blurry because they are in the background. I don't think there's a one-size-fits-all solution here.

Thorsten79
+1  A: 

The Discrete wavelet transform is a useful tool in such detection. Here is a paper from Carnegie Mellon School of Computer Science on detecting and quantifying blur in images by using the DWT. For a binary decision, you threshold the amount to a desired level and everything above that has blur.

luvieere