image-similarity

Crates.ioimage-similarity
lib.rsimage-similarity
version0.1.5
sourcesrc
created_at2022-10-14 12:17:51.172983
updated_at2022-10-27 18:16:23.739768
descriptionAn image similarity library
homepage
repositoryhttps://github.com/agencyenterprise/image-similarity
max_upload_size
id688169
size3,156,751
Tiago De Gaspari (gasparitiago)

documentation

README

image-similarity at crates.io image-similarity at docs.rs

A Rust library for calculating the similarity between two images.

List of metrics

  • Sum of Absolute Differences (SAD)

  • Mean of Absolute Differences (MAD)

  • Sum of Squared Differences (SSD)

  • Mean of Squared Error (MSE)

  • Normalized Cross Correlation (NCC)

  • Peak Signal to Noise Ratio (PSNR)

  • Structural Similarity (SSIM)

  • Multi-Scale Structural Similarity (MS-SSIM)

  • Gradient Magnitude Similarity (GMSD)

  • ...

Usage

[dependencies]
image = "0.23.4"
let image_a = image::open("image_a.png").unwrap();
let image_b = image::open("image_b.png").unwrap();
let difference = similarity_sad(&image_a, &image_b);

Examples of results

Image A Image B
SAD¹: 0
MAD¹: 0.0
SSD¹: 0
MSE¹: 0.0
SAD¹: 13500834
MAD¹: 51.501595
SSD¹: 1179189332
MSE¹: 4498.2505
SAD¹: 16662881
MAD¹: 63.563847
SSD¹: 1680929909
MSE¹: 6412.239
SAD¹: 19903895
MAD¹: 75.92734
SSD¹: 1681425109
MSE¹: 6414.128
SAD¹: 46021705
MAD¹: 175.55887
SSD¹: 9046268163
MSE¹: 34508.773
SAD¹: 69718295
MAD¹: 265.9542
SSD¹: 20780685733
MSE¹: 79272.02

¹: The smaller the value, the more similar the images are.


Made with 💜 by AE Studio
Commit count: 0

cargo fmt