convert 3D plane to 2D

ayan.c picture ayan.c · May 22, 2014 · Viewed 7.4k times · Source

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. How can I get the values of a,b,c from raw point cloud data? Will least square be the best approach or there is any way to obtain these values from RANSAC fitting?
  2. From some tutorials I got an idea about doing the following steps: translate to centre of mass, rotate about x-axis, rotate about y-axis, then un-translate again. Does it make sense? 3. How can I get the rotation angle in terms of a,b,c?

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

Answer

Yves Daoust picture Yves Daoust · May 23, 2014

You need a change of basis.

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

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).

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.

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

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