In this page, I describe how to derive normal vectors from a point cloud. A simple explanation is provided in the tutorial of the Point Cloud Library(PCL). According to the page, there are two approaches to calculate normal vectors from a point cloud:
- Determine a surface from a point cloud, and calculate a normal vector of a tangent plane.
- Calculate a normal vector from a point cloud directly.
- Consider a query point in a point cloud.
- Consider
k
points in the vicinity of the query point. - Determine a plane by means of a least-square plane fitting with the query point and the k neighbors.
- Extract a normal vector of the plane.
A point
where
where
First, we differentiate it partially with respect to
The equation is rewritten as
where
Differentiating it partially with respect to
The deformation of the equation reduces to
Now we have the equation of the eigenvalue problem of the covariance matrix created from the nearest neighbors of the query point.
This page tells us that the eigenvector corresponding to the smallest eigenvalue approximates the normal vector of the plane. We can confirm the fact as follows.
The sum of squared residuals is
,
where
is a set of nearest neighbors, and
is a centroid of them.
Using
, we can rewrite
as,
\begin{eqnarray}
F(\vec{n})&=&\vec{n}^{T}\;Q\;\vec{n} \nonumber \\
&=&\lambda\;\vec{n}^{T}\cdot\vec{n} \nonumber \\
&=&\lambda \nonumber
\end{eqnarray}
We used the condition that the norm of the vector
is 1.
So we can now understand that in order to minimize
, we have to select the smallest eigenvalue.
0 件のコメント:
コメントを投稿