Win7,python 3.6.4,jupyter notebook:
import numpy as np
import skimage.segmentation as segmentation
source = np.array([
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 1, 1, 1, 1, 1, 1, 0],
[0, 0, 0, 0, 0, 0, 0, 0]
])
contour = segmentation.find_boundaries(source, connectivity=1, mode='outer', background=0)
print(contour.astype(int))结果是:
[[0 1 1 1 1 1 1 0]
[1 0 0 0 0 0 0 1]
[0 1 1 1 1 1 1 0]]在我看来,这是正确的结果。
但是我尝试用DevAzure做同样的事情,并且有一个非常简单的项目:
https://dev.azure.com/vovkvv/_git/Test%20boundaries
您可以检查管道,并看到本例中的结果是
[[0 1 1 1 1 1 1 0]
[1 1 0 0 0 0 1 1]
[0 1 1 1 1 1 1 0]]这是
平台linux -- Python 3.6.10,pytest-5.4.1,py-1.8.1,pluggy-0.13.1
我用过
numpy==1.18.1
scipy==1.4.1
scikit-image==0.16.2作为要求。
那么,适用于linux的scikit版本是什么呢?
发布于 2020-04-07 19:31:00
所以,这是一个错误:https://github.com/scikit-image/scikit-image/issues/4558
我使用
contour = segmentation.find_boundaries(source.astype(numpy.uint8), connectivity=1, mode='outer', background=0)省略它。
https://stackoverflow.com/questions/61015295
复制相似问题