Ssim
Program to measure the similarity between two videos using the OpenCV library and the structural similarity algorithm (SSIM). This is modified from the video-input-psnr-ssim tutorial of OpenCV.
Install / Use
/learn @yeokm1/SsimREADME
ssim
Program to measure the similarity between two videos using the OpenCV library and the structural similarity algorithm (SSIM). This is modified from the video-input-psnr-ssim tutorial of OpenCV. This program has been tested to work on the Windows platform only. For the CUDA-optimised version of this program, check out my other project.
##Differences from video-input-psnr-ssim tutorial
- Calculate SSIM for each and every frame.
- Show overall progress every 50 frames.
- Start comparison at different points of both videos.
- Optional number of frames to compare. Compares up to the shortest video by default.
##Usage
#ssim reference_video_file test_video_file reference_start_frame test_start_frame [numFramesToCompare]
ssim reference.avi test.avi 0 1
ssim reference.avi test.avi 5 13 1000
##Screenshots
Preview windows are shown to indicate progress.
A percentage result is given at the end.
##Compiling this program
cmake -G "MinGW Makefiles" #First time only
mingw32-make
##Dependencies I used
- OpenCV (2.4.9)
- Cmake (3.0.1)
- Mingw, GCC 4.8.1
###Installing Dependencies
-
Download and install Mingw. Check the options, "mingw32-base" and "mingw32-gcc-g++". Add "C:\MinGW\bin" to your PATH.
-
Download and install Cmake for Windows. Choose to add to system path during installation.
-
Download OpenCV 2.4.9 here from the github releases. Do not use the official Windows binary unless you wish to use Visual Studio to compile your project. Unzip the zip file to
C:\opencv. -
Open CMake GUI. Set source to
C:\opencvand where-to-build toC:\opencv\build\x86\mingw. Click "Configure", select "MingGW Makefiles" and "Default native compilers" then "Generate" -
Compile OpenCV using Mingw based on the commands below then add
C:\opencv\build\x86\mingw\binto your PATH.
cd C:\opencv\build\x86\mingw
#Change N in -j to the number of CPU cores you have for parallel compilation. For eg, -j4.
mingw32-make -jN
mingw32-make install
#Do not run "mingw32-make clean"
##References
