Hi! I have a question about the transformation matrix.
I have a matrix for transforming a point cloud. As far as I know, it rotates the cloud around each of the coordinate axes and also moves it. In the device that performs the scanning there is already a function to horizon the point cloud. What values in the transformation matrix should I edit (and to what values) so that the cloud does not rotate around the X and Y axes?
Transformation matrix example:
0.804399132729 0.594087004662 -0.001635871246 12.917531967163
-0.594085752964 0.804400801659 0.001233666320 -5.997133731842
0.002048801165 -0.000020512347 0.999997913837 0.328147798777
0.000000000000 0.000000000000 0.000000000000 1.000000000000
Transformation matrix
Re: Transformation matrix
So the 3rd column (3 first rows) is your new Z axis. And the 4th one is the translation. What you want to get rid of (virtually) are 2 first columns which are the new X and Y axes.
First, you could assume that Z'=(-0.001635871246, 0.001233666320, 0.999997913837) is very close to Z=(0, 0, 1) and you simply keep the translation:
1 0 0 12.917531967163
0 1 0 -5.997133731842
0 0 1 0.328147798777
0 0 0 1
But you might lose a little bit of accuracy since Z' is ~0.1 deg off of Z.
Otherwise you'll have to find a way to to compute the normalized projection of X(0 0 1) into the plane with normal Z', and deduce Y' by cross product (Y' = Z'^X'). And that's assuming X(0 0 1) is the 'default' orientation...
First, you could assume that Z'=(-0.001635871246, 0.001233666320, 0.999997913837) is very close to Z=(0, 0, 1) and you simply keep the translation:
1 0 0 12.917531967163
0 1 0 -5.997133731842
0 0 1 0.328147798777
0 0 0 1
But you might lose a little bit of accuracy since Z' is ~0.1 deg off of Z.
Otherwise you'll have to find a way to to compute the normalized projection of X(0 0 1) into the plane with normal Z', and deduce Y' by cross product (Y' = Z'^X'). And that's assuming X(0 0 1) is the 'default' orientation...
Daniel, CloudCompare admin
Re: Transformation matrix
Daniel, thanks for the quick response!
I made a few attempts and realized I was not 100% understood, but found the right one.
For those who will have a similar situation with point clouds.
inputs:
1)you have 2 point clouds that need to be combined
2) the device has already made them horizontal when doing the work
3) you have a transformation matrix
4) you don't want to take into account the rotation of the point cloud around the X and Y axis (you need to move the cloud and rotate it only around the Z axis).
So my experience:
the original transform matrix looked like this:
Transformation matrix
0.804399132729 0.594087004662 -0.001635871246 12.917531967163
-0.594085752964 0.804400801659 0.001233666320 -5.997133731842
0.002048801165 -0.000020512347 0.999997913837 0.328147798777
0.000000000000 0.000000000000 0.000000000000 1.000000000000
I tried to perform the unrolling using the matrix:
VER1 bad
1 0 -0.001635871246 12.917531967163
0 1 0.001233666320 -5.997133731842
0 0 0.999997913837 0.328147798777
0.000000000000 0.000000000000 0.000000000000 1.000000000000
as a result, the cloud was moved (also a turn around the X and Y axes, but insignificant due to small values)
next step I used the matrix :
VER2
0.804399132729 0.594087004662 0 12.917531967163
-0.594085752964 0.804400801659 0 -5.997133731842
0.002048801165 -0.000020512347 1 0.328147798777
0.000000000000 0.000000000000 0.000000000000 1.000000000000
Preloaded the cloud again to zero out the previous transformations
The result was excellent, the cloud is as it should be.
Based on this experience we can formulate that to exclude the influence of transformation parameters on the point cloud horizon in the matrix it is necessary to replace 3 values in the 3rd column with 0, 0, 1.
that is
value value 0 value
value value 0 value
value value 1 value
value value value value
I made a few attempts and realized I was not 100% understood, but found the right one.
For those who will have a similar situation with point clouds.
inputs:
1)you have 2 point clouds that need to be combined
2) the device has already made them horizontal when doing the work
3) you have a transformation matrix
4) you don't want to take into account the rotation of the point cloud around the X and Y axis (you need to move the cloud and rotate it only around the Z axis).
So my experience:
the original transform matrix looked like this:
Transformation matrix
0.804399132729 0.594087004662 -0.001635871246 12.917531967163
-0.594085752964 0.804400801659 0.001233666320 -5.997133731842
0.002048801165 -0.000020512347 0.999997913837 0.328147798777
0.000000000000 0.000000000000 0.000000000000 1.000000000000
I tried to perform the unrolling using the matrix:
VER1 bad
1 0 -0.001635871246 12.917531967163
0 1 0.001233666320 -5.997133731842
0 0 0.999997913837 0.328147798777
0.000000000000 0.000000000000 0.000000000000 1.000000000000
as a result, the cloud was moved (also a turn around the X and Y axes, but insignificant due to small values)
next step I used the matrix :
VER2
0.804399132729 0.594087004662 0 12.917531967163
-0.594085752964 0.804400801659 0 -5.997133731842
0.002048801165 -0.000020512347 1 0.328147798777
0.000000000000 0.000000000000 0.000000000000 1.000000000000
Preloaded the cloud again to zero out the previous transformations
The result was excellent, the cloud is as it should be.
Based on this experience we can formulate that to exclude the influence of transformation parameters on the point cloud horizon in the matrix it is necessary to replace 3 values in the 3rd column with 0, 0, 1.
that is
value value 0 value
value value 0 value
value value 1 value
value value value value