从skimage.filter导入threshold_yen和threshold_isodata

问题描述 投票:0回答:1

我正在使用与SKimage不同的阈值算法,当我导入某些程序包时出现错误,但其他程序没有问题。例如:

from skimage.filter import threshold_adaptive, threshold_isodata返回回溯:ImportError: cannot import name threshold_isodata。我正在使用python 2.7,并遵循此处找到的文档:http://scikit-image.org/docs/dev/api/skimage.filter.html#skimage.filter.threshold_isodata

具体来说,我希望使用threshold_isodata和threshold_yen。有人对如何解决此错误有建议吗?另外,还有其他使用相同算法的软件包吗?

python import threshold scikit-image
1个回答
1
投票

如评论中所述,threshold_isodata仅在主存储库中可用(即未在v0.9中正式发布),因此导入错误。

事实证明threshold_yen未正确导入版本0.9中的filter子包中。 (这已在master中修复。)在发布v0.10之前,应按以下方式导入threshold_yen

from skimage.filter.thresholding import threshold_yen

EDIT:请注意,此问题和答案特定于scikit-image的非常旧的版本skimage.filter模块在skimage.filters]中重命名为v0.11

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.