# Point Cloud Segmentation from iPhone-Based LiDAR Sensors Using the Tensor Feature
## 3 Methodology
### Normal Vector Computation Based on Initial Tensor Encoding  
The normal vector of a point is the direction that is orthogonal to the direction of the structure. Suppose a \(d\)-dimensional geometric structure \(G\), which is embedded in the \(N\)-dimensional space \(S\) with \(N\) basis vectors \(\left(\overset{\rightarrow}{e}_{1},\overset{\rightarrow}{e}_{2},\cdots, \overset{\rightarrow}{e}_{N}\right)\). As depicted in the manifold theory, \(G\) is considered to be a manifold structure, with a \(d\)-dimensional normal subspace \(S_{d}\) and (\(N\)-\(d\))-dimensional tangent subspace \(S_{N-d}\), while the normal vector is considered to the basis vector \(\left(\overset{\rightarrow}{e}_{1},\overset{\rightarrow}{e}_{2},\cdots, \overset{\rightarrow}{e}_{d}\right)\) of the normal subspace \(S_{d}\), as shown in Equation (1). All kinds of structures of the point \(p\) of in \(G\) are encoded by the tensor of the normal subspace, ranging from 1-dimensional and 2-dimensional, to \(d\)-dimensional. In the 1-dimensional structure, the structure of \(G\) is considered to be a flat and continuous surface, and the normal space vector is considered to be a stick-shaped tensor. However, in the N-dimensional structure, the structure of \(G\) is considered to be a ball.  
\[S=S_{d}+S_{N-d},s.t.,S_{d}=\sum_{n=1}^{d}\overset{\rightarrow}{e}_{n}\overset {\rightarrow}{e}_{n}^{T},S_{N-d}=\sum_{n=d+1}^{N}\overset{\rightarrow}{e}_{n }\overset{\rightarrow}{e}_{n}^{T} \tag{1}\]  
However, there is no normal information explicitly represented in the original point cloud, and the normal vector needs to be encoded from the ball tensor, where the dimension \(d=N\). The initial tensor encoding is started from point \(p\) and its neighborhood \(\Omega\), which is consisted of \(k\) point except \(p\):  
1. arbitrarily pick up a point \(p_{i}\) from the neighborhood \(\Omega\), and compute the vector \(\overset{\rightarrow}{v}_{i}\) from \(p_{i}\) to \(p\), as shown in Equation (2), then normalize the vector \(\overset{\rightarrow}{v}_{i}\) as \(\vartheta_{i}\). \[\overset{\rightarrow}{v}_{i}=p-p_{i},p_{i}\in\Omega\] (2)
2. compute the tensor \(T_{i}\) of tangent subspace \(S_{N-d}\) using the Kronecker delta of \(\vartheta_{i}\) in Equation (2), and obtain the normal subspace \(S_{d}\), based on Equation (1). \[T_{i}=I-kron(\vartheta_{i},\vartheta_{i}^{T})\] (3)  
As shown in Equation (3), the \(N\)-dimensional space \(S\) can be represented by the identity matrix \(I\), since there is no preferred basis vector in the \(N\)-dimensional space.
3. gather the initial tensor from the neighborhood \(\Omega\), using the weight function \(w\) based on the vector \(\overset{\rightarrow}{v}_{i}\), as shown in Equation (4). The weight \(w\) is a Gaussian function \(\mathbf{w(s)}=\mathbf{e}^{-(\frac{s}{e})^{2}}\). \[\mathbf{T}=\sum_{i=1}^{i=k}\mathbf{w}\Big{(}\big{\|}\overset{\rightarrow}{v}_{i}\big{\|} \Big{)}\mathbf{T}_{i}\] (4) calculate eigenvectors \(\left(\overset{\rightarrow}{u}_{1},\overset{\rightarrow}{u}_{2},\cdots, \overset{\rightarrow}{u}_{N}\right)\) of the tensor \(T\) and choose the vector \(\overset{\rightarrow}{u}_{1}\) (as shown in Figure 2) with the largest eigenvalues as the normal vector of point \(p\)  
Figure 1: The workflow of the point cloud segmentation.  
Here \(p\) can be treated as a point in the surface, and \(\overrightarrow{u}_{1}\) is the 1-dimensional stick structure.