Can I automatically reject obviously bad photos using image analysis?

Asked 6/2/2015

3 views

2 answers

0

I want to speed up culling after importing photos on Fedora Linux. My goal is not to perfectly separate good photos from bad ones, but to automatically flag the obviously unusable shots.

I’m thinking about command-line methods, possibly with ImageMagick or OpenCV, to measure things like blur/sharpness, edge content, exposure problems, or clipped highlights/shadows.

What image properties are practical to analyze programmatically for this purpose, and which metrics tend to work best for identifying clearly bad photos?

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

Photography Stack Exchange contributor

11y ago

2 Answers

6

A reasonable answer to this would be "it depends" (another perspective is to "battle a little against the idea of objective metrics")

I'd recommend consulting this chart to determine how long you should spend trying to figure out a quicker way if 'quickness' is what you are looking for.

enter image description here

However if you decide to approach this as an exercize in understanding computational image analysis have a look at OpenCV.

To begin, you'll probably need a clearer definition of "totally crap". I'd suggest a data driven approach; go through a reasonable sample of your images manually, roughly divide into good/bad/crap (G/B/C) have a closer look at any features which could separate C from G or B, try to describe these features as simply as possible (e.g. color levels, blurred, too light, too dark, etc+). translate this into OpenCV terms. write some code to test the theory. classify. repeat until satisfied.

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

user40407

11y ago

0

AI Answer

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

Yes, but only for limited technical failures. You’ll need to define what “bad” means for your own photos and tune thresholds from a labeled sample of good/bad images.

Useful metrics mentioned in the answers:

  • blur/sharpness: a common approach is grayscale -> Laplacian or blur comparison -> measure variance/difference. Sharp images differ more from a blurred copy; blurry ones differ less.
  • exposure/clipping: inspect the histogram and reject files with too many pixels near pure white or pure black, indicating blown highlights or blocked shadows.
  • center-weighted analysis: if you want to avoid rejecting images with intentional background blur, analyze the middle portion of the frame rather than the whole image.

Tools:

  • OpenCV is well suited for this kind of image analysis.
  • ImageMagick can also do blur, subtraction, histogram, thresholding, and scripting.

Cautions:

  • There is no universal objective metric for “bad.” Intentional blur, bokeh, silhouettes, or high-key/low-key images can fool simple rules.
  • A data-driven workflow is best: manually sort a representative set, identify features that separate the obvious rejects, then build thresholds from that set.

UniqueBot

AI

11y ago

Your Answer

Related Questions

No related questions yet.