ceres::AngleAxisRotationPoint(camera, point, p)

3,266 views
Skip to first unread message

ghlee

unread,
Jun 21, 2012, 12:53:22 PM6/21/12
to ceres-...@googlegroups.com
Hi,

I am getting wrong outputs from the ceres::AngleAxisRotationPoint(camera, point, p) function.
Am I wrong to use roll, pitch, yaw Euler angles as the input parameters for camera? If so, what should be the correct inputs?

Rgds,
Gim Hee

Keir Mierle

unread,
Jun 21, 2012, 1:01:08 PM6/21/12
to ceres-...@googlegroups.com
AngleAxis is a rotation expressed as a angle around which to rotate (the three components); the amount to rotate is expressed by the magnitude of p.


--
-- ---------------------------------------- Ceres Solver Google Group http://groups.google.com/group/ceres-solver?hl=en?hl=en

Keir Mierle

unread,
Jun 21, 2012, 1:01:39 PM6/21/12
to ceres-...@googlegroups.com
Email sent too soon see bold below:

On Thu, Jun 21, 2012 at 10:01 AM, Keir Mierle <mie...@gmail.com> wrote:
AngleAxis is a rotation expressed as a AXIS around which to rotate (the three components); the amount to rotate is expressed by the magnitude of p.

Sameer Agarwal

unread,
Jun 21, 2012, 1:04:38 PM6/21/12
to ceres-...@googlegroups.com
Hi Gim,

This function uses the AngleAxis format for rotations, i.e, it uses a rodriguez vector for rotation.

http://en.wikipedia.org/wiki/Axis-angle_representation

You will have to use something else for euler angles. For example you can use ceres::EulerAnglesToRotationMatrix  to convert to the euler angles to a rotation matrix and then use the rotation matrix to rotate the point.

Sameer


On Thu, Jun 21, 2012 at 9:53 AM, ghlee <lgi...@gmail.com> wrote:

--

Gim Hee

unread,
Jun 21, 2012, 3:54:15 PM6/21/12
to ceres-...@googlegroups.com
Hi Sameer,

Thanks for your prompt reply. ceres::EulerAnglesToRotationMatrix is the function I am looking for!

Rgds,
Gim Hee

Vincent Rabaud

unread,
Jun 21, 2012, 5:02:20 PM6/21/12
to ceres-...@googlegroups.com
Sameer. Please. His name was RodrigueS with a silent S. I know it sounds sexier with a z but no need to be sexy when you're French :p

Sameer Agarwal

unread,
Jun 21, 2012, 5:09:04 PM6/21/12
to ceres-...@googlegroups.com
Vincent,

I actually thought he was spanish but you are of course correct he is a frenchman.


not just a mathematician but a banker too..

The entire french nation has my sincerest apologies :)

Sameer

Vincent Rabaud

unread,
Jun 21, 2012, 5:18:36 PM6/21/12
to ceres-...@googlegroups.com
The entire French nation thank you guys for Ceres :)

Francesco Callari

unread,
Jun 22, 2012, 8:30:31 AM6/22/12
to ceres-...@googlegroups.com
On Thu, Jun 21, 2012 at 5:09 PM, Sameer Agarwal <sameer...@google.com> wrote:
Vincent,

I actually thought he was spanish but you are of course correct he is a frenchman.


not just a mathematician but a banker too..


Great gain for geometry (and political economy too) that he came of age in the quaint XIX century banking world, these days he'd be much more likely to rotate $$$ in and out of financial derivatives accounts while helping crash the world economy ;-)



--
Franco Callari <fgca...@gmail.com>

            EC67 BEBE 62AC 8415 7591  2B12 A6CD D5EE D8CB D0ED

I am not bound to win, but I am bound to be true. I am not bound to succeed, but I am bound to live by the light that I have. (Abraham Lincoln)

Mehdi Tlili

unread,
Dec 15, 2014, 12:03:06 AM12/15/14
to ceres-...@googlegroups.com
Following the example from the bundle adjustment tutorial http://ceres-solver.org/nnls_tutorial.html#bundle-adjustment

I wanted to input Euler angles that I want to optimize instead of axis-angles. In order to do so I replaced this part of the code :
// camera[0,1,2] are the angle-axis rotation.
T p
[3];
ceres
::AngleAxisRotatePoint(camera, point, p);

By

 T R
[9]; //rotation matrix
 T camera_axis_angles
[3];

 ceres
::EulerAnglesToRotationMatrix(camera_euler_angles, 3, R);
 ceres
::RotationMatrixToAngleAxis(R, camera_axis_angles);
 ceres
::AngleAxisRotatePoint(camera_axis_angles, point, p);

But I am not getting the results I want. Am I doing something wrong here?

Sameer Agarwal

unread,
Dec 15, 2014, 11:17:03 AM12/15/14
to ceres-...@googlegroups.com
Mehdi,
What version of ceres are you using?

What do you mean you are not getting the results that you want? have you checked the output of the cost function on some test data to see if  it is computing the right thing?

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/eae8482b-8b12-4ad7-98b4-4a32ace6b6f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Karl Reinig

unread,
Nov 2, 2021, 11:40:24 AM11/2/21
to Ceres Solver
Isn't it the magnitude of the camera that determines the angle? I thought p was just where the results are placed.
Reply all
Reply to author
Forward
0 new messages