## 2 Materials and Methods
### Density Segmentation  
Previous research has shown that density segmentation is an effective tool for detecting objects that extend in one direction. It was applied to both objects extending vertically, such as trees or poles [34; 36], and horizontally, like a bridge construction [37]. The core idea of this approach involves using a parallel projection along the line of span to reduce spatial information to a 2D plane and subsequent analysis of the created planar object. However, in the considered context of belt conveyor inspection, the direct application of this approach is not sufficient. While the belt qualifies as an elongated object and this method can be applied directly to it, the idlers and their supports occupy small, confined areas. Therefore, detecting them through density segmentation requires a new approach, which is developed in this study. Observing industrial sites with belt conveyors and considering environment along the conveyor, objects may be categorized into 3 main groups: long objects, such as belts or protective barriers, which occupy most space along the considered line; periodic objects of similar shape, like idlers or pillars, and other objects that appear irregularly. The density graph, created with a parallel projection of 3D points to a plane along the selected line, is expected to reflect this categorization. It is expected to show high density for elongated objects, medium density for periodic objects, and low density for irregular ones. Moreover, the density for periodic objects should correspond to the distance between consecutive instances of those objects. The parameters that distinguish these three classes depend on the sensor resolution, placement relative to the objects, and the grid size used in the analysis. To exploit this property, the proposed solution uses 2D histograms representing the density of points. The histogram is constructed by a parallel projection of points onto a plane along a selected line. This plane is partitioned into a grid with square cells of size \(a\) and each cell in the histogram is associated with the number of points within it. Since the analyzed point cloud is the result of the alignment in the previous stage, the 3D points are projected along the main axes. Specifically, two projections are used: the top one along the Z axis and the front one along the X axis of the robot. The resulting 2D histograms are denoted as \(H_{XY}\) and \(H_{YZ}\), respectively. The \((i,j)\) cell of a histogram is given by  
\[ \begin{split} H_{XY}(i,j)=&\#\bigg{\{}\begin{pmatrix} x\\ y\end{pmatrix}=\begin{pmatrix}1&0&0\\ 0&1&0\end{pmatrix}P^{A}:(i-1)a\leq x<ia\wedge(j-1)a\leq y<ja\bigg{\}},\\ H_{YZ}(i,j)=&\#\bigg{\{}\begin{pmatrix}y\\ z\end{pmatrix}=\begin{pmatrix}0&1&0\\ 0&0&1\end{pmatrix}P^{A}:(i-1)a\leq y<ia\wedge(j-1)a\leq z<ja\bigg{\}},\end{split}  \tag{8}\]  
where \(\#\{\cdot\}\) denotes the number of elements in the set. Considering the shape of the idler frames, they are expected to appear as periodic objects in the \(H_{YZ}\) histogram and as locally elongated objects in the \(H_{XY}\) histogram. The first step of the density segmentation stage involves identifying objects that extend along the Z axis in the \(H_{XY}\) histogram, creating a set of point groups considered as idler candidates. The cells are classified to an idler candidate group if  
\[H_{XY}(i,j)-H_{XY}(i+b_{r},j)\geq b_{i}\qquad\text{and}\qquad H_{XY}(i,j)-H_{ XY}(i-b_{r},j)\geq b_{i},\]i.e., they establish a local maximum along the X axis with a number of points higher by at least \(b_{i}\) than the cells in \(b_{r}\) range. The second step entails processing \(H_{YZ}\) to find objects extended along the X axis and detect conveyor belts. Classification as an elongated object is done through thresholding, where points within cells satisfying \(H_{YZ}(i,j)>b_{th}\) constitute the set of elongated objects.