def getBoundaryPoints(x , y):
tck,u = interpolate.splprep([x, y], s=0, per=1)
unew = np.linspace(u.min(), u.max(), 10000)
xnew,ynew = interpolate.splev(unew, tck, der=0)
tup = c_[xnew.astype(int),ynew.astype(int)].tolist()
coord = list(set(tuple(map(tuple, tup))))
coord = np.array([list(elem) for elem in coord])
return coord[:,0],coord[:,1]
评论列表
文章目录