image-compare

Simple image comparison in rust based on the image crate
Note that this crate is heavily work in progress. Algorithms are neither cross-checked not particularly fast yet.
Everything is implemented in plain CPU with no SIMD or GPU usage.
Supported now:
- Comparing grayscale and rgb images by structure
- By RMS - score is calculated by:
- By MSSIM
- SSIM is implemented as described on wikipedia:
- MSSIM is calculated by using 8x8 pixel windows for SSIM and averaging over the results
- RGB type images are split to R,G and B channels and processed separately. The worst of the color results is propagated as score but a float-typed RGB image provides access to all values.
- Comparing grayscale images by histogram
- Several distance metrics implemented see OpenCV docs:
- Correlation
 = \frac{\sum_I (H_1(I) - \bar{H_1}) (H_2(I) - \bar{H_2})}{\sqrt{\sum_I(H_1(I) - \bar{H_1})^2 \sum_I(H_2(I) - \bar{H_2})^2}})
- Chi-Square
 = \sum _I \frac{\left(H_1(I)-H_2(I)\right)^2}{H_1(I)})
- Intersection
 = \sum _I \min (H_1(I), H_2(I)))
- Hellinger distance
 = \sqrt{1 - \frac{1}{\sqrt{\int{H_1} \int{H_2}}} \sum_I \sqrt{H_1(I) \cdot H_2(I)}})
Planned:
- Histogram comparison for RGB images
- SIMD for RMS and MSSIM