The decay of the coefficients in a wavelet transform will be a measure
for visual complexity.
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!
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.
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
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
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
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