http://download.youkuaiyun.com/detail/artemisrj/9442797
EMD算法
Earth Mover’s Distance 是一种衡量两个概览分布在同一个区间D的距离。我觉得翻译成堆土移动距离吧。就是有土堆序列A,和土堆序列B,那么从A序列变成B序列需要的距离称为EMD。或者说,图像A有直方图,图像B也有直方图,那么从图像A的直方图到图像B的直方图的差异,就可以用EMD算法来衡量。
Earth Mover’s Distance Python2 Module
这个模块用的python调用C代码,C代码的原作者是Yossi Rubner’s ,然后用swig来进行C的包装然后进行python的调用。
python本身就是支持C的扩展的,swig的作用更偏向于自动生成代码,方便python使用,不然就比较麻烦。
安装这个模块所需要的:
- Python2 C headers (python-dev
)
- C compiler and linker, as well as Make (build-essential
)
- [SWIG Simple Wrapper and Interface Generator][swig] (swig
)
- EMD 源文件和接口定义 (emd.h
, emd.c
, and
emd.i
in this repository)