18

I recently went on vacation and took close to 1,000 photographs. As usual there are some good ones, bad ones, blurry ones, etc.

In order to expedite post-processing, I was wondering if there is any software out there that can "pre-screen" a batch of photos and identify photos that are over-exposed, under-exposed, blurry, and other characteristics that may identify potentially less-desirable photographs. The ideas is that by pre-screening, it should make quick work of sorting through those groups to find the good ones, and delete the rest. Then I can spend more time looking at the ones that really matter.

I understand that every photograph is unique, and there are some great photographs that break every rule of thumb, but I thought this might be a quick way to speed up my workflow.

9
  • Similar question about focus photo.stackexchange.com/questions/7354/auto-detect-image-focus
    – dpollitt
    Feb 20, 2012 at 14:17
  • I edited the question because we've got several others about photo analysis software simply for reporting on metadata in aggregate. This is different....
    – mattdm
    Feb 20, 2012 at 14:26
  • 2
    Never seen this but it is a great idea. Perhaps it could be implemented as a Lightroom or Bibble plugin and have the culling done on import.
    – Itai
    Feb 20, 2012 at 14:27
  • Thanks for editing the title for clarity. It is right on point with what I was thinking about. Feb 20, 2012 at 15:29
  • 1
    What constitutes a " technical problem " to you ( or the programmer writing the code for the software ) may be an artistic device to someone else.
    – Alaska Man
    Jan 4, 2018 at 18:59

8 Answers 8

8

I use Lightroom to sort through photos. In the Library module I set the filter to Flagged and Unflagged, then make a photo fill the screen. Then I just start hitting the right arrow key or the "x" key. "X" marks the photo as "rejected" and makes it no longer visible. It's easy to jet through 1000 photos in no time. Once I've gone through all photos, I just choose to Delete Rejected Photos, and I'm done.

1
  • 1
    I agree -- a quick pass in Lightroom could narrow your list in a hurry. Seems like a workflow challenge.
    – D. Lambert
    Feb 20, 2012 at 21:03
6

This is pretty easy to do if you can write in Python. Here's a good article on using an open-source computer vision package to detect overall picture blurriness:

https://www.pyimagesearch.com/2015/09/07/blur-detection-with-opencv/

Here's a quick script that will sort pictures into blurred/ok directories:

#
# Sorts pictures in current directory into two subdirs, blurred and ok
#

import os
import shutil
import cv2

FOCUS_THRESHOLD = 80
BLURRED_DIR = 'blurred'
OK_DIR = 'ok'

blur_count = 0
files = [f for f in os.listdir('.') if f.endswith('.jpg')]

try:
   os.makedirs(BLURRED_DIR)
   os.makedirs(OK_DIR)
except:
   pass

for infile in files:

   print('Processing file %s ...' % (infile))
   cv_image = cv2.imread(infile)

   # Covert to grayscale
   gray = cv2.cvtColor(cv_image, cv2.COLOR_BGR2GRAY)

   # Compute the Laplacian of the image and then the focus
   #     measure is simply the variance of the Laplacian
   variance_of_laplacian = cv2.Laplacian(gray, cv2.CV_64F).var()

   # If below threshold, it's blurry
   if variance_of_laplacian < FOCUS_THRESHOLD:
      shutil.move(infile, BLURRED_DIR)
      blur_count += 1
   else:
      shutil.move(infile, OK_DIR)

print('Done.  Processed %d files into %d blurred, and %d ok.' % (len(files), blur_count, len(files)-blur_count))

Your trickiest issue will be to install python and opencv into your system. Google python3 for your OS, and how to install pip with it, you can use pip3 to install opencv. Or, there are some python+opencv pre-build installs as well. You don't need the newest version of opencv to get this script to run.

The script works great, and it measures overall picture blurriness. This is good for most pictures. However, overall picture measurement means those one-face-and-bokeh-filled-background photographs will be put into the blurry directory, and you'll have to sort them back out. Anyway, you should go through the blurred pictures to make sure there's no misplaced keepers in there.

I hope this script speeds up your workflow.

A neat improvement to this script is to include face detection, and compute the blurriness on the biggest faces in the photograph, and use those values for the blurriness threshold, defaulting to the overall bluriness if no faces are detected. I'll leave that improvement up to you!

1
  • Great answer! This will be easy to massage into my own use-case. All my photos are taken with cheap phones or digital cameras. Sometimes I can't keep still enough to get a clear shot easily. But I can take a dozen shots and use a version of this code which I can modify myself to sort them from sharpest to blurriest. Jul 23, 2019 at 9:43
1

