View Full Version : SSIM value range
Dust Signs
8th April 2007, 20:36
Hi,
I'm currently writing on another term paper and I've difficulties finding out in which range MSSIM values can be. I could not find any useful information in the original paper about SSIM (http://www.dii.unisi.it/~menegaz/papers/simoncelli.pdf), but various tests with Matlab and the MSU Quality Measurement tool showed that it is between 0 and 1. Anyhow, this paper (ftp://ftp.cs.wpi.edu/pub/techreports/pdf/06-02.pdf) states that the value range is between -1 and 1. Is the latter incorrect? Does anyone know where to find a definition of this range which I can quote for my paper?
Thanks in advance,
Regards,
Dust Signs
unmei
8th April 2007, 23:20
The first link seems unavaiable.
From the second, SSIM is defined as quotient. Without reading much , i assume both the numerator and denominator are over the same range of values since they both basicly depend on the input variables x and y (original and distorted signal). My take is, the SSIM range is -1..1 if x and y are defined over a range symmetrical to 0 (that is -Z..+Z) like often used in digital audio and 0..1 if they are defined on a positive-only range like they typical 8-bit color component values (0..255).
Dust Signs
8th April 2007, 23:25
What speaks for a range between 0 and 1 is the fact that the Matlab function provided by the author returns about 0 when comparing two 100x100 8-bit uint random arrays.
Dust Signs
unmei
8th April 2007, 23:41
Well, yes i don't think you can get a negative SSIM with *unsigned* integers =) For it to be negative, i assume the "xy bar" of the numerator has to be negative since i think variance/covariance are never negative and the squares in the denominator certainly aren't. But beware, i never liked statistics.
[edit]
On top of that i would think random signed arrays would also result in a zero result, for a -1 result the "distorted" signal probably needs to be a perfect negative of the original.
Dust Signs
9th April 2007, 08:59
On top of that i would think random signed arrays would also result in a zero result, for a -1 result the "distorted" signal probably needs to be a perfect negative of the original.
Even an exact negative leads to a result of nearly 0.
Today in the morning, I received an email of the author stating
The range is (-1, 1].
Referring to my results with Matlab I'm even more confused now :/
Dust Signs
tritical
9th April 2007, 12:09
Going strictly by the equations in the first paper, I would think the range is -1 to 1. Specifically, if you take equation 10 and use C3=0, then it is just computing the correlation, which can be anything from -1 to 1. The question then is is it possible for equation 10 to equal -1 while equations 6 (luminance function) and 9 (contrast function) equal 1.
Equation 6 is (assuming C1 =0):
2*mean_x*mean_y/(mean_x*mean_x + mean_y*mean_y)
Equation 9 is (assuming C2 = 0):
2*std_x*std_y/(std_x*std_x + std_y*std_y)
So the answer would be yes. Of course, this breaks down if the constants aren't zero. Also, it would be almost impossible to get a value of -1 for a single window (every pixel would need to be flipped about the window's mean), let alone when using overlapping windows whose results are averaged to form the final value for the full frame. They also mention using a gaussian window function when computing the statistics for each window.
Dust Signs
9th April 2007, 15:11
Thanks for your answer. I played around a bit with Matlab using the following code:
A(:, :) = round(255 * rand(100, 100));
B(:, :) = round(255 * rand(100, 100));
[mssim, ssimmap] = ssim(A, B);
The lowest MSSIM I got after executing this code about 20 times was around -0.01. What would you say? Can I state in my paper that practically, values are between 0 and 1. I mean what I got here were two random signals.
Dust Signs
Manao
9th April 2007, 15:35
No you can't. You create two random signals. They are uncorrelated --> covariance is null.
Try x = random(0..255) and y = 255-x.The SSIM should be -1 if I'm not mistaken.
Dust Signs
9th April 2007, 15:46
Yes, you're right. I just tested it :). Thank you very much for your help.
Dust Signs
PS.: Just in the case someone is interested, here the Matlab code:
A(:,:) = round(255*rand(100,100));
B(:,:) = abs(255 - A(:,:));
[mssim, ssimmap] = ssim(A, B);
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.