Skip to main content

Copula-based Similarity Metric (CSM)

A novel locally sensitive image similarity metric based on Gaussian Copula.

📖 Overview

Copula-based Similarity Metric (CSM) is a unique approach for measuring image similarity that leverages the properties of Gaussian copulas to provide a locally sensitive measure of similarity between images. Unlike traditional metrics, CSM is designed to capture both global and local image features, making it particularly effective for applications in medical imaging, remote sensing, and any domain requiring fine-grained image comparison.

🌟 Features

  • Locally Sensitive: Captures detailed differences at a granular level.
  • Gaussian Copula-Based: Utilizes statistical properties for robust similarity measurement.
  • Versatile Usage: Suitable for various image types and applications.
  • Extensible: Easily integrates with other image quality metrics like SSIM, FSIM, and ISSM.

🚀 Getting Started

Installation

To install the CopulaSimilarity package, you can use pip:

pip install CopulaSimilarity

Usage

you can import the package and estimate the similarity map as follow:

from CopulaSimilarity.CSM import CopulaBasedSimilarity as CSMSimilarity

copula_similarity = CSMSimilarity()

#load your images
image1 = cv2.imread('path_to_image1')
image2 = cv2.imread('path_to_image2')

#calculate the similarity map
csm_value = copula_similarity.compute_local_similarity(image, blurred_image)

# Optionally: you can show the similarity map using cv2 or matplotlib

#if you need a metric you can calculat the mean of the copula similarity map
csm_mean = np.mean(csm_value)

Other metrics can also be used, the implementation is based on (image-similarity-measures)[https://github.com/nekhtiari/image-similarity-measures/tree/master] package. you can either install it using pip install image-similarity-measures command, or you can also use our implementation. To use other metrics such as SSIM FSIM and ISSM, it's very similar however they only return a value. Tutorial:

from similarity_metrics.fsim_quality import FSIMsimilarity
from similarity_metrics.issm_quality import ISSMsimilarity

fsim_similarity = FSIMsimilarity()
issm_similarity = ISSMsimilarity()

#load your images
image1 = cv2.imread('path_to_image1')
image2 = cv2.imread('path_to_image2')

ssim_value = fsim_similarity.fsim(image1, image2)
issm_value = issm_similarity.issm(image1, image2)

📚 Example Use Case

The example below shows a comparative study on MRI imagery, where the first frame is fixed, and similarity metrics (SSIM, FSIM, ISSM, and CSM) are calculated between that frame and subsequent ones. This highlights the differences captured by each metric, demonstrating the unique sensitivity and accuracy of CSM in various scenarios.

csm_vs_other_metrics

Licence

The work can be used for research purposes.

Metadata

Release files for CopulaSimilarity 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for CopulaSimilarity 0.1.1
File Size Uploaded
copulasimilarity-0.1.1.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for CopulaSimilarity 0.1.1
File Interpreter ABI Platform
CopulaSimilarity-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 15.1 kB

Release files / copulasimilarity-0.1.1.tar.gz

Download URL copulasimilarity-0.1.1.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f445b94a59db226492df8fee2bc7b129e757d99ab01f584db4b8fd63c3e066bc
BLAKE2b-256 checksum
How to use checksums
542169b39ef7c58d4a2aabafcd10c76773e75449251dc4f52b6415298884bc21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.14

Release files / CopulaSimilarity-0.1.1-py3-none-any.whl

Download URL CopulaSimilarity-0.1.1-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e07910c179b8bf26e1784d2d0baf893a6d3cae770c81598d657a30656ce0b6f
BLAKE2b-256 checksum
How to use checksums
948139853f0210134cb90a8e7788ed8718b5e734a29eb7aa7c9c3024a6df0f9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.14

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page