# Target Detection Technology of Mechanical, Electrical, and Plumbing Components Based on CV
## 4 Results
### Contour Comparison  
Section 4.5 demonstrated that the pipeline contours extracted from the construction photographs and BIM projections clearly illustrated the shape and structure of the pipelines. This section identifies and compares the differences between these two sets of extracted contours and reveals the discrepancies between the actual construction and the design model. We used Hu moments to describe the shapes of the extracted contours and quantify their differences. The smaller the difference, the higher their consistency. Based on this analysis, we effectively assessed the construction quality, verified whether the construction results complied with the design specifications of the BIM, and provided accurate technical support for construction monitoring and quality assurance.  
In image processing and computer vision, Hu moments [34] are a set of feature descriptors used to describe the shape and contour of images. Hu moments are invariant to geometric transformations, such as rotation, scaling, and translation, making them suitable for shape and pattern recognition. They are derived from an image's second-order and central moments through mathematical transformations. Seven independent Hu moments exist, known as Hu invariant moments, which can capture the geometric features of image contours by calculating the image's normalized central moments. Their mathematical formulation is based on the normalized central moments of an image. Specifically, given a binary image \(I(x,y)\), the normalized central moments are as follows:  
\[\mu_{pq}=\sum_{x}\sum_{y}(x-\bar{x})^{p}(y-\bar{y})^{q}I(x,y) \tag{8}\]  
Figure 6: Contour comparison.  
where \(\bar{x}\) and \(\bar{y}\) are the coordinates of the image's centroid:  
\[\bar{x}=\frac{\sum_{x}\sum_{y}xI(x,y)}{\sum_{x}\sum_{y}I(x,y)} \tag{9}\]  
\[\bar{y}=\frac{\sum_{x}\sum_{y}yI(x,y)}{\sum_{x}\sum_{y}I(x,y)} \tag{10}\]  
Based on the normalized central moments, the normalized moments can be calculated as follows:  
\[\eta_{pq}=\frac{\mu_{pq}}{\mu_{00}^{(1+\frac{pq}{2})}} \tag{11}\]  
where \(\mu_{00}\) is the zero-order moment (the total mass or area of the image).  
This study used the Hu moments matching method to identify discrepancies between design drawings and actual construction. We conducted a Hu moments matching analysis of the previously extracted contour features. To ensure the broad applicability and representativeness of the experiment, we constructed and analyzed five different models, each corresponding to 50 on-site construction photos, successfully extracting approximately 1000 pipe contours from a total of 250 images.  
The experimental results indicate that, when the threshold for the Hu moments difference is 0.01, the matching algorithm attains an accuracy of up to 95.4%, confirming the efficiency and accuracy of the Hu moments matching method in identifying construction deviations. Hence, the proposed strategy provides a reliable technical means for construction quality control and monitoring, which accurately assesses the consistency between construction results and the original design, offering robust data support for subsequent engineering management and decision-making.