Skip to content
/ SSIM-py Public

Structural Similarity (SSIM) index, where the only core dependency is NumPy

License

Notifications You must be signed in to change notification settings

w13b3/SSIM-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSIM-py

Structural Similarity (SSIM) index, where the core dependency is NumPy

To actually compare images with SSIM-py Pillow or opencv-python is needed

Preparation

Setting up your environment
  1. Download the SSIM-py.zip
  2. Setup and activate a virtual environment (optional)
  3. Extract the requirements.txt from the downloaded SSIM-py.zip
  4. Open a command-line interface
  5. Enter the following command on the command-line pip install -r requirements.txt

Result: Pillow, opencv-python and numpy modules are installed in the environment.

Image comparison preparation

Have two similar images ready to compare.

For the best result:

The module: opencv-python is preferred.

Make sure both images are the same size and have the same amount of color channels


Usage

  1. Open a command-line interface
  2. Read the help text by entering the following command python SSIM-py.zip --help (optional)
  3. Enter the following command python SSIM-py.zip path/to/image1 path/to/image2

Result: Number between 1 and 0 shows up on the command-line.

What to do by failure

Run the command again but now with the --verbose argument.

Copy the log into an textfile.

Usefull command to do this with is: python SSIM-py.zip --verbose path/to/image1 path/to/image2 > SSIM-py.log

Create an issue with the SSIM-py.log and the images used.


Test information

Created and tested on Ubuntu 18.04.3 LTS

With python 3.6.8 (default, Oct 7 2019, 12:59:55) [GCC 8.3.0]

Pillow: 6.2.0

numpy: 1.17.3

opencv_python: 4.1.1.26

Tested with the following image formats: .tif .png .ppm .pgm .jpg .bmp

CAUTION: Comparing the same images with different file formats with Pillow won't give expected results.


References

Thanks mom, Thanks dad.

1 2 3 4 5 6 7 8 9 10

About

Structural Similarity (SSIM) index, where the only core dependency is NumPy

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published