我正在玩scipy源代码,there 。
我正在寻找ndimage.measurements
中的方法分水岭。方法正在调用一个神秘的 _nd_image.watershed_ift(...)
并且模块 measurements.py
会导入 _nd_image
。但是,我在父存储库和其他任何地方找不到 _nd_image
。
我想知道_nd_image
是否引用了src文件夹中watershed_ift
的C实现。但是,nd_image.c
中不存在该算法的 C 实现。
这个_nd_image
模块是什么?我在哪里可以找到这个分水岭算法?
最佳答案
您对它在 C 中的怀疑是正确的; nd_image.c定义 Py_WatershedIFT
(公开为 watershed_ift )。这会调用ni_measure.c中的实际实现NI_WatershedIFT
.
关于python - SciPy 源代码 - 找不到导入的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11871833/