Skip to main content

Image similarity metrics.

Project description

compimg

PyPI PyPI - Python Version PyPI - Wheel License Documentation Status PyPI - Downloads

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 and 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 # SSIM returns 1.0 when images are identical

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 probably pass only the first channel to the computing subroutine.

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.

Source Distribution

compimg-0.2.2.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

compimg-0.2.2-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file compimg-0.2.2.tar.gz.

File metadata

  • Download URL: compimg-0.2.2.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for compimg-0.2.2.tar.gz
Algorithm Hash digest
SHA256 c509d42f5d822edabe010ceee9220301494d5133e56118e1823cc70d2a1cd906
MD5 d0f17f8e8669afeb546fc1942f4dc854
BLAKE2b-256 f47c6ba9b914f6d52dc1b9800ec0b72b7c860d7688e5e04fdd067ab41bca7fab

See more details on using hashes here.

File details

Details for the file compimg-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: compimg-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for compimg-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ab1c7be397321ccc8a0f655164a5e807a7ae35e8a87ae13bbc5b9cc73cb9c313
MD5 8a89bb24b7268f5955987d2cf486b984
BLAKE2b-256 6b4e94b59f83d899445366c68db9dbfedb5246a06c9e01e96c8a3a30e38c6d72

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page