基于法向量的点云旋转
我希望根据地板的方向旋转 3D 点云。我已经检测到地板并计算了其法线向量。我想使用这个法线向量来确保地板上的所有点都具有相同的 y 值。
由于两个归一化向量的点积是它们之间角度的余弦,因此我首先对当前法向量 (0.856, 0.958, 2.58) 以及所需法向量 (0.0, 0.958, 0.0) 进行归一化。点积 = 0.917,因此角度 = 70.586,但在 3 维中,这似乎没有用。我需要进行两次轮换吗?如果是这样,有关于最佳方法的建议吗?
I'm looking to rotate a 3-D point cloud based on the orientation of the floor. I have detected the floor and calculated its normal vector. I want to use this normal vector to ensure that all points on the floor have the same y-value.
Since the dot product of two normalized vectors is the cosine of the angle between them, I first normalize the current normal vector (0.856, 0.958, 2.58) as well as the desired normal vector (0.0, 0.958, 0.0). The dot product = 0.917 and therefore the angle = 70.586, but being in 3 dimensions this does not seem useful. Do I need to perform two rotations? If so, are there any suggestions as to the best approach?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想要将法线向量
A
转换为所需的法线向量A'
的旋转,则它们的数量是无限的。 (给定一个这样的旋转,您可以应用它,然后将其与围绕A'
的旋转组合起来,以获得许多执行相同操作的其他旋转。)在 3-D 中效果很好的一种方法是计算叉积向量
V = A x A'
(垂直于包含A
和A'
的平面),然后旋转V
之间的角度A
和A'
。 (首先测试A
和A'
是否已重合非常重要。)这里有一个关于如何相当有效地完成所有这些操作的描述 此处。
If you want a rotation that will transform a normal vector
A
into a desired normal vectorA'
, there are an infinite number of them. (Given one such rotation, you can apply it and then compose it with spins aroundA'
to get lots of other rotations that do the same thing.)One approach that works nicely in 3-D is to compute the cross-product vector
V = A x A'
(which is normal to the plane containingA
andA'
) and then rotate aroundV
by the angle betweenA
andA'
. (It's important to first test thatA
andA'
aren't already coincident.)There's a description of how to do all this fairly efficiently here.