Equality constraint working around?

426 views
Skip to first unread message

Fürnstáhl Gergely

unread,
Oct 4, 2016, 12:01:40 PM10/4/16
to Ceres Solver

Hi!

I’m trying solve a non linear least square problem with Ceres library. The residuals is basically dot products (s1*x + s2*y + s3*z + s4), distanses of an (x,y,z) point and a (s1,s2,s3,s4) plane. x,y,z depends on other parameters nonlinearly. I want to estimate the parameters of the planes as well but to do so, I need an equality constraint for them (s1^2 + s2^2 + s3^2 = 1), otherwise lowering all the parameters will always lower the residuals. I know Ceres does not support explicitly equality constraints, but is there a working around method for this?

 

Thanks in advance!

Gergely

Sameer Agarwal

unread,
Oct 4, 2016, 12:25:16 PM10/4/16
to Ceres Solver

Two ways of doing this.
You can always normalize the plane parameters before using them. That way the residual does not depend on the norm of the parameters.

Another idea is to use the homogeneous vector parameterization.

Sameer


--
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 on the web visit https://groups.google.com/d/msgid/ceres-solver/0c34ee68-63e9-4acd-9704-a8bea5d5fae6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Fürnstáhl Gergely

unread,
Oct 6, 2016, 11:59:34 AM10/6/16
to Ceres Solver
Well, the homogeneous vector parameterization is basically the same as dividing with the length. But the good news that it worked nicely, thanks!

I guess it worth to mention that this is because the cost function is linear in the pane parameters, so the jacobian will not depend on the actual values of the plane's parameters either (if I'm not mistaken). If this wasnt true, the derivates would depend on the plane parameters.

Meanwhile I got another idea for this. The initial length of the plane's norm vector should be 1, then instead of giving these parameter (s1,s2,s3) to the solver, we can give another 3 parameters to it (yaw,pitch,roll) and calculate the current norm vector as Rot(y,p,r)*s_init. This way we only allow rotational transformation on the normal vector, so it's length will be always 1.

Sameer Agarwal

unread,
Oct 6, 2016, 2:38:58 PM10/6/16
to ceres-...@googlegroups.com
On Thu, Oct 6, 2016 at 8:59 AM Fürnstáhl Gergely <g.fur...@gmail.com> wrote:
Well, the homogeneous vector parameterization is basically the same as dividing with the length. But the good news that it worked nicely, thanks!

Great.
 
I guess it worth to mention that this is because the cost function is linear in the pane parameters, so the jacobian will not depend on the actual values of the plane's parameters either (if I'm not mistaken). If this wasnt true, the derivates would depend on the plane parameters.

sure it will. 

if you have a function a^Tx, the jacobian is a.

 
Meanwhile I got another idea for this. The initial length of the plane's norm vector should be 1, then instead of giving these parameter (s1,s2,s3) to the solver, we can give another 3 parameters to it (yaw,pitch,roll) and calculate the current norm vector as Rot(y,p,r)*s_init. This way we only allow rotational transformation on the normal vector, so it's length will be always 1.

This is basically the same thing as using a local parameterization.

Sameer
 


2016. október 4., kedd 18:25:16 UTC+2 időpontban Sameer Agarwal a következőt írta:

Two ways of doing this.
You can always normalize the plane parameters before using them. That way the residual does not depend on the norm of the parameters.

Another idea is to use the homogeneous vector parameterization.

Sameer


On Tue, Oct 4, 2016, 9:01 AM Fürnstáhl Gergely <g.fur...@gmail.com> wrote:

Hi!

I’m trying solve a non linear least square problem with Ceres library. The residuals is basically dot products (s1*x + s2*y + s3*z + s4), distanses of an (x,y,z) point and a (s1,s2,s3,s4) plane. x,y,z depends on other parameters nonlinearly. I want to estimate the parameters of the planes as well but to do so, I need an equality constraint for them (s1^2 + s2^2 + s3^2 = 1), otherwise lowering all the parameters will always lower the residuals. I know Ceres does not support explicitly equality constraints, but is there a working around method for this?

 

Thanks in advance!

Gergely

--
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.

--
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.
Reply all
Reply to author
Forward
0 new messages