How to fit a bounding ellipse around a set of 2D points

前端 未结 1 1139
庸人自扰
庸人自扰 2021-01-12 15:10

Given a set of 2d points (in Cartesian form), I need to find the minimum-area ellipse such that every point in the set lies either on or inside the ellipse.

I have f

相关标签:
1条回答
  • 2021-01-12 15:52

    With Eigen, you can get the diagonal vector from a matrix with .diagonal(); you can treat a vector as a diagonal matrix with .asDiagonal(); but you cannot treat a dense matrix as a diagonal matrix. So that line should be

    MatrixXd M = (Q_tr * X.inverse() * q).diagonal(); 
    
    0 讨论(0)
提交回复
热议问题