These Photos Suck
October 10, 2009 4:41 PM   Subscribe

I need an automated method for measuring the quality of an image.

Specifically, I'm trying to measure how blurry an image is -- both in gaussian terms, and along a motion-blur -- and how noisy an image is. I understand how to do this if I have an original, high quality image to compare against, but in this scenario all I have is the degraded image. What should I use, and are there any existing codebases to build from?
posted by effugas to Computers & Internet (7 answers total) 2 users marked this as a favorite
 
Best answer: Image Blur Detection via Hough Transform. Lots of references.
posted by Foci for Analysis at 4:49 PM on October 10, 2009


Involving edge detection seems complicated to me. Couldn't one just do a Fourier transform of the image and note the lack of energy at higher frequencies?
posted by tss at 4:58 PM on October 10, 2009


Response by poster: I can definitely *see* the blurs in a 2D FFT. The question is how I programmatically extract a blur metric. And I need help on noise measurement too -- among other things, I want to differentiate false edges (just noise) from real edges (actual signal).
posted by effugas at 5:18 PM on October 10, 2009


My gut feeling is that the two requirements - blur, and noise - are somewhat at odds with each other, and simply analysing a Fourier transform wouldn't be enough. Sure, blur will tend to result in a lack of higher-frequency energy, but noise will put it right back.

It'd be simple enough to do, however, and might show patterns that make it possible, particularly if the noise is specific in structure e.g. shot noise, harsh grain, or compression artefacts.

(disclaimer: all this is based on my knowledge of analysis of audio spectrum data, not images.)
posted by Pinback at 5:22 PM on October 10, 2009


Response by poster: Imagine a photo taken in insufficient light. Either the shutter is open too short -- meaning the image is very noisy -- or the shutter is open too long, meaning the image is very blurry (with nonlinear motion blur). It's also possible that the lens was out of focus.

So, given these constraints, I'm wanting:

1) Determine if blurry.
2) If not blurry, determine if noisy.
posted by effugas at 5:29 PM on October 10, 2009


On lack-of-preview: since you've got a finite data set (your image), a DFT may prove better than a FFT.

And back on preview: Hmmm... shot/sensor noise should = a narrow-ish high-freq spike, while edges should show a distinct pattern, or at least a wider band, in most cases. Then you could do a weighted comparison above / below a computed threshold.

In other words, check for high frequencies first, analyse to see if it's from noise or edges, then check for blur.

But I'm willing to wait for some real mathematicians / image processing experts to tell me how wrong I am ;-)
posted by Pinback at 5:45 PM on October 10, 2009


I would think that shot noise and sensor noise would be pretty broadband, not a high frequency spike. It's a set of uncorrelated impulses.

Sensor noise might be different along the X and Y axes of a 2-d FFT, since some component of it presumably comes from row/column amplifiers rather than the sensor proper.
posted by hattifattener at 11:09 PM on October 10, 2009


« Older Love Has a Nasty Habit of Disappearing Overnight   |   What are my options with a dead external drive? Newer »
This thread is closed to new comments.