If you work on infrared–visible or medical image fusion, you have probably seen this: you re-run a method, compute EN / MI / VIF / Qabf / SSIM, and your numbers don't match the paper. Often the method isn't the problem, the evaluation script is. Most papers use some copy of a MATLAB toolbox or an ad-hoc Python rewrite, and the rewrites quietly differ from the originals:
- fused image in [0,1] but sources in [0,255] → Qabf drops from 0.31 to 0.0003 on the same images
- MATLAB
rgb2gray vs OpenCV gray conversion (big differences on pseudo-colour PET/SPECT)
conv2(...,'same') alignment, imfilter border handling, MATLAB's round-half-away-from-zero, uint8 saturation, edge() thinning
So I wrote fusion-metrics: all 35 metrics from the reference .m collection, ported line by line, each checked against the original in GNU Octave to round-off level (≤1e-12) on synthetic edge cases and on 194 public PET/SPECT–MRI pairs.
pip install fusion-metrics
fusion-metrics --dirs ir/ vi/ fused/ --preset ivif --csv results.csv
The ivif preset gives the table most IVIF papers report (EN, SD, SF, MI, SCD, VIF, Qabf, SSIM). There's also a Python API (fm.evaluate(A, B, F, "ivif")), and a self-test you can run yourself.
- GitHub: https://github.com/VuVietAnh2309/fusion-metrics
- PyPI: https://pypi.org/project/fusion-metrics/
Edit (v1.3): the roadmap is complete. Piella's Q_S, Chen–Blum, Chen–Varshney, Q_P, N^AB/F and the rest are in, so every .m file in the reference collection now has a verified port. There's also a liu2012 preset (the twelve metrics compared in Liu et al., TPAMI 2012), and evaluate() now warns when an image looks normalised to [0, 1] while the others are in [0, 255], which is the Qabf 0.31 → 0.0003 trap above.
I'm the author. Feedback is very welcome, especially if you find a value that doesn't match MATLAB.