Skip to main content

Image similarity metrics.

Project description

compimg

PyPI PyPI - Python Version PyPI - Wheel License Documentation Status

Branches:
master: CircleCI
develop: CircleCI

Introduction

For full documentation visit documentation site.

Image similarity metrics are often used in image quality assessment for performance evaluation of image restoration and reconstruction algorithms. They require two images:

  • test image (image of interest)
  • reference image (image we compare against)

Such metrics produce numerical values.

Such methods are are widely called full/reduced-reference methods for assessing image quality.

compimg package is all about calculating similarity between images. It provides image similarity metrics (PSNR, SSIM etc.) that are widely used to asses image quality.

import numpy as np
from compimg.similarity import SSIM
some_grayscale_image = np.ones((20,20), dtype=np.uint8)
identical_image = np.ones((20,20), dtype=np.uint8)
result = SSIM().compare(some_grayscale_image, identical_image)
assert result == 1.0

Features

  • common metrics for calculating similarity of one image to another
  • images are treated as numpy arrays which makes compimg compatible with most image processing packages
  • only scipy (and inherently numpy) as a dependency

Installation

compimg is available on PyPI. You can install it using pip:
pip install compimg

Note

Keep in mind that metrics are not aware of what kind of image you are passing. If metric relies on intensity values and you have YCbCr image you should pass only the first channel to the computing routine.

Help

If you have any problems or questions please post an issue.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for compimg, version 0.2.1
Filename, size File type Python version Upload date Hashes
Filename, size compimg-0.2.1-py3-none-any.whl (14.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size compimg-0.2.1.tar.gz (7.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page