# Sewer Cleaning Robot: A Visually Assisted Cleaning Robot for Sewers
## 4 Results of Experiments and Discussions
### Monocular Vision Defect Detection and Localization Experiment  
In the monocular vision defect detection experiment, defects from the Pipeline Computer Vision Project dataset were identified using the YOLOv5-Sewer lightweight model, which has been optimized for in-pipe environments. The detection results are illustrated in Figure 10. All six pipeline defects within the dataset were successfully recognized, demonstrating effective detection performance even in complex environments.  
In the target localization experiments, the camera is initially calibrated to determine its intrinsic parameters and distortion coefficients. The calibration was performed using  
Figure 10: Defect detection model test results.  
Figure 9: Mobile platform crossing test.  
the OpenCV library calibration function. The resulting intrinsic matrix is presented as Equation (18), and the distortion coefficients are given in Equation (19).  
\[K_{0}=\left[\begin{array}{ccc}f_{x}&0&c_{x}\\ 0&f_{y}&c_{y}\\ 0&0&1\end{array}\right]=\left[\begin{array}{ccc}579.9844&0&315.8443\\ 0&582.27447&240.6151\\ 0&0&1\end{array}\right] \tag{18}\]  
\[D_{0}=\left[\begin{array}{ccc}k_{1}&k_{2}&p_{1}&p_{2}&k_{3}\end{array}\right] =\left[\begin{array}{ccc}0.15539&-0.38861&0.00446&6.574\times 10^{-4}&0.29998 \end{array}\right] \tag{19}\]  
Figure 11 represents the ORB feature point matching of two images taken at different moments. The RANSAC algorithm is used to compute the fundamental matrix, and the wrong matching points are automatically eliminated. Fundamental matrix is solved as Equation (20).  
\[F_{1}=\left[\begin{array}{ccc}0&0&0.0044\\ 0&0&-0.0142\\ -0.0068&0.0096&1\end{array}\right] \tag{20}\]  
Using the camera intrinsic matrix \(K_{0}\) and the fundamental matrix \(F_{1}\) from Equation, the essential matrix \(E_{1}\) can be derived as shown in Equation (21).  
\[E_{1}=\left[\begin{array}{ccc}0.506&-14.761&-3.265\\ 15.982&-0.285&0.305\\ 2.901&-2.537&-0.496\end{array}\right] \tag{21}\]  
The essential matrix is decomposed using the cv2.recoverPose function to obtain the rotation matrix \(R_{1}\) and translation vector \(t_{1}\), as represented by Equation (22) and Equation (23), respectively.  
\[R_{1}=\left[\begin{array}{ccc}0.9899&0.0262&-0.1391\\ -0.0201&0.9987&0.0458\\ 0.1401&-0.0426&0.9892\end{array}\right] \tag{22}\]  
\[t_{1}=\left[\begin{array}{ccc}0.1636&0.1712&-0.9715\end{array}\right] \tag{23}\]  
The projection matrix for the two frames is constructed using the camera intrinsic parameters and the positional transformation data. Subsequently, triangulation is employed to determine the target depth in the current camera coordinate system, calculated to be 44.3 cm, with the actual distance being 45 cm. Multiple localization calculations were conducted by varying the distance. The experimental results are depicted in Figure 12. The monocular visual localization system demonstrates good performance at short to medium distances, achieving the highest accuracy at 75 cm.  
Figure 11: Using Canny edge detection (**a**) with ORB feature matching (**b**).  
However, the error increases as the distance grows. Measurement accuracy at longer distances requires further optimization. Additionally, the impact of various environmental factors on measurement accuracy must be considered in practical applications.