Error in Apply Transformation
-
- Posts: 4
- Joined: Wed Jan 27, 2021 4:32 pm
Error in Apply Transformation
Good morning everyone!
I'm new in Cloud Compare and I have a simple doubt regarding the apply transformation tool.
I have a point cloud (axes x,y,z, origin o) that I need to transform according to camera axes orientation (let's say x',y',z', camera center c to be used as origin). To do this I've calculated the 4x4 matrix necessary to apply the rotation and translation of my system, and I've used it in the "apply tansformation tool". The result seems good, but when I retransform it back to the original axes (unflag the "apply inverse transformation", figure b) the outcome doesn't completely match the original point cloud (figure a,b). Why does this happen?
Thank you for your kind help
Cheers
Snaphu C.
I'm new in Cloud Compare and I have a simple doubt regarding the apply transformation tool.
I have a point cloud (axes x,y,z, origin o) that I need to transform according to camera axes orientation (let's say x',y',z', camera center c to be used as origin). To do this I've calculated the 4x4 matrix necessary to apply the rotation and translation of my system, and I've used it in the "apply tansformation tool". The result seems good, but when I retransform it back to the original axes (unflag the "apply inverse transformation", figure b) the outcome doesn't completely match the original point cloud (figure a,b). Why does this happen?
Thank you for your kind help
Cheers
Snaphu C.
Re: Error in Apply Transformation
2 options:
- the transformation is not perfectly orthogonal, i.e. each vector (= 3 first columns) norm should be equal to 1, and they should all be orthogonal to each other (X.Y = X.Z = Y.Z = 0)
- the coordinates of the cloud are too big (in case you ignored the "Global Shift" warning - if any). And the loss of accuracy explains the issue
- the transformation is not perfectly orthogonal, i.e. each vector (= 3 first columns) norm should be equal to 1, and they should all be orthogonal to each other (X.Y = X.Z = Y.Z = 0)
- the coordinates of the cloud are too big (in case you ignored the "Global Shift" warning - if any). And the loss of accuracy explains the issue
Daniel, CloudCompare admin
-
- Posts: 4
- Joined: Wed Jan 27, 2021 4:32 pm
Re: Error in Apply Transformation
Thank you Dianel for your quick reply!
Actually, the point cloud coordinates are corrected with the global shift option, so I don't think that "option 2" is the problem.
Instead, option 1 may have sense. So, according to your suggestion the x y z axes of the camera are not perfectly orthogonal. Am I right?
Thank you again
Snaphu C.
Actually, the point cloud coordinates are corrected with the global shift option, so I don't think that "option 2" is the problem.
Instead, option 1 may have sense. So, according to your suggestion the x y z axes of the camera are not perfectly orthogonal. Am I right?
Thank you again
Snaphu C.
Re: Error in Apply Transformation
Yes that's an option. Or their norm is not 1 exactly?
Daniel, CloudCompare admin
-
- Posts: 4
- Joined: Wed Jan 27, 2021 4:32 pm
Re: Error in Apply Transformation
Thanks for reply, I use the camera angles orientation (omega, phi ,kappa) to calculate the rotation matrix using the equations as :
So i think that each vector (= 3 first columns) mathematically is equal to 1, and they should all be orthogonal to each other (X.Y = X.Z = Y.Z = 0). Am i wrong?-
- Posts: 187
- Joined: Tue Mar 05, 2019 3:59 pm
Re: Error in Apply Transformation
So I'm positive that the matrix used was not orthogonal (according to wolfram alpha at least :) )
using the Orthogonalize function on wolfram alpha for your original matrix gives
-0.95582263396 0.061432249030 -0.28745290256 38.516654968262
-0.28723579125 0.012527465527 0.95777798202 81.873214721680
0.062439511834 0.99803263543 0.0056715055617 234.736160278320
0.000000000000 0.000000000000 0.000000000000 1.000000000000
using that matrix instead of the original, the transformation is reversible using the inverse transform. (at least within numerical accuracy of of our transform class) I'm seeing slight z transform differences before and after (-7.6294E-06)
using the Orthogonalize function on wolfram alpha for your original matrix gives
-0.95582263396 0.061432249030 -0.28745290256 38.516654968262
-0.28723579125 0.012527465527 0.95777798202 81.873214721680
0.062439511834 0.99803263543 0.0056715055617 234.736160278320
0.000000000000 0.000000000000 0.000000000000 1.000000000000
using that matrix instead of the original, the transformation is reversible using the inverse transform. (at least within numerical accuracy of of our transform class) I'm seeing slight z transform differences before and after (-7.6294E-06)
-
- Posts: 187
- Joined: Tue Mar 05, 2019 3:59 pm
Re: Error in Apply Transformation
@daniel
Maybe it would be useful to add a check function for orthogonality, and a orgonalize function to our matrix class?
Maybe it would be useful to add a check function for orthogonality, and a orgonalize function to our matrix class?
-
- Posts: 4
- Joined: Wed Jan 27, 2021 4:32 pm
Re: Error in Apply Transformation
thank you for your reply,
using ortoghonalized matrix the transformation works fine. Is The wolphram alpha function avaiable online?
using ortoghonalized matrix the transformation works fine. Is The wolphram alpha function avaiable online?
-
- Posts: 187
- Joined: Tue Mar 05, 2019 3:59 pm
Re: Error in Apply Transformation
Yes both function are accessible here:
Wolfram Alpha Check for Orthogonality
and here:
Wolfram Alpha Othoganalize
Wolfram Alpha Check for Orthogonality
and here:
Wolfram Alpha Othoganalize