foundation.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:Virtual-Makeup 作者: badarsh2 项目源码 文件源码
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]
    return a
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号