https://agniva.me/scipy/2016/10/25/contour-smoothing.html
在将mask转contour的时候,发现不是很光滑。然后就找了相关资料
N = contour.shape[0]
if N<5: continue
tol = 0.5
s = N * tol ** 4
tck, u = splprep([contour[:, 0], contour[:, 1]], s=s, per=True)
if N>1000: N=1000
u_new = np.linspace(u.min(), u.max(), int(N*1.2))
x_new, y_new = splev(u_new, tck)
per还是应该为True,虽然不是很了解,但是per=False会出现一些不光滑的Corner