## 3 Methodology
### Feature Descriptor Generation
#### 3.2.1 Covariance Matrix Descriptor  
In probability theory and statistics, covariance is a measure of the joint variability of two random variables, and it is used as a descriptor in image processing. A set of random variables relates to a set of observable properties that may be detected from a keypoint and its neighborhood in the context given by the covariance matrix descriptor, such as normal values, curvature values, 3D coordinates, and so on. As a result, the first step of generating  
Figure 2: Distribution of a boundary and a non-boundary point with their neighboring points.  
a covariance matrix descriptor is to construct a variable selection function \(\mathcal{O}(p,r)\) for a given keypoint p as shown below.  
\[\mathcal{O}(p,r)=\left\{\varphi_{p_{i}},\forall p_{i}\,s.t.|p-p_{i}|\leq r\right\} \tag{12}\]  
where \(p_{i}\) is a neighboring point of p, \(\varphi_{p_{i}}\) is a random variable feature vector obtained between p and each of its neighboring points, and r is the support radius of the neighborhood of p.  
To make selected random variables in the feature vector robust to noise and invariant to rigid transformation, these random variables should be computed relative to the keypoint p. As a result, we define \(\varphi_{p_{i}}\) as follows:  
\[\varphi_{p_{i}}=\left(\cos(\alpha(p_{i}p)),\cos(\beta(p_{i}p)),\cos(\gamma(p_{ i}p)),\vartheta(p_{i}p),\lambda_{1}(p_{i}p),\lambda_{2}(p_{i}p),\lambda_{3}(p_{ i}p)\right)^{T} \tag{13}\]  
where \(cos(\alpha(p_{i}p))\) represents the cosine between the segment from p to \(p_{i}\) and the normal vector n of p; \(cos(\beta(p_{i}p))\) represents the cosine between the segment from p to \(p_{i}\) and the normal vector \(n_{i}\) of \(p_{i}\); \(cos(\gamma(p_{i}p))\) represents the cosine between the normal vector \(n_{i}\) of \(p_{i}\) and the normal vector n of p; \(\vartheta(p_{i}p)\) represents the surface variation gradient between p and \(p_{i}\); and \(\lambda_{1}(p_{i}p),\lambda_{2}(p_{i}p)\), and \(\lambda_{3}(p_{i}p)\) represent the gradient of eigenvalue variation of two covariance matrices constructed by two neighborhoods centered at p and \(p_{i}\), respectively. It should be noted that we utilize the cosine rather than the angle of \(\alpha(p_{i}p),\beta(p_{i}p),\) and \(\gamma(p_{i}p)\) to save computation time. From (14) to (20), the calculation formulae are provided, and the three geometric relations \(\alpha(p_{i}p),\)\(\beta(p_{i}p),\) and \(\gamma(p_{i}p)\) are shown in Figure 3.  
\[\cos(\alpha(p_{i}p))=\frac{(p_{i}-p)\cdot n_{i}}{\|\left(p_{i}-p\right)\|} \tag{14}\]  
\[\cos(\beta(p_{i}p))=\frac{(p_{i}-p)\cdot n}{\|\left(p_{i}-p\right)\|} \tag{15}\]  
\[\cos(\gamma(p_{i}p))=n_{i}\cdot n \tag{16}\]  
\[\vartheta(p_{i}p)=\vartheta_{p_{i}}-\vartheta_{p} \tag{17}\]  
\[\lambda_{1}(p_{i}p)=\lambda_{1}(p_{i})-\lambda_{1}(p) \tag{18}\]  
\[\lambda_{2}(p_{i}p)=\lambda_{2}(p_{i})-\lambda_{2}(p) \tag{19}\]  
\[\lambda_{3}(p_{i}p)=\lambda_{3}(p_{i})-\lambda_{3}(p) \tag{20}\]  
where (\(\cdot\)) represents the dot product between two points and \(\|\cdot\|\) represents the Euclidean distance between two points.  
Figure 3: Geometric relations \(\alpha\), \(\beta\), and \(\gamma\) between a keypoint \(p\) and one of its neighboring points.  
Following the definition of a variable selection function \(\mathcal{O}(p,r)\) for the keypoint \(p\), the covariance matrix descriptor of a keypoint \(p\) is defined as follows:  
\[C_{r}(\varnothing(p,r))=\frac{1}{N}\sum_{i=1}^{N}\Big{(}\varphi_{p_{i}}-u_{ \varphi_{p_{i}}}\Big{)}\Big{(}\varphi_{p_{i}}-u_{\varphi_{p_{i}}}\Big{)}^{T} \tag{21}\]  
where \(N\) represents the number of neighboring points of \(p\) within its support radius \(r\) and \(u_{\varphi_{p_{i}}}\) is the mean of these vectors. Our proposed feature descriptor offers a more flexible representation since it considers 3D points as samples of a distribution and, by construction, subtracts the mean of this sample distribution; therefore, in case of noise, it will be naturally attenuated.