# Ore Rock Fragmentation Calculation Based on Multi-Modal Fusion of Point Clouds and Images
## 3 Ore Rock Fragmentation Calculation Method
### Watershed Segmentation  
First, the 2D Otsu method is utilized to compute the threshold value for the preprocessed image.  
\[T_{\text{B}}=\lambda\times\textit{Otsu}(I_{0}) \tag{13}\]  
where \(\textit{Otsu}\) represents the 2D Otsu method, with \(\lambda=0.5\) being the selected parameter. And then we employ \(T_{\text{B}}\) to threshold the image \(I_{0}\) according to the following procedure:  
\[\left\{\begin{aligned} & I_{0}(i,j)=255&& if\;I_{0}(i,j)\geq T_{\text{B}}\\ & I_{0}(i,j)=0&& if\;I_{0}(i,j)<T_{\text{B}}\end{aligned}\right. \tag{14}\]  
Thresholding is performed to remove a substantial portion of the background while minimizing its impact on the foreground rock blocks. Following this, small holes in the binary image are filled to mitigate their influence on the distance transformation. By extracting closed contours within the binary image and setting an area threshold, holes with enclosed contour areas smaller than the threshold are filled.  
Second, the binary ore rock image undergoes a morphological opening operation to reduce the level of adhesion between different rock blocks in the ore rock image. This operation involves applying the erosion operation to the binary image A using the structural element B, followed by a dilation operation. The calculation method can be described as follows:  
\[A\circ B=(A\Theta B)\oplus B \tag{15}\]  
Third, the distance transformation is conducted to compute the distance between foreground objects in a binary image and the closest background point. This operation transforms the binary image into a grayscale image that represents the corresponding distance values. Let us assume that the binary image contains a connected region with a target set \(O\) and a background set \(B\). The distance transformation formula for the distance map \(D\) can be expressed as follows:  
\[D(p)=\min(dis(p,q)),\;\;\;p\in O,\;\;\;q\in B, \tag{16}\]where _dis_ represents the distance function. In this study, the fast Euclidean distance transformation algorithm utilizing a \(5\times 5\) template is employed. The distance transformation image \(I_{d}\) of the ore rock binary image is depicted in Figure 4a. After thresholding, the foreground marker image is shown in Figure 4b.  
Finally, the Marker Watershed algorithm is used to segment different ore rock fragments. The watershed algorithm treats the gradient image as a topographic landscape, with pixel values representing terrain heights. Local minima in the gradient image correspond to catchment basins, while the pixel maxima surrounding the minima form the watershed boundary. The watershed algorithm can generate closed contours with a single-pixel width, which greatly facilitates the computation of rock fragment sizes.  
To address the issue of over-segmentation, the Marker Watershed algorithm incorporates marker control to eliminate spurious catchment basins. In this study, we refine the Marker Watershed algorithm by replacing the gradient image with the edge-enhanced SDM. The segmentation effectiveness of rock fragments using this modified Marker Watershed approach is depicted in Figure 5.