Photoshop Elements does have an autoanalysis function which does some of this - it tries to detect if the photos are blurred, if there are faces in them etc. I wouldn't say it is brilliant. For example you may actually want out of focus components in your photograph and the automated algorithm will still mark it as blurred.

I don't think 1000 photos is actually that many to manually go through in a workflow process using something like Lightroom. Start from an initial scan marking as rejected those that are obviously unusable and then refine down using ratings, colour painting and tags as you see fit.

1

I actually was looking around for something that would help me at least start the process of weeding things out (thousands of bracketed images).

I made a simple tool to scan a directory of images and move over/underexposed images into a different folder. It is not perfect and by no means allows the artistic freedoms that photography does (but it helps save me time). What it technically does is get the average pixel value of each image (from 0 - 1.0) and then you can keep or reject based on thresholds that can be set. Check out the AutoExposureChecker project and docs on github for more info.

With this tool, I can then just double check that all of the images are ok to delete (moving out those that are actually wanted) and wipe everything else in one first pass, saving me tons of time.

Anyways, thought I would share and happy shooting!

1

I don't know of applications that can automatically screen potentially flawed pictures for you, but I wouldn't use them, at least not blindly.

Technical merit is just part of what a photo is. Some of the most meaningful images happen to be technically flawed. In many cases, preferable to a more technically perfect one that, for instance, has a poorer composition or less of what Cartier Bresson called "the decisive moment".

Also, some flaws can be fixed or improved in editing. While focus and blur are pretty much impossible to correct (though this can change in the future), it can add an interesting or acceptable effect. Exposure, for instance, is one of those. A slightly over or underexposed image (especially if taken in RAW) shouldn't be preferred to a "perfectly" exposed one on this property alone, because it can easily be fixed.

For example, this picture was a one-off shot that came out almost 3EV overexposed because the camera had the wrong settings. Yet thanks to the latitude provided by RAW files, it could be recovered, while an automated process would have discarded it.

So, I second answers before mine, saying that a workflow efficiently supported is better than an automated process. Thousands of pictures are quite manageable in Lightroom within an hour or two.

2
  • 3
    I also agree with yours and everyone's thoughts here, which is why I stated "I understand that every photograph is unique, and there are some great photographs that break every rule of thumb". There is no "magic tool" that one can run to find great photos because the human brain is the only thing that can tell us if a photograph is moving to us or not. Really it was just a concept that I had and wondered if anyone had already tried similar techniques. Following any software blindly is just plain dumb, but tools can often be used to help guide us along our way. Feb 20, 2012 at 22:26
  • Absolutely, this type of screening could be useful to have the application suggesting you changes instead of culling photos. You could be able to normalise exposure on similar pictures, for instance, before adding an editing preset.
    – guioconnor
    Feb 20, 2012 at 22:31
0

Check DXO Photo lab. It can automatically correct photos based on the camera and lens profiles. You can quickly rate the photos by browsing through them and export only the photos which you have rated.

0

Agisoft Metashape can estimate image quality. This is described in the manual on page 14:

Poor input, e. g. vague photos, can influence alignment results badly. To help you to exclude poorly focused images from processing Metashape suggests automatic image quality estimation feature. Images with quality value of less than 0.5 units are recommended to be disabled and thus excluded from photogrammetric processing, providing that the rest of the photos cover the whole scene to be reconstructed. To disable a photo use Disable button from the Photos pane toolbar.
Metashape estimates image quality for each input image. The value of the parameter is calculated based on the sharpness level of the most focused part of the picture.

0

Overexposure, underexposure, blurriness all result in loss of information that allows JPEG compression to reduce the files more effectively.

So as a very rough measure, you can sort the JPEG files according to ascending file size and start your culling process from the smallest size. Here the ratio of files you are not interested in keeping should be significantly higher than with those files that have higher file size, assuming similar image taking conditions.

Files taken at higher ISO values, however, will tend to be noisier and noise doesn't compress well. However, it is likely that your camera's noise reduction algorithms will throw away enough information to make those files better compressible again. There might be some point to looking at different ISO values separately, but it depends on your camera's algorithms whether that sort of pre-sorting will make much of a difference.

2
  • This is not good advice. A sharp, well-exposed image with few colors and smooth gradients of the few colors/tones in the image will compress much more than a busier image, say of a forest, or a macro shot of a colorful insect on colorful foliage. File size is not an indicator of whether those images have technical problems.
    – scottbb
    Jun 19, 2020 at 5:20
  • Additionally, this presumes the files are JPEG. This advice doesn't hold for initial culling with a RAW workflow.
    – scottbb
    Jun 19, 2020 at 5:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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