# Advanced Assistive Maintenance Based on Augmented Reality and 5G Networking
## 4 Scene Processing
### Mesh Simplification  
AR devices typically acquire significant amounts of 3D data, with environmental meshes easily counting tens (or even hundreds) of thousands of vertices. While the actual number of bits remains limited to a few megabytes and thus does not impair the required low latency, the computational complexity on the MEC side may increase rapidly and non-linearly with the number of 3D points. To prevent the formation of a bottleneck at the edge computing side, we added a preprocessing step that simplifies the received mesh before feeding it to the obstacle detection module. Mesh simplification consists of a class of algorithms that transform a given mesh into an approximated version with fewer vertices and faces. A variety of approaches have been proposed by the scientific community, addressing different application-specific quality criteria [31]. Our implementation falls within the _vertex clustering_ subclass [32], which is considered to be among the most efficient, once paying the price of removing small-shape details. While the spatial resolution \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline  & \multicolumn{3}{c}{**Mesh Parameters**} & \multicolumn{3}{c}{**Computation Time**} \\ \hline
**No.** & **No.** & **No. Reduced** & **No. Detected** & **Mesh Simplif.** & **Ground-Plane** & **Components** & **Total** \\
**Vertices** & **Triangles** & **Vertices** & **Obstacles** & **(ms)** & **(ms)** & **(ms)** & **(ms)** \\ \hline
1475 & 2414 & 518 & 1 & 25 & 8 & 6 & 39 \\
4855 & 7656 & 1419 & 7 & 52 & 20 & 10 & 82 \\
7928 & 12,764 & 2375 & 10 & 42 & 29 & \(<\)1 & 81 \\
9344 & 15,109 & 2914 & 10 & 33 & 32 & \(<\)1 & 75 \\
10,014 & 16,444 & 3054 & 14 & 39 & 35 & \(<\)1 & 88 \\
19,949 & 33,869 & 6164 & 9 & 64 & 61 & 1 & 125 \\
20,125 & 20,125 & 1828 & 6 & 38 & 60 & \(<\)1 & 98 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Measured computation times for scene-processing tasks, namely: mesh simplification, ground-plane extraction and objects detection (via connected components retrieval). The acquisition is sequential: the number of mesh vertices (first column) grows as the environment is being explored by the Head-Mounted Display (HDM). Thanks to mesh simplification, the overall computation time remains stable on average as the mesh size increases. of the original mesh is fundamental to the HMD for an accurate positioning of holograms in the real world, a rougher representation of the environment is more than enough for the task of detecting macroscopic obstacles. In Unity notation, a triangular mesh is an object \(M=(V,T)\), where \(V\) is an array of 3D vertices and \(T\) is a concatenation of triplets of vertex indices, denoting triangular faces. The proposed algorithm receives a triangular mesh, \(M\), and outputs a simplified version of the same, herein referred to as \(M^{\prime}=(V^{\prime},T^{\prime})\), with respect to a given quantization parameter, \(\delta\). The simplification procedure starts with quantizing the three-dimensional space into a lattice of cubes with \(\delta\)-sized edges. The algorithm then scans through the vertices in \(V\), retaining only one point per cube and keeping track of the discarded ones. Finally, new triangles are built by looping over \(T\) and remapping the indices of the removed vertices into those of the retained ones. A pseudocode representation is provided in Algorithm 1. Note that this implementation produces redundant copies of some triangular faces, which are deliberately _not_ removed from \(T^{\prime}\), since they do not impair Unity's performance and, therefore, would result in a waste of computational time. The simplified mesh \(M^{\prime}\) is now passed to the ground-plane extraction step.