Is there any more mid level documentation about using ceres

9 views
Skip to first unread message

Larry Colen

unread,
Dec 5, 2025, 4:54:33 PM (yesterday) Dec 5
to Ceres Solver
I'm trying to use Ceres to set up curve fitting on a system with multiple parameters. 

Before I work on the actual problem, I'm trying to learn Ceres by setting up a fit on a simple quadratic function with three parameters. 

The challenge that I'm facing is that the documentation is either very simple cookbook, here are some example programs, with few comments in them. Or documentation that goes pretty deep in the weeds about the math. 

I can't seem to find a lot about things like what the parameters for the cost functor need to be.  I have determined that there have to be a certain number of arguments, that they are passed in as pointers to doubles, aka a simple C array.

I can't find explanations for things like what the values in
ceres::AutoDiffCostFunction<QuadraticResidual, 1, 1, 1>
mean. 

At this point I'm just guessing things like
problem.AddResidualBlock() is used for adding another element of cost based
on parameters to a sum which Ceres tries to minimize.  I haven't seen that explicitly 
mentioned anyplace.  

If there is any documentation on things like this, other than wading through all of
the source code, I'd greatly appreciate a pointer to it.

And yes, I have looked through:
 http://ceres-solver.org/nnls_solving.html

But if there is a midlevel overview of Ceres itself, I haven't found it.

Thanks

Sameer Agarwal

unread,
Dec 5, 2025, 4:57:29 PM (yesterday) Dec 5
to ceres-...@googlegroups.com
Sorry we don't have a lot more.
Happy to answer specific questions.

--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ceres-solver/ec4741a8-420a-4a12-872a-c61e5d1eb7fan%40googlegroups.com.

Larry Colen

unread,
Dec 5, 2025, 5:24:11 PM (yesterday) Dec 5
to Ceres Solver
I'm trying to understand Ceres in general well enough to ask questions more specific than "why does my code just return my starting guess after 11 iterations?"

My test code started with the robust_curve_fit program, tried to modify it for more variables.  I can tell, right off hand that this line is wrong:
 problem.AddResidualBlock(cost_function, new ceres::CauchyLoss(0.5), &m, &c);

But it's not obvious how to change it to work with:
        ceres::CostFunction* cost_function =        
            new ceres::AutoDiffCostFunction<QuadraticResidual, 1, 1, 1>(
                new QuadraticResidual(data_v[2 * idx], data_v[2 * idx + 1], poly[0], poly[1], poly[2]));
trimmed_quad_fit.cc
Reply all
Reply to author
Forward
0 new messages