Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

classifying images by complexity

4 views
Skip to first unread message

samwyse

unread,
Jun 27, 2009, 11:38:36 PM6/27/09
to
I've got a massive collection of images that I'd like to use as
wallpaper on my desktop. However, I'd like to filter out "busy"
images; I prefer sand dunes to city skylines, for instance. Does
anyone have any suggestions? I'm already generating histograms to
find relatively monochromatic images, but that doesn't tell me if the
image has lots of fine detail or is just a gradient. Taking FFTs
seems like a bit of work, but I'd be willing to do it if the results
are worthwhile. Any ideas? Thanks!

rych

unread,
Jun 28, 2009, 8:47:53 AM6/28/09
to
Before any proper measures are posted... how about the standard
deviation!?

Christian

unread,
Jun 28, 2009, 12:25:23 PM6/28/09
to
On Jun 28, 8:47 am, rych <rych...@gmail.com> wrote:
> Before any proper measures are posted... how about the standard
> deviation!?

The decay of the coefficients in a wavelet transform will be a measure
for visual complexity.

samwyse

unread,
Jul 1, 2009, 9:01:40 AM7/1/09
to

Thanks! Those both sound like good ideas. Of course, I need to
figure out how to take a standard deviation of a histogram, but I see
what you're getting at and will try to adapt the idea. Unlike FFTs,
I've never worked with wavelets, but I look forward to figuring that
out as well. Unfortunately, as soon as I posted things got busy at
work, but I'll see what I can do over the three-day weekend. Thanks
again!

Kaba

unread,
Jul 1, 2009, 11:23:24 AM7/1/09
to
rych wrote:
> Before any proper measures are posted... how about the standard
> deviation!?

Divide an image into two equal areas, the other one black and the other
one white. Then standard deviation is maximal and the image is still
quite simple.

--
http://kaba.hilvi.org

mike

unread,
Jul 1, 2009, 7:27:44 PM7/1/09
to
In article <MPG.24b5abeb4...@news.cc.tut.fi>, no...@here.com
says...
Complexity is a complicated term itself - so the answer will depend on
what you mean by complexity. For example, is a field of 'noise' complex
because it requires a lot of information to describe it accurately - or
is it simple because it is homogeneous over the whole field.

One possibility would be the following algorithm:

1) Apply a blur filter (Gaussian or whatever) to smooth out small-scale
'complexity' (i.e. noise).

2) Apply an edge-detection filter to emphasise regions of rapid change
in colour/intensity etc.

3) Average the output of stage 2). A low average would suggest not many
edges were found - so the image is of low complexity. A high average
would suggest many edges so high complexity.

An alternate route might be to compress the image using jpeg or similar
then to an image subtraction of the original with the compressed
version. If the difference is small then presumably the image was simple
(in some sense), if the difference is large then the image was complex.

Mike

Martin Brown

unread,
Jul 2, 2009, 5:26:38 AM7/2/09
to

One that you could use and gives an idea of the evenness of the
frequency distribution of values is the byte wise entropy. That is count
the number of times f[n] each byte value n occurs and then define

p[n] = f[n]/sum{f[i],i=0,N}

And

S = sum{ -p[i] ln( p[i] ), i= 0,N }

A uniform single colour image comes out at 0.
The image with equal areas in two distinct colours comes out at ln(2)

And for 8 bit pixels an image containing equal numbers of every possible
pixel will max out at

S = ln(256) = 5.5452

Zip files and JPEGs tend to be close to this limit for byte wise entropy.

Note this measure doesn't tell you anything about local ordering. The
image could be a random values with that frequency distribution or
highly ordered stripes of each colour in sequence.

It is one of the metrics favoured for Maximum Entropy image reconstruction.

Another quick and dirt metric is the sum of the absolute value of the
crude second derivative at each point. Away from the borders:

s = | y[i-1,j] + y[i+1,j] + y[i,j-1] + y[i,j+1] - 4y[i,j] |

Summed over the image with edges handled specially.

Regards,
Martin Brown

Johann Blaser

unread,
Jul 2, 2009, 11:18:07 AM7/2/09
to
The decay of the singular values is a measure of image-variability.
It can be easily coded with matlab. It's just:

S = svd(I);

One just needs to look at the 1D-vector of singular values S.
If they decay very slow, the image has "much randomness" in it.
Just set an threshold to classify.
A drawback is its high computation time.

regards,
jb

david_f_knight

unread,
Jul 2, 2009, 6:57:45 PM7/2/09
to
Here's what ought to be a really quick & simple idea: use the file
compression of jpg images as a proxy for the inverse of the complexity/
busy-ness of the image: just divide each jpg files' size by the number
of pixels in that image. The smaller the ratio, the simpler (i.e.,
more compressed) the image.

If you have some non-jpg image files, convert them to jpg first. Let
other software you already have do the hard work for you!

-- david_f_knight

0 new messages