Skip to content

Commit

Permalink
fixed ellipse fitting method.
Browse files Browse the repository at this point in the history
  • Loading branch information
ponchio committed Aug 31, 2023
1 parent 002b21c commit 6c7b7c6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions relight/sphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ void Sphere::ellipseFit() {
Eigen::MatrixXd D1(n, 3);
Eigen::MatrixXd D2(n, 3);
for(size_t k = 0; k < border.size(); k++) {
double x = X(k)= border[k].x();
double y = Y(k)= border[k].y();
double x = border[k].x();
double y = border[k].y();
D1(k, 0) = x*x;
D1(k, 1) = x*y;
D1(k, 2) = y*y;
Expand Down Expand Up @@ -96,9 +96,9 @@ void Sphere::ellipseFit() {
Eigen::VectorXd cond = 4 * row0.array() * row2.array() - row1.array().pow(2);


Eigen::VectorXd ellipse = eigenvector.col(0)

for(int i= 0; i<3 ; i++){
Eigen::VectorXd ellipse = eigenvector.col(0);
Eigen::VectorXd min_pos_eig;
for(int i = 0; i<3 ; i++){
if(cond(i) > 0){
min_pos_eig = eigenvector.col(i);
break;
Expand Down

0 comments on commit 6c7b7c6

Please sign in to comment.