将 3D 平面转换为 2D [英] convert 3D plane to 2D

查看:37
本文介绍了将 3D 平面转换为 2D的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组点云在 3D 中形成一个平面,这是我从 RANSAC 平面拟合中获得的.对于某些特定类型的数据分析,我需要将其转换为二维问题,以便所有 z 值几乎相同.假设平面的方程是ax+by+cz+1=0.我的问题是:

I have a set of point cloud forming a plane in 3D, which I've obtained from RANSAC plane fitting. For some specific kind of analysis of the data I need to convert this to a 2D problem so that I can have all the z-values almost same. Suppose the equation of the plane is ax+by+cz+1=0. My question is that:

  1. 如何从原始点云数据中获取 a、b、c 的值?最小二乘法是最好的方法还是有什么方法可以从 RANSAC 拟合中获得这些值?
  2. 从一些教程中,我得到了执行以下步骤的想法:平移到质心,绕 x 轴旋转,绕 y 轴旋转,然后再次取消平移.是否有意义?3. 如何根据 a、b、c 获得旋转角度?

我需要一些将 3D 平面转换为 2D 的总体思路,以便所有 z 坐标值都相同.

I need some general idea of converting a 3D plane to 2D so that all the z-coordinate values are same.

推荐答案

你需要改变基础.

让我们创建由三个向量 XYZ 组成的新正交基.

Let us create the new orthonormal basis formed of three vectors X, Y and Z.

你的新 Z 将是平面的法向量,(a, b, c).通过将所有三个分量除以 Sqrt(a^2+b^2+c^2) 对其进行归一化.

Your new Z will be the normal vector of the plane, (a, b, c). Normalize it by dividing all three components by Sqrt(a^2+b^2+c^2).

然后取一个与第一个不平行的任意向量,让 U.计算点积 U.Z 并从 U 中减去 (U.Z).Z.将结果向量归一化为 X.

Then take an arbitrary vector, not parallel to the first, let U. Compute the dot product U.Z and subtract (U.Z).Z from U. Normalize the resulting vector as X.

最后,计算叉积Y = Z//X.

Lastly, compute the cross product Y = Z / X.

然后,通过计算点积 (Pi.X, Pi.Y) 将每个点 Pi 转换为 2D.

Then, transform every point Pi to 2D by computing the dot products (Pi.X, Pi.Y).

这篇关于将 3D 平面转换为 2D的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