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:
I need some general idea of converting a 3D plane to 2D so that all the z-coordinate values are same.
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).