Commit 4ec3ba24 authored by Laurent Belcour's avatar Laurent Belcour
Browse files

Correction of a bug in ceres fitter. The evaluation points have to be...

Correction of a bug in ceres fitter. The evaluation points have to be converted into the BRDF domain
parent dc730999
......@@ -149,7 +149,16 @@ bool nonlinear_fitter_ceres::fit_data(const data* d, function* fit, const argume
for(int i=0; i<d->size(); ++i)
{
vec xi = d->get(i);
problem.AddResidualBlock(new CeresFunctor(nf, xi, cos_fit), NULL, &p[0]);
vec xf(nf->dimX() + nf->dimY());
// Convert the sample to be in the parametrizatio of the function
params::convert(&xi[0], d->input_parametrization(), nf->input_parametrization(), &xf[0]);
for(int k=0; k<nf->dimY(); ++k)
{
xf[nf->dimX() + k] = xi[d->dimX() + k];
}
problem.AddResidualBlock(new CeresFunctor(nf, xf, cos_fit), NULL, &p[0]);
}
// Solves the NL problem
......
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