## 3 Our Implementation
### Filters  
The generated set of candidates may be unnecessarily large, slowing down the NBV process. Discarding unpromising or redundant candidate views prior to computationally expensive evaluation is a common strategy to enhance NBV efficiency [20]. Such filtering techniques often rely on various criteria, including evaluating the expected information gain against certain thresholds or metrics [5; 20] assessing visibility and required overlap, or  
Figure 2: Selection of candidate direction using the potential field. reducing spatial redundancy among candidates. The aim of filtering stages in our method is to remove possible clusters of candidates and those candidates pointing primarily towards already explored space. The order of our filters is chosen such that computationally cheaper checks are performed first, reducing the set processed by slower evaluations. 1. Out of Range Filter (ORF)  
The first filter removes the candidates that are out of reach of the robot by calculating the Euclidean distance (5) from the robot base: \[L_{2}\big{(}q,q^{\prime}\big{)}=\sqrt{(x_{1}-x_{2})^{2}+(y_{1}-y_{2})^{2}+(z_ {1}-z_{2})^{2}}\] (5)
2. Position Threshold Filter (PTF)  
The second filter, the Position Threshold Filter (PTF), aims to prune the set of new candidates by removing those that are redundant. A candidate is considered redundant if it is too close in both position and orientation to a candidate that has already been accepted. This prevents the planner from evaluating dense clusters of near-identical views. To do this efficiently, we maintain a set of accepted, non-redundant candidates. For each new candidate, we check if it lies within a distance threshold of any accepted candidate. If it does, we also check if its orientation is significantly different. A new candidate is only accepted if it is either far away from all existing candidates or, if it is nearby, it offers a sufficiently novel orientation. To accelerate the spatial proximity search, the positions of accepted candidates are stored in a k-d tree [21], which allows for near-constant time lookups. This process is detailed in Algorithm 2. ```
1. C: Set of existing candidates (empty at the beginning of mapping) \(\overset{\rightarrow}{t}_{i}\): Position vector of candidate \(c_{i}\) from \(C\) tree: k-d tree, contains \(\overset{\rightarrow}{t}_{i}\) \(r\): Minimal distance between candidates \(P_{i}\), \(P_{n}\): Transformation matrices of \(c_{i}\) and \(c_{n}\) candidates
2. Generate set of new candidates \(C_{n}\)
3. For\(c_{n}\) with \(\overset{\rightarrow}{t}_{n}\)in\(C_{n}\)do (iterate through each new candidate)
4. In tree find positions such that \(\Big{|}\Big{|}\overset{\rightarrow}{t}_{i}-\overset{\rightarrow}{t}_{n} \Big{|}\Big{|}<r\)
5. For each \(c_{i}\)do
6. \(\Delta P_{i}=P_{i}{}^{-1}P_{n}\) (calculate the relative pose transformation)
7. Extract \(\Delta\varphi_{i}\) from \(\Delta P_{i}\) (extract the angular difference)
8. If no position is found or all \(\Delta\varphi_{i}>\) threshold then
9. \(C\gets c_{n}\) (add candidate to the list)
10. tree \(\leftarrow\)\(t_{n}\) (update k-d tree)
```  
**Algorithm 2** Position Threshold Filter  
The computations for \(P_{i}\), \(\Delta P_{i}\), and \(\Delta\varphi_{i}\) are referenced in [22]. 3. Information gain filter (IGF)  
A filter based on information gain can be used at the final stage to assess whether a candidate can explore enough unknown space. The information gain expresses the ratio of the known to the unknown environment in a given camera view. A greater value means that the candidate can potentially search more space. The calculation of the information gain in this proposed NBV algorithm is based on collision detection [5]. The intersection of the scanned space with an unknown environment is calculated. The process of collision detection is shown in Figure 3, where the green arrow represents the camera view, the potentially scanned space is indicated in yellow, the gray cells represent the unknown space, and the white cells represent the searched space.