Commit 5fd5e298 authored by Richard Torenvliet's avatar Richard Torenvliet

Manual merge - bugfix

parent 5bacf5c2
...@@ -177,7 +177,10 @@ inline std::vector<float> fit_blendshapes_to_landmarks_nnls(const std::vector<eo ...@@ -177,7 +177,10 @@ inline std::vector<float> fit_blendshapes_to_landmarks_nnls(const std::vector<eo
const MatrixXf b = P * v_bar - y; // camera matrix times the mean, minus the landmarks const MatrixXf b = P * v_bar - y; // camera matrix times the mean, minus the landmarks
// Solve using NNLS: // Solve using NNLS:
VectorXf coefficients; VectorXf coefficients;
bool non_singular = Eigen::NNLS<MatrixXf>::solve(A, -b, coefficients);
Eigen::NNLS<MatrixXf> nnls(A, 100); //it normaly converges within <10 iterations
bool non_singular = nnls.solve(-b);
coefficients.noalias() = nnls.x();
return std::vector<float>(coefficients.data(), coefficients.data() + coefficients.size()); return std::vector<float>(coefficients.data(), coefficients.data() + coefficients.size());
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment