def fitEllipse (x, y):
x = x [:, np.newaxis]
y = y [:, np.newaxis]
D = np.hstack(( x*x , x*y , y*y , x, y, np.ones_like(x)))
S = np.dot (D.T ,D)
C = np.zeros ([6 , 6])
C[0, 2] = C[2, 0] = 2
C[1, 1] = -1
E ,V = eig( np.dot(inv(S),C ))
n = np.argmax(np.abs(E))
a = V[:, n]
if a[0] < 0 : a = -a
return a
CoordTf.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录