【发布时间】:2012-10-07 16:50:03
【问题描述】:
当我测试scikit-image 方法时,我遇到了skimage.measure.perimeter(image),但无法解释这个函数的输出。
import numpy as np
image=np.zeros((100,100))
image[10:30,10:30]=1 # this creates a white square
from skimage.measure import perimeter
x=perimeter(image)
print x #Should be (20+20+20+20) = 80
76.0 <<<<<<<<<< it returns this value
我是不是误解了这个函数应该返回什么?我知道 周长 是围绕一个区域的路径。
注意:-
(1) 计算出的周长和返回的周长之间的差异并不总是 4。因为有时它可以是 6,无论它是正方形、矩形还是任何其他多边形。
更新:=
(1)The function page
【问题讨论】:
标签: python image-processing scikits scikit-image