How do I detect a "boring" photo?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
kbro
Posts: 6
Joined: 2011-05-31T13:01:17-07:00
Authentication code: 8675308

How do I detect a "boring" photo?

Post by kbro »

I want to separate "boring" photos from "interesting" ones in a folder. By "boring" I mean pictures of the sky, the ground, a wall, the inside of the lens cap and so on. I tried using

Code: Select all

identify -format "%f %k\n" *.jpg
to get the number of unique colours in each image, but a number of supposedly boring images (particularly pictures of the grass) turned out to be quite interesting! The thing I've hit on now is

Code: Select all

identify -format "%f %[fx:standard_deviation]\n" *.jpg
Boring pictures are almost always below 0.16.

So is this a good way, or can anyone suggest something better?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How do I detect a "boring" photo?

Post by anthony »

I would say doing a edge detection, and then seeing how many edges it has.

Colors would not help for a boring picture of a gradient of colors.

However edge detection may match a cartoon where color counts or spread would not!

NOTE: edge deterion will fail for images of bricks or tiles, or say sand. But perhaps these are not classed as boring.

Regular features and effects can be discovered by looking at a images fourier transform. The more complex its foruier transform, the less 'boring' an image is!

Perhaps it is not just edges, but edge distribution that may constitute how 'boring' the image is. A image of a brick wall on the left and a seascape on the right may not be classed as boring.


Another possibility is to look for some object. Say run it through a face detector (free software)
http://face.com/
If the image has a face (or something face like) perhaps it can be classed as not-boring.


It all comes down to -- What do you class as boring?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How do I detect a "boring" photo?

Post by fmw42 »

The term "boring" can mean almost anything to just about everybody -- not the same for each person or each picture. It depends upon what is interesting to the person that may be in the picture.

However, from the point of view of detail or information, then the standard deviation is pretty good. Another measure is information entropy (as a measure of disorder). So you might want to test your images against my bash unix shell script called entropy. See link below.
kbro
Posts: 6
Joined: 2011-05-31T13:01:17-07:00
Authentication code: 8675308

Re: How do I detect a "boring" photo?

Post by kbro »

Hmmmm... looks like my use of "boring" wasn't as helpful as I'd intended. Here's what I'm really trying to do...

A photographer at an event such as motorcar rallying, BMX, horse cross-country, showjumping etc takes groups of pictures of each competitor as they pass (these are "interesting") and then a picture of the sky or ground to mark the end of the group (these are "boring").

At the end of the day the photographer wants to split the pictures up into the individual groups to display them on a website so that there's one directory per competitor. This makes it easier for competitors to find pictures of themselves, so they're more likely to buy!

So the question is - how do I detect pictures of the sky or the ground in amongst pictures of someone in a Mini Cooper getting it seriously sideways around a bend on a forest track?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How do I detect a "boring" photo?

Post by fmw42 »

perhaps better to take a picture with the lens cap on so that the mean and standard deviation are both zero (or near zero).
Post Reply