# A Fast Recognition Method for Dynamic Blasting Fragmentation Based on YOLOv8 and Binocular Vision
## 2 Materials and Methods
### Binocular Vision Measurement  
To obtain the actual fragmentation size of rocks in the image, it is first necessary to acquire the depth information of all pixels in the image. A monocular camera cannot provide depth information, whereas a binocular camera can capture depth data. A binocular camera analyzes image pairs captured by the left and right cameras to determine the disparity between corresponding points of the same object in both image planes [23]. Then, using the baseline distance between the two cameras and the intrinsic parameter matrix, it converts the disparity into depth information. The model for obtaining depth information using a binocular camera is shown in Figure 4. In this study, the binocular camera was calibrated to minimize calibration errors between the two lenses during use. After acquiring the depth information, the actual 3D coordinates of each pixel need to be determined based on the depth data. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Parameter** & **RGB Camera** & **Binocular Camera** \\ \hline Image sensor & IMX378 & OV9282 \\  & & 150\({}^{\circ}\)D/128\({}^{\circ}\)H/80\({}^{\circ}\)V \\ DFOV/HFOV/VFOV & 120\({}^{\circ}\)D/95\({}^{\circ}\)H/70\({}^{\circ}\)V & (RGBDAfter alignment \\  & & 106\({}^{\circ}\)D/97\({}^{\circ}\)H/70\({}^{\circ}\)V) \\ Resolution & 12 MP (4032 \(\times\) 3040) & 1 MP (1280 \(\times\) 800) \\ Maximum frame rate & 60 FPS & 120 FPS \\ Focal length & 4.81 & 2.35 \\ Aperture (F.NO) & 2.0 & 2.2 \\ Focusing range & FF:60 cm–\(\infty\) & AF:19.6 cm–\(\infty\) \\ Lens size & 1/2.3 & 1/4 \\ Distortion & \textless{}1.0\% & \textless{}1.5\% \\ Pixel size & 1.55 \(\upmu\)m \(\times\) 1.55 \(\upmu\)m & 3 \(\upmu\)m \(\times\) 3 \(\upmu\)m \\ Shutter & Rolling shutter & Global shutter \\ \hline \hline \end{tabular}
\end{table} 
Table 1: OAK-D-W-PoE binocular camera parameters. Figure 4: Binocular camera imaging model. Figure 3: On-site captured fragmentation distribution image. Figure 2: Fragmentation identification equipment: (**a**) gantry frame; (**b**) binocular camera; (**c**) industrial computer; (**d**) spotlight. Camera1 and Camera2 represent the center points of the left and right lenses of the binocular camera, and f is the focal length of both lenses. Starting from C1 and C2, vector lines perpendicular to the horizontal plane are drawn pointing towards the captured image, serving as reference lines (parallel lines) for the OAK-D-Pro-W-Poe optical axis direction. If the two black lines shown in Figure 4 represent the left and right imaging planes of the binocular camera (with equal length along the \(x\)-axis), the imaging point formed by P represents the actual spatial positions of the pixel points, which in the left and right imaging planes of the binocular camera are P1 and P2, respectively. If the distance between Camera1 and Camera2 is b, then the left boundary of the binocular camera's left and right imaging planes is the \(x\)-axis origin. The right direction is defined as the positive \(x\)-axis, with P1 and P2 having x coordinates _XL_ and _XR_ on the left and right imaging planes, respectively. The disparity is \(X\!L-XR\). Therefore, based on these considerations, to obtain the depth \(Z\) of the pixel point obtained by the binocular camera (i.e., the distance between the pixel point P and the plane formed by Camera1 and Camera2), a geometric distribution is formed between the triangle formed by P, P1, and P2 and the triangle formed by P, Camera1, and Camera2. The Formula (1) is then derived based on the principle of similar triangles. \[\left\{ \begin{array}{c}\frac{Z}{f}=\frac{X}{XL}\\ \frac{Z}{f}=\frac{Y}{YL}\\ \frac{Z}{f}=\frac{X-b}{XR}\\ XL-XR=d\end{array} \right., \tag{1}\]  
The calculation formula for the 3D coordinates is obtained from Equation (1) as follows:  
\[\left\{ \begin{array}{c}Z=\frac{f\!b}{d}\\ X=\frac{XL\!-\!Z}{f}\\ Y=\frac{YL\!-\!Z}{f}\end{array}