I am trying to fit the plane using SVD. The algorithm that I am using is following:
- From each point subtract centroid
- Calculate SVD
- Find normal as 3rd column of matrix $U$
I have 7 points to fit. So matrix $A$ is $7\times3$. Matrix U is $7\times7$. My problem or question is : I assume that normal vector in 3d space are consist of 3 numbers. Matrix $U$ is $7\times7$. If I take 3rd column of matrix $U$ then I have $7$ numbers. I don't know which 3 numbers from these 7 numbers are my normal vector. Thank you very much for your answers.
Best Answer
The SVD decomposition of $A \in \mathbb{R}^{7 \times 3}$ is as follows:
$A = U \Sigma V^T$
where $U$ is a $7 \times 7$ orthogonal matrix, $V$ is a $3 \times 3$ orthogonal matrix, and $\Sigma$ is a $7 \times 3$ "diagonal" matrix. The meaning of each matrix is:
In this case, since all 3D points are supposed to be in a plane (2 dimensional space) the minimal basis which spans them will have two components, thus, there will be only 2 singular values different to zero. If you write: $$ U = (u_1 \dots u_7)$$ $$ V = (v_1 \dots v_3)$$ $$ \Sigma = diag(\sigma_1, \sigma_2,\sigma_3)$$ With $\sigma_3 = 0$
What you are looking for is $v_3$