C++ version of SSIM is available at https://github.com/utlive/ConsoleSSIM.git . Notice that to build this code by Visual Studio you need to install MFC.
The code was developed by Laboratory for Image and Video Engineering at the University of Texas at Austin (a trustful source)
The exe-file (conSSIM.exe) accepts only jpg-files are input (an annoying restriction).
In the Python module ‘skimage.metrics‘ there is a function ‘structural_similarity‘ which computes SSIM (sliding window size is configurable as well as other parameters).
I wrote a script GetSSIM.py which reads reference and distorted yuv sequences frame after frame, converts each frame to gray and computes the SSIM score (with default parameters) per frame. Finally the average SSIM score over all frames and 5% percentile are printed.
Usage of GetSSIM.py:
–ref reference input yuv-file (yuv420p)
–dist distorted input yuv-file (yuv420p)
–width width
–height height
-n number of frames to process, if 0 the whole sequence (default 0)
-v print SSIM of each frame, (default false)
Example [ compute SSIM scores for the first 10 frames]:
python GetSSIM.py --ref test_1920x1080.yuv --dist test_15M.yuv --width 1920 --height 1080 -v -n 10
frame 0, SSIM 0.847
frame 1, SSIM 0.890
frame 2, SSIM 0.906
frame 3, SSIM 0.924
frame 4, SSIM 0.916
frame 5, SSIM 0.911
frame 6, SSIM 0.909
frame 7, SSIM 0.908
frame 8, SSIM 0.907
frame 9, SSIM 0.906
Number of frames: 10
average SSIM : 0.902
std SSIM: 0.020
5-percentile SSIM: 0.867
Let’s suppose we have output h264 stream and the reference yuv or y4m stream and we wish to compare frame number 100 from both streams.
With ffmpeg we can take the frame number 100 from both streams and convert them to jpg:
ffmpeg -i test.h264 -vf select=’eq(n\,100)’ -vsync 0 enc_frame.jpg
ffmpeg -s 1920×1080 -i test1080p.yuv –vf select=’eq(n\,100)’ -vsync 0 ref_frame.jpg
Then we apply conSSIM.exe as follows:
conSSIM.exe -bv -r ref_frame.jpg -t enc_frame.jpg
… 0.854043
The SSIM score is 0.854043
Notes:
Multi-scale SSIM (MS-SSIM) is an extension of the SSIM method. MS-SSIM is tailored for both still images and video.
According to technical literature MS-SSIM was found to make better correlation to MOS than SSIM.
- “A Statistical Evaluation of Recent Full Reference Image Quality Assessment Algorithms”, H.R. Sheik et al., 2006
- “MULTI-SCALE STRUCTURAL SIMILARITY FOR IMAGE QUALITY ASSESSMENT”, Zhou Wang et al., 2003.
Matlab version of MS-SSIM is available at https://github.com/utlive/ms_ssim.git
According to the Table II of the paper “On the Use of SSIM in HEVC”, Tiesong Zhao et al., 2013, the video quality metric MS-SSIM provides a small improvement relative to SSIM in correlation with subjective quality.
According to the paper MS-SSIM requires 2x cycles than SSIM.
Here
PLCC – Pearson Linear Correlation Coefficient
SRCC – Spearman Rank-order Correlation Coefficient
KRCC – Kendall Rank-order Correlation Coefficient
23+ years’ programming and theoretical experience in the computer science fields such as video compression, media streaming and artificial intelligence (co-author of several papers and patents).
the author is looking for new job, my resume
I reckon something truly special in this site.
Very efficiently written information. It will be supportive to anyone who utilizes it, including yours truly :). Keep up the good work – i will definitely read more posts.
Wow! This can be one particular of the most beneficial blogs We’ve ever arrive across on this subject. Actually Fantastic. I am also a specialist in this topic so I can understand your hard work.
Its like you read my mind! You seem to know so much about this, like you wrote the book in it or something. I think that you can do with a few pics to drive the message home a little bit, but instead of that, this is excellent blog. A great read. I will certainly be back.
Thanks for another informative website. Where else could I am getting that kind of information written in such an ideal way? I have a project that I am just now running on, and I have been on the glance out for such information.
i am not familiar with other free sources. You can purchase Elecard VQ Analyzer to get MS-SSIM and SSIM and other metrics.
There is evidently a bunch to identify about this. I believe you made some nice points in features also.
Nice post. I was checking continuously this weblog and I’m impressed! Extremely useful information specifically the ultimate part 🙂 I handle such info much. I was looking for this particular info for a long time. Thank you and good luck.
The next time I read a blog, I hope that it doesnt disappoint me as much as this one. I mean, I know it was my choice to read, but I actually thought youd have something interesting to say. All I hear is a bunch of whining about something that you could fix if you werent too busy looking for attention.
I got good info from your blog