Mean of several 4*4 transform matrices. [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I have 30 homogeneous, 4x4 transform matrices and I want to calculate the mean/average of these transforms in a meaningful way. By meaningful, I mean that the end result must preserve orthogonality and affinity of the transform.



The story is that I have a directed graph of transforms and coordinate systems (vertices are coordinate systems and edges are transforms). It looks somehow like this:
Transform and coordinate system graph



I can calculate the transform from the coordinate system M to the other coordinate system C by traversing the graph from M to L1, P1, and then to C, multiplying transforms along the way (inverting the transform if moving in the opposite direction). In the same way I should be able to traverse the graph along a loop (say, M -> L1 -> P1 -> C -> P2 -> L2 -> M) and expect the result to be identity (because I get back to the initial coordinate system). But since these transforms are the results of some measurements that I have done, they incorporate some error and the result of the loop slightly deviates from I. This represents the measurement error in one loop. Given that I have 30 independent loops in this configuration, I have 30 transform matrices that are near identity and represent the error of some measurement system. I want to compute the mean error of this system, so I need to compute the average of these 30 near-identity matrices in some way. I hope this is clear enough.



I have already tried adding up these 30 matrices and then dividing the sum by 30. This obviously doesn't work as the resultant transform doesn't represent an an affine transform for an orthogonal coordinate system.



Another idea I had was to extract the translation and rotation parts of the transforms and convert the rotations to rotation vectors (using inverse Rodrigues formula), then separately compute the average for the translation vectors and rotation vectors, and finally convert the average rotation vector back to its matrix representation and use it along with the average translation vector to create an average 4x4 transform matrix. But I'm not sure if this is a valid solution.



I'll be thankful if anyone could help me with this.







share|cite|improve this question













closed as unclear what you're asking by José Carlos Santos, Xander Henderson, Mostafa Ayaz, max_zorn, Shailesh Jul 23 at 0:06


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • If what you are interested in is what they perform when doing matrix multiplication on something and they are not commutative with each other I don't see how to do it in general as it would depend on the order of operations. But I am no algebraist, so probably good to wait for someone else too.
    – mathreadler
    Jul 22 at 12:31











  • How do you average a matrix and its negative while preserving orthogonality?
    – Somos
    Jul 22 at 13:58











  • @mathreadler performing an average on a set, IMHO, should should not be dependent on the order you introduce elements to the operation. So far the best thing I've come up with is what I have mentioned in the question (extracting rotation/translation and performing average of the translation/rotation vectors). But I want to make sure that this is a valid solution or find perhaps some backing in literature for it.
    – Manizhe Rahchamani
    Jul 22 at 15:08










  • @Somos that's my question. In case of a matrix and its negative the conventional arithmetic average (adding up elements and dividing by the number) yields the null matrix which obviously is not an affine transform anymore. For the negative I can't be sure. But in the case of finding the average for a matrix and its inverse, the correct average should be identity - I think.
    – Manizhe Rahchamani
    Jul 22 at 15:12










  • Maybe mention all the properties that you think a "meaningful" average should have in your question? What about rotations about a single axis?
    – Somos
    Jul 22 at 15:23















up vote
1
down vote

favorite












I have 30 homogeneous, 4x4 transform matrices and I want to calculate the mean/average of these transforms in a meaningful way. By meaningful, I mean that the end result must preserve orthogonality and affinity of the transform.



The story is that I have a directed graph of transforms and coordinate systems (vertices are coordinate systems and edges are transforms). It looks somehow like this:
Transform and coordinate system graph



I can calculate the transform from the coordinate system M to the other coordinate system C by traversing the graph from M to L1, P1, and then to C, multiplying transforms along the way (inverting the transform if moving in the opposite direction). In the same way I should be able to traverse the graph along a loop (say, M -> L1 -> P1 -> C -> P2 -> L2 -> M) and expect the result to be identity (because I get back to the initial coordinate system). But since these transforms are the results of some measurements that I have done, they incorporate some error and the result of the loop slightly deviates from I. This represents the measurement error in one loop. Given that I have 30 independent loops in this configuration, I have 30 transform matrices that are near identity and represent the error of some measurement system. I want to compute the mean error of this system, so I need to compute the average of these 30 near-identity matrices in some way. I hope this is clear enough.



I have already tried adding up these 30 matrices and then dividing the sum by 30. This obviously doesn't work as the resultant transform doesn't represent an an affine transform for an orthogonal coordinate system.



Another idea I had was to extract the translation and rotation parts of the transforms and convert the rotations to rotation vectors (using inverse Rodrigues formula), then separately compute the average for the translation vectors and rotation vectors, and finally convert the average rotation vector back to its matrix representation and use it along with the average translation vector to create an average 4x4 transform matrix. But I'm not sure if this is a valid solution.



I'll be thankful if anyone could help me with this.







share|cite|improve this question













closed as unclear what you're asking by José Carlos Santos, Xander Henderson, Mostafa Ayaz, max_zorn, Shailesh Jul 23 at 0:06


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • If what you are interested in is what they perform when doing matrix multiplication on something and they are not commutative with each other I don't see how to do it in general as it would depend on the order of operations. But I am no algebraist, so probably good to wait for someone else too.
    – mathreadler
    Jul 22 at 12:31











  • How do you average a matrix and its negative while preserving orthogonality?
    – Somos
    Jul 22 at 13:58











  • @mathreadler performing an average on a set, IMHO, should should not be dependent on the order you introduce elements to the operation. So far the best thing I've come up with is what I have mentioned in the question (extracting rotation/translation and performing average of the translation/rotation vectors). But I want to make sure that this is a valid solution or find perhaps some backing in literature for it.
    – Manizhe Rahchamani
    Jul 22 at 15:08










  • @Somos that's my question. In case of a matrix and its negative the conventional arithmetic average (adding up elements and dividing by the number) yields the null matrix which obviously is not an affine transform anymore. For the negative I can't be sure. But in the case of finding the average for a matrix and its inverse, the correct average should be identity - I think.
    – Manizhe Rahchamani
    Jul 22 at 15:12










  • Maybe mention all the properties that you think a "meaningful" average should have in your question? What about rotations about a single axis?
    – Somos
    Jul 22 at 15:23













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I have 30 homogeneous, 4x4 transform matrices and I want to calculate the mean/average of these transforms in a meaningful way. By meaningful, I mean that the end result must preserve orthogonality and affinity of the transform.



The story is that I have a directed graph of transforms and coordinate systems (vertices are coordinate systems and edges are transforms). It looks somehow like this:
Transform and coordinate system graph



I can calculate the transform from the coordinate system M to the other coordinate system C by traversing the graph from M to L1, P1, and then to C, multiplying transforms along the way (inverting the transform if moving in the opposite direction). In the same way I should be able to traverse the graph along a loop (say, M -> L1 -> P1 -> C -> P2 -> L2 -> M) and expect the result to be identity (because I get back to the initial coordinate system). But since these transforms are the results of some measurements that I have done, they incorporate some error and the result of the loop slightly deviates from I. This represents the measurement error in one loop. Given that I have 30 independent loops in this configuration, I have 30 transform matrices that are near identity and represent the error of some measurement system. I want to compute the mean error of this system, so I need to compute the average of these 30 near-identity matrices in some way. I hope this is clear enough.



I have already tried adding up these 30 matrices and then dividing the sum by 30. This obviously doesn't work as the resultant transform doesn't represent an an affine transform for an orthogonal coordinate system.



Another idea I had was to extract the translation and rotation parts of the transforms and convert the rotations to rotation vectors (using inverse Rodrigues formula), then separately compute the average for the translation vectors and rotation vectors, and finally convert the average rotation vector back to its matrix representation and use it along with the average translation vector to create an average 4x4 transform matrix. But I'm not sure if this is a valid solution.



I'll be thankful if anyone could help me with this.







share|cite|improve this question













I have 30 homogeneous, 4x4 transform matrices and I want to calculate the mean/average of these transforms in a meaningful way. By meaningful, I mean that the end result must preserve orthogonality and affinity of the transform.



The story is that I have a directed graph of transforms and coordinate systems (vertices are coordinate systems and edges are transforms). It looks somehow like this:
Transform and coordinate system graph



I can calculate the transform from the coordinate system M to the other coordinate system C by traversing the graph from M to L1, P1, and then to C, multiplying transforms along the way (inverting the transform if moving in the opposite direction). In the same way I should be able to traverse the graph along a loop (say, M -> L1 -> P1 -> C -> P2 -> L2 -> M) and expect the result to be identity (because I get back to the initial coordinate system). But since these transforms are the results of some measurements that I have done, they incorporate some error and the result of the loop slightly deviates from I. This represents the measurement error in one loop. Given that I have 30 independent loops in this configuration, I have 30 transform matrices that are near identity and represent the error of some measurement system. I want to compute the mean error of this system, so I need to compute the average of these 30 near-identity matrices in some way. I hope this is clear enough.



I have already tried adding up these 30 matrices and then dividing the sum by 30. This obviously doesn't work as the resultant transform doesn't represent an an affine transform for an orthogonal coordinate system.



Another idea I had was to extract the translation and rotation parts of the transforms and convert the rotations to rotation vectors (using inverse Rodrigues formula), then separately compute the average for the translation vectors and rotation vectors, and finally convert the average rotation vector back to its matrix representation and use it along with the average translation vector to create an average 4x4 transform matrix. But I'm not sure if this is a valid solution.



I'll be thankful if anyone could help me with this.









share|cite|improve this question












share|cite|improve this question




share|cite|improve this question








edited Jul 22 at 16:01
























asked Jul 22 at 11:04









Manizhe Rahchamani

62




62




closed as unclear what you're asking by José Carlos Santos, Xander Henderson, Mostafa Ayaz, max_zorn, Shailesh Jul 23 at 0:06


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as unclear what you're asking by José Carlos Santos, Xander Henderson, Mostafa Ayaz, max_zorn, Shailesh Jul 23 at 0:06


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.













  • If what you are interested in is what they perform when doing matrix multiplication on something and they are not commutative with each other I don't see how to do it in general as it would depend on the order of operations. But I am no algebraist, so probably good to wait for someone else too.
    – mathreadler
    Jul 22 at 12:31











  • How do you average a matrix and its negative while preserving orthogonality?
    – Somos
    Jul 22 at 13:58











  • @mathreadler performing an average on a set, IMHO, should should not be dependent on the order you introduce elements to the operation. So far the best thing I've come up with is what I have mentioned in the question (extracting rotation/translation and performing average of the translation/rotation vectors). But I want to make sure that this is a valid solution or find perhaps some backing in literature for it.
    – Manizhe Rahchamani
    Jul 22 at 15:08










  • @Somos that's my question. In case of a matrix and its negative the conventional arithmetic average (adding up elements and dividing by the number) yields the null matrix which obviously is not an affine transform anymore. For the negative I can't be sure. But in the case of finding the average for a matrix and its inverse, the correct average should be identity - I think.
    – Manizhe Rahchamani
    Jul 22 at 15:12










  • Maybe mention all the properties that you think a "meaningful" average should have in your question? What about rotations about a single axis?
    – Somos
    Jul 22 at 15:23

















  • If what you are interested in is what they perform when doing matrix multiplication on something and they are not commutative with each other I don't see how to do it in general as it would depend on the order of operations. But I am no algebraist, so probably good to wait for someone else too.
    – mathreadler
    Jul 22 at 12:31











  • How do you average a matrix and its negative while preserving orthogonality?
    – Somos
    Jul 22 at 13:58











  • @mathreadler performing an average on a set, IMHO, should should not be dependent on the order you introduce elements to the operation. So far the best thing I've come up with is what I have mentioned in the question (extracting rotation/translation and performing average of the translation/rotation vectors). But I want to make sure that this is a valid solution or find perhaps some backing in literature for it.
    – Manizhe Rahchamani
    Jul 22 at 15:08










  • @Somos that's my question. In case of a matrix and its negative the conventional arithmetic average (adding up elements and dividing by the number) yields the null matrix which obviously is not an affine transform anymore. For the negative I can't be sure. But in the case of finding the average for a matrix and its inverse, the correct average should be identity - I think.
    – Manizhe Rahchamani
    Jul 22 at 15:12










  • Maybe mention all the properties that you think a "meaningful" average should have in your question? What about rotations about a single axis?
    – Somos
    Jul 22 at 15:23
















If what you are interested in is what they perform when doing matrix multiplication on something and they are not commutative with each other I don't see how to do it in general as it would depend on the order of operations. But I am no algebraist, so probably good to wait for someone else too.
– mathreadler
Jul 22 at 12:31





If what you are interested in is what they perform when doing matrix multiplication on something and they are not commutative with each other I don't see how to do it in general as it would depend on the order of operations. But I am no algebraist, so probably good to wait for someone else too.
– mathreadler
Jul 22 at 12:31













How do you average a matrix and its negative while preserving orthogonality?
– Somos
Jul 22 at 13:58





How do you average a matrix and its negative while preserving orthogonality?
– Somos
Jul 22 at 13:58













@mathreadler performing an average on a set, IMHO, should should not be dependent on the order you introduce elements to the operation. So far the best thing I've come up with is what I have mentioned in the question (extracting rotation/translation and performing average of the translation/rotation vectors). But I want to make sure that this is a valid solution or find perhaps some backing in literature for it.
– Manizhe Rahchamani
Jul 22 at 15:08




@mathreadler performing an average on a set, IMHO, should should not be dependent on the order you introduce elements to the operation. So far the best thing I've come up with is what I have mentioned in the question (extracting rotation/translation and performing average of the translation/rotation vectors). But I want to make sure that this is a valid solution or find perhaps some backing in literature for it.
– Manizhe Rahchamani
Jul 22 at 15:08












@Somos that's my question. In case of a matrix and its negative the conventional arithmetic average (adding up elements and dividing by the number) yields the null matrix which obviously is not an affine transform anymore. For the negative I can't be sure. But in the case of finding the average for a matrix and its inverse, the correct average should be identity - I think.
– Manizhe Rahchamani
Jul 22 at 15:12




@Somos that's my question. In case of a matrix and its negative the conventional arithmetic average (adding up elements and dividing by the number) yields the null matrix which obviously is not an affine transform anymore. For the negative I can't be sure. But in the case of finding the average for a matrix and its inverse, the correct average should be identity - I think.
– Manizhe Rahchamani
Jul 22 at 15:12












Maybe mention all the properties that you think a "meaningful" average should have in your question? What about rotations about a single axis?
– Somos
Jul 22 at 15:23





Maybe mention all the properties that you think a "meaningful" average should have in your question? What about rotations about a single axis?
– Somos
Jul 22 at 15:23
















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Comments

Popular posts from this blog

What is the equation of a 3D cone with generalised tilt?

Color the edges and diagonals of a regular polygon

Relationship between determinant of matrix and determinant of adjoint?