Crates.io | image-similarity |
lib.rs | image-similarity |
version | 0.1.5 |
source | src |
created_at | 2022-10-14 12:17:51.172983 |
updated_at | 2022-10-27 18:16:23.739768 |
description | An image similarity library |
homepage | |
repository | https://github.com/agencyenterprise/image-similarity |
max_upload_size | |
id | 688169 |
size | 3,156,751 |
A Rust library for calculating the similarity between two images.
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)
...
[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);
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.