Grooved pipe fitting installation quality judgment method based on image recognition

By acquiring images from multiple angles and inverting and matching grayscale distribution features with edge texture features, installation defects in grooved pipe fittings can be identified. This solves the problems of omission of obstructed areas and noise interference caused by single-angle acquisition in existing technologies, and enables accurate judgment of installation quality and precise output of defect locations.

CN121962129APending Publication Date: 2026-05-01WEIFANG XINGTONG MASCH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WEIFANG XINGTONG MASCH CO LTD
Filing Date
2026-02-11
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing image recognition-based methods for judging the installation quality of grooved pipe fittings mostly use single-angle image acquisition and extract only a single visual feature. This results in defects in occluded areas not being captured, single features being easily affected by reflected light and noise, leading to misjudgments, low recognition accuracy, and a lack of unified quantitative standards for defect type marking. Consequently, they cannot objectively calculate installation quality scores or provide accurate guidance on defect locations.

Method used

The system acquires grayscale images of the surface of the grooved pipe fitting to be inspected from multiple angles during installation, extracts grayscale distribution features and edge texture features for inversion matching, identifies abnormal pose contours, determines defect pixels by defect edge lines and contrast coefficients, marks defect types and scores installation quality using standard templates, and outputs defect locations.

Benefits of technology

It enables precise location and identification of installation defects in grooved pipe fittings, avoids defect blind spots from single-angle acquisition, reduces color redundancy and noise interference, provides a unified defect marking standard and quantitative quality score, and improves the accuracy of installation quality judgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121962129A_ABST
    Figure CN121962129A_ABST
Patent Text Reader

Abstract

The invention provides a grooved pipe fitting installation quality judgment method based on image recognition, and relates to the technical field of image recognition, and the method comprises the steps: collecting a multi-angle surface grayscale image of a to-be-detected grooved pipe fitting in an installation process; performing inversion matching on the gray level distribution characteristics and edge texture characteristics of each pixel point at the joint of the grooved pipe fittings, and identifying abnormal pose contours of connection of the grooved pipe fittings at multiple angles; determining defect pixel points in the installation defect area according to defect edge lines in all the edge texture features and defect comparison coefficients in the installation defect image, performing defect type marking on all the abnormal pose contours through the defect pixel points, and determining an installation quality score corresponding to each defect type according to all defect influence levels; and judging the installation quality of the grooved pipe fitting according to the installation quality score, and outputting a corresponding defect position when the installation quality is unqualified. According to the invention, the installation defects of the grooved pipe fitting can be positioned and identified, so that the accuracy of installation quality judgment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

A method for judging the installation quality of grooved pipe fittings based on image recognition Technical Field

[0001] This application relates to the field of image recognition technology, and more specifically, to a method for judging the installation quality of grooved pipe fittings based on image recognition. Background Technology

[0002] Image recognition is a technology that relies on computer vision to convert captured visual images of objects into analyzable digital signals. Through feature extraction and pattern matching, it identifies object attributes and defects. In the field of grooved pipe fitting installation quality inspection, this technology can acquire multi-angle surface images of pipe fittings, extract features such as grayscale distribution and edge texture at joints, and compare them with feature templates of standard qualified pipe fittings to accurately identify abnormal defects such as misalignment, tilting, and excessive gaps during pipe fitting installation. Compared to traditional manual visual inspection, which is highly subjective, inefficient, and has a high rate of missed detections, image recognition technology automates and standardizes the inspection process, providing reliable data support for the objective judgment of grooved pipe fitting installation quality.

[0003] However, existing image recognition-based methods for judging the installation quality of grooved pipe fittings mostly rely on single-angle image acquisition and extraction of only a single visual feature for matching. This makes it impossible to capture defects in obstructed areas at pipe joints, and single features are easily affected by reflected light and noise, leading to misjudgments. Consequently, the accuracy of abnormal pose contour recognition is low, and there is a lack of unified quantitative standards for defect type marking. As a result, it is impossible to objectively calculate the installation quality score, and it is difficult to provide accurate defect location guidance for rectification when the quality is unqualified. Therefore, how to locate and identify installation defects in grooved pipe fittings to improve the accuracy of installation quality judgment is a key challenge facing the industry. Summary of the Invention

[0004] This application provides a method for judging the installation quality of grooved pipe fittings based on image recognition, which can locate and identify installation defects in grooved pipe fittings to improve the accuracy of installation quality judgment.

[0005] Firstly, this application provides a method for judging the installation quality of grooved pipe fittings based on image recognition. The method includes: acquiring surface grayscale images of the grooved pipe fitting from multiple angles during installation; extracting grayscale distribution features at the connection points of the grooved pipe fitting from all surface grayscale images; performing inversion matching between the grayscale distribution features and the edge texture features of each pixel at the connection points of the grooved pipe fitting to identify abnormal pose contours of the grooved pipe fitting connection at multiple angles; determining defect pixels within the installation defect area based on the defect edge lines in all edge texture features and the defect contrast coefficient in the installation defect image; marking all abnormal pose contours with defect types using the defect pixels to obtain multiple defect influence levels; and determining the installation quality score corresponding to each defect type based on all defect influence levels; judging the installation quality of the grooved pipe fitting based on the installation quality score; and outputting the corresponding defect location when the installation quality is unqualified.

[0006] In this embodiment, the surface grayscale image refers to a surface image of a grooved pipe fitting that includes light and dark grayscale information and removes color redundancy.

[0007] In this embodiment, extracting the grayscale distribution features of the grooved pipe fitting connection from all surface grayscale images specifically includes: determining candidate regions for the grooved pipe fitting connection by multi-scale peak detection based on the global grayscale histogram of all surface grayscale images; determining the precise edge contour of the grooved pipe fitting connection by the local grayscale gradient flow field of the candidate regions; and performing feature encoding on the grayscale distribution within the precise edge contour to obtain the grayscale distribution features of the grooved pipe fitting connection.

[0008] In this embodiment, the abnormal pose contour refers to the contour region that, even after reverse twisting and alignment, cannot match the standard connected pose template.

[0009] In this embodiment, determining the defective pixels within the installation defect region based on the defective edge lines in all edge texture features and the defect contrast coefficient in the installation defect image specifically includes: spatially fusing the gradient direction field of the defective edge lines with the defect contrast coefficient to generate a defect probability density map and a multi-scale salient feature map; determining a candidate defective pixel set based on the defect probability density map; and performing confidence weighting on the candidate defective pixel set and the multi-scale salient feature map to obtain the defective pixels within the installation defect region.

[0010] In this embodiment, the defect edge line refers to the outline line extracted from the edge texture features that defines the boundary of the installation defect area.

[0011] In this embodiment, the defect contrast coefficient refers to a quantitative indicator of the degree of overlap between the edge line of the defect to be detected and the edge line of the standard defect in the installation defect image.

[0012] In this embodiment, the defect type labeling of all abnormal pose contours using the defect pixels to obtain multiple defect impact levels specifically includes: determining the contour coverage density and geometric distance distribution of the defect based on the spatial positional relationship between the defect pixels and all abnormal pose contours; performing clustering identification and labeling of defect types on all abnormal pose contours based on the contour coverage density and geometric distance distribution, combined with a predefined defect type feature template; and determining multiple defect impact levels based on the defect type labeling results and the degree of contour deformation at the defect.

[0013] In this embodiment, the installation quality score refers to the quantitative score used to determine whether the installation quality of the grooved pipe fittings is up to standard.

[0014] In this embodiment, the defect location refers to the specific spatial area where an installation defect is identified during the installation of the grooved pipe fitting.

[0015] The technical solution provided by the embodiments disclosed in this application has the following beneficial effects: acquiring surface grayscale images of the grooved pipe fitting to be inspected from multiple angles during installation; extracting grayscale distribution features of the grooved pipe fitting connection from all surface grayscale images, performing inversion matching of the grayscale distribution features with the edge texture features of each pixel at the grooved pipe fitting connection, and identifying abnormal pose contours of the grooved pipe fitting connection at multiple angles; determining defect pixels in the installation defect area based on the defect edge lines in all edge texture features and the defect contrast coefficient in the installation defect image, marking all abnormal pose contours with defect types through the defect pixels, obtaining multiple defect influence levels, and then determining the installation quality score corresponding to each defect type based on all defect influence levels; judging the installation quality of the grooved pipe fitting based on the installation quality score, and outputting the corresponding defect location when the installation quality is unqualified.

[0016] Therefore, this application demonstrates the ability to locate and identify installation defects in grooved pipe fittings. Specifically, multi-angle grayscale image acquisition comprehensively covers all key areas at the joints of the grooved pipe fittings, avoiding blind spots caused by single-angle photography. It also eliminates color redundancy and reduces interference from reflections and shadows, solving the problem of missed defects in obscured areas in existing single-angle acquisition methods. The inversion matching of grayscale distribution features and edge texture features, through dual-feature cross-validation, effectively eliminates misjudgments caused by noise interference from single features, accurately identifying abnormal pose contours from multiple angles, thus overcoming the low accuracy of existing single-feature matching. Defect pixels are determined based on defect edge lines and contrast coefficients, and standardized marking of defect types is achieved using standard templates. By quantifying the defect impact level and installation quality score, the application overcomes the shortcomings of existing technologies that lack unified standards for defect marking and cannot objectively quantify quality. Finally, quality judgment is made based on the installation quality score, and the precise defect location is output, achieving accurate determination of installation quality.

[0017] In summary, the technical solution adopted in this application can locate and identify installation defects in grooved pipe fittings, thereby improving the accuracy of installation quality assessment. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only for this embodiment of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 is an exemplary flowchart of an image recognition-based method for judging the installation quality of grooved pipe fittings according to this application; Figure 2 is a schematic flowchart of determining abnormal pose contours according to this application; Figure 3 is a schematic flowchart of determining installation quality scores according to this application. Detailed Implementation

[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0021] This application provides a method for judging the installation quality of grooved pipe fittings based on image recognition. The core of this method is to acquire surface grayscale images of the grooved pipe fitting from multiple angles during installation; extract grayscale distribution features at the connection points of the grooved pipe fitting from all surface grayscale images; perform inversion matching between the grayscale distribution features and the edge texture features of each pixel at the connection points to identify abnormal pose contours of the grooved pipe fitting connection at multiple angles; determine the defect pixels within the installation defect area based on the defect edge lines in all edge texture features and the defect contrast coefficient in the installation defect image; mark all abnormal pose contours with defect types using the defect pixels to obtain multiple defect influence levels; and then determine the installation quality score corresponding to each defect type based on all defect influence levels; judge the installation quality of the grooved pipe fitting based on the installation quality score, and output the corresponding defect location when the installation quality is unqualified.

[0022] To better understand the above technical solutions, the following will describe the above technical solutions in detail with reference to the accompanying drawings and specific implementation methods. Referring to Figure 1, this figure is an exemplary flowchart of an image recognition-based method for judging the installation quality of grooved pipe fittings according to this embodiment of the present application. The judgment method has the following steps: In step S1, surface grayscale images of the grooved pipe fitting to be tested are acquired from multiple angles during the installation process.

[0023] In practice, an image acquisition unit consisting of an industrial charge-coupled device (CCD) camera, a ring diffuse light source, and a three-jaw centering fixture is constructed. First, the trench pipe to be inspected is fixed on the three-jaw centering fixture. The fixture is adjusted so that the pipe's axis is perpendicular to the camera's shooting reference plane, ensuring the pipe's position remains stable and without deviation during the acquisition process. Four fixed shooting angles are preset: a front view along the pipe's axis, a top view perpendicular to the pipe's axis, and a 45° side view to the left and right of the pipe's axis. The shooting distance from each angle to the pipe's connection point is set to 30 cm. The brightness of the ring diffuse light source is adjusted to 5000 lumens, so that the light source's illumination angle forms a 30° angle with the surface of the pipe's connection point. To avoid interference from reflections and shadows, the industrial charge-coupled device camera is then activated to take pictures sequentially at a preset angle, acquiring a 2048×1536 pixel color image for each shot. Then, a weighted average method (grayscale value = red channel pixel value × 0.299 + green channel pixel value × 0.587 + blue channel pixel value × 0.114) is used to perform single-channel grayscale conversion on each color image, retaining key information on the brightness and darkness changes at the connection point. Finally, four surface grayscale images covering all key areas of the pipe fitting connection point are obtained. In other embodiments, other methods can also be used to acquire surface grayscale images, which are not limited here.

[0024] It should be noted that, in this application, the surface grayscale image refers to the surface image of the grooved pipe fitting that contains light and dark grayscale information and removes color redundancy.

[0025] In step S2, grayscale distribution features of the grooved pipe connection are extracted from all surface grayscale images. The grayscale distribution features are then inverted and matched with the edge texture features of each pixel at the grooved pipe connection to identify abnormal pose contours of the grooved pipe connection at multiple angles.

[0026] In this embodiment, the gray-level distribution features of the grooved pipe fitting connection can be extracted from all surface gray-level images in the following manner: candidate regions of the grooved pipe fitting connection are determined by multi-scale peak detection based on the global gray-level histogram of all surface gray-level images; the precise edge contour of the grooved pipe fitting connection is determined by the local gray-level gradient flow field of the candidate regions; and the gray-level distribution within the precise edge contour is feature-encoded to obtain the gray-level distribution features of the grooved pipe fitting connection.

[0027] In specific implementation, firstly, all pixel grayscale values ​​of all surface grayscale images are statistically analyzed, and the proportion of each grayscale value to the total number of pixels is calculated to construct a global grayscale histogram. Three Gaussian kernels with scale factors of 1, 2, and 3 are selected to smooth and filter the histogram, eliminating histogram fluctuations caused by image noise. Peak points of the histogram are identified at each scale, and grayscale intervals corresponding to the common peaks across the three scales are extracted. Pixel regions in the image whose grayscale values ​​fall within these intervals are marked as candidate regions, thus completing the determination of candidate regions. Then, for each pixel within a candidate region, the horizontal and vertical grayscale gradient values ​​are calculated using the Sobel horizontal and vertical operators respectively. The gradient magnitude is obtained through square root operation, and the gradient direction is obtained through the arctangent function, constructing the gradient vector for each pixel. Using pixels as nodes, the gradient vectors of adjacent pixels are connected based on the consistency of the gradient direction to form a local grayscale gradient flow field. A 15° gradient direction deviation threshold is set to filter pixels in the flow field with consistent directions and magnitudes greater than the threshold. The selected pixels are then connected sequentially to form a closed and precise edge contour. Finally, the region within the precise edge contour is divided into several equally sized pixel sub-blocks, and the gray-level mean, variance, and gray-level gradient difference of each sub-block are calculated. According to the row and column order of the sub-blocks within the contour, the mean, variance, and gradient difference of all sub-blocks are arranged sequentially to form an initial feature sequence. The initial feature sequence is normalized to eliminate the numerical differences between different sub-blocks. The normalized sequence is then converted into a feature vector of fixed length, which yields the gray-level distribution features at the grooved pipe fitting connection.

[0028] It should be noted that, in this application, the global grayscale histogram refers to the statistical spectrum of the proportion of each grayscale pixel value in all surface grayscale images; multi-scale peak detection refers to the method of identifying the peak value of the grayscale histogram at different scales; candidate region refers to the image region of the suspected grooved pipe fitting connection; local grayscale gradient flow field refers to the direction and amplitude distribution of the pixel grayscale gradient within the candidate region; precise edge contour refers to the boundary line that accurately defines the range of the grooved pipe fitting connection; and grayscale distribution characteristics refer to the feature set of the surface brightness variation law of the grooved pipe fitting connection.

[0029] Preferably, in this embodiment, the grayscale distribution features are inverted and matched with the edge texture features of each pixel at the grooved pipe connection to identify abnormal pose contours of the grooved pipe connection at multiple angles. Referring to Figure 2, which is a flowchart of determining abnormal pose contours in some embodiments of this application, the abnormal pose contours can be determined by the following steps in this embodiment: In step S21, a joint feature vector is constructed by the grayscale distribution features and the edge texture features of each pixel, and a multi-angle feature mapping space is established in the standard connection pose template library; In step S22, based on the joint feature vector and the multi-angle feature mapping space, the geometric transformation parameters from the current connection image to each standard connection pose template are determined by inverting using a differentiable spatial transformation network; In step S23, the current connection contour is reverse-distorted and aligned based on the geometric transformation parameters, and the unaligned abnormal contour segments are extracted; In step S24, the abnormal pose contours of the grooved pipe connection at multiple angles are determined by the abnormal distribution features of the abnormal contour segments.

[0030] In practice, firstly, the extracted grayscale distribution feature vector of the grooved pipe fitting connection and the edge texture feature vector are concatenated in dimensional order to obtain a joint feature vector whose dimension is the sum of the dimensions of the two. Then, 1000 sets of grid pipe fittings are selected from multi-angle surface grayscale images, and the corresponding joint feature vectors are extracted to construct a standard connection pose template library. The features in the template library are classified according to the shooting angle, and the mean vector and covariance matrix of the standard features under the same angle are calculated to establish a feature subspace corresponding to each angle. The subspaces of each angle are associated and integrated according to the shooting orientation to form a multi-angle feature mapping space covering all angles. Next, a differentiable spatial transformation network is constructed, comprising a feature extraction layer, a transformation parameter prediction layer, and a mesh generation layer. The joint feature vector to be detected is input into the feature extraction layer, which outputs a high-dimensional feature representation. The transformation parameter prediction layer takes this representation as input and outputs three types of geometric transformation parameters: translation, rotation, and scaling. Using the standard features of the multi-angle feature mapping space as a reference, a feature distance loss function is constructed. The network parameters are optimized through backpropagation to minimize the distance between the transformed feature and the standard feature. Iterative optimization continues until the loss function converges, at which point the output parameters are the geometric transformation parameters from the current connected image to the standard template. Then, based on the geometric transformation parameters, a bilinear interpolation algorithm is used to perform a reverse distortion transformation on the current connected contour, mapping the detected contour to the geometric space of the standard connected pose. The transformed contour and the standard connected pose template contour are extracted, and the matching degree between the two is calculated pixel by pixel, setting a matching degree threshold. Contour regions with a matching degree below the threshold are marked as unaligned regions, and the unaligned regions are segmented into independent contour segments, i.e., abnormal contour segments, according to the continuity of the contour. Finally, the abnormal distribution features such as position coordinates, length, and curvature of each abnormal contour segment are extracted; the abnormal contour segments of multi-angle images are transformed into a unified three-dimensional coordinate system, a spatial distance threshold is set, and segments with a distance less than the threshold are identified as repeated segments of the same abnormal region and removed; the remaining abnormal contour segments are integrated to form a continuous contour line; the integrated contour line is compared with the standard abnormal pose contour library to verify its morphological consistency, and finally the abnormal pose contour of the grooved pipe connection under multiple angles is determined.

[0031] It should be noted that, in this application, edge texture features are a set of features characterizing the geometric contour morphology, edge continuity, and curvature changes at the connection of grooved pipe fittings; inversion matching refers to a matching method that aligns the contour to be detected with the standard contour and identifies abnormal areas; joint feature vector refers to a high-dimensional vector that integrates grayscale distribution features and edge texture features; standard connection pose template library refers to a database that stores multi-angle connection pose features of qualified grooved pipe fittings; multi-angle feature mapping space refers to a set of standard feature mapping relationships constructed according to shooting angles; differentiable spatial transformation network refers to a deep learning network that realizes geometric transformation of feature space; the current connection image refers to the image of the grooved pipe fitting to be detected during installation, after being viewed from multiple angles. The image of the pipe fitting connection is captured and subjected to grayscale conversion and feature extraction. Geometric transformation parameters refer to the set of parameters describing the translation, rotation, and scaling relationship between the image to be detected and the standard template. The current connection contour refers to the edge contour of the grooved pipe fitting connection extracted from the current connection image. Reverse distortion alignment refers to the operation of correcting the shape of the contour to be detected to the contour of the standard template based on the geometric transformation parameters. Abnormal contour fragments refer to contour regions that still cannot match the standard template after reverse distortion alignment. Abnormal distribution features refer to the feature set of position, length, and curvature of abnormal contour fragments. Abnormal pose contours refer to contour regions that still cannot match the standard connection pose template after reverse distortion alignment.

[0032] In step S3, the defect pixels in the installation defect area are determined based on the defect edge lines in all edge texture features and the defect contrast coefficient in the installation defect image. The defect pixels are used to mark the defect types of all abnormal pose contours to obtain multiple defect impact levels. Then, the installation quality score corresponding to each defect type is determined by all the defect impact levels.

[0033] In this embodiment, determining the defective pixels within the installation defect region based on the defective edge lines in all edge texture features and the defect contrast coefficient in the installation defect image can be achieved through the following steps: spatial domain fusion of the gradient direction field of the defective edge lines and the defect contrast coefficient to generate a defect probability density map and a multi-scale salient feature map; determining a candidate defective pixel set based on the defect probability density map; and performing confidence weighting on the candidate defective pixel set and the multi-scale salient feature map to obtain the defective pixels within the installation defect region.

[0034] In specific implementation, firstly, the gradient direction of each pixel on the defect edge line is calculated to form a gradient direction field. This gradient direction is obtained by calculating the horizontal and vertical gradients using the Sobel operator and then applying the arctangent function. The defect contrast coefficient of each pixel is used as a weight and multiplied pixel-by-pixel with the gradient direction field to complete spatial domain fusion. The fusion result is smoothed using a Gaussian kernel to eliminate noise interference, resulting in a defect probability density map. Higher pixel values ​​in the map represent a greater probability of a defect. Three sets of Gaussian filter kernels of different sizes are selected to perform multi-scale filtering on the fusion result, extracting significant defect features at each scale and integrating them to form a multi-scale significant feature map. Then, statistical analysis is performed on 1000 sample images containing different types of defects to determine a defect probability threshold. This threshold must ensure that the false positive rate of qualified samples is less than 2%. Each pixel in the defect probability density map is traversed, and pixels with values ​​higher than the threshold are marked as suspected defect pixels. Based on the pixel's coordinate position in the image, all suspected defect pixels are organized into an ordered set, i.e., a candidate defect pixel set. Finally, the probability value of each pixel in the defect probability density map of the candidate defect pixel set is extracted as the basic confidence score, and the significance value of each scale in the multi-scale salient feature map is extracted and the average value is taken as the supplementary confidence score. The weights of the basic confidence score and the supplementary confidence score are set according to the sample validation results, and the sum of the two weights is 1. For each candidate pixel, the product of the basic confidence score and the corresponding weight, and the product of the supplementary confidence score and the corresponding weight are calculated and added together to obtain the weighted total score. A weighted total score threshold is set, which is determined by cross-validation of 500 defect samples and 500 authentic samples. Candidate pixels with a weighted total score higher than the threshold are judged as defect pixels.

[0035] It should be noted that, in this application, the defect edge line refers to the contour line extracted from edge texture features that defines the boundary of the installation defect area; the installation defect image refers to a standard sample image storing common installation defects of grooved pipe fittings; the defect contrast coefficient refers to a quantitative index of the degree of overlap between the edge line of the defect to be detected and the standard defect edge line in the installation defect image; spatial domain fusion refers to the operation of synergistically integrating gradient direction field information and contrast coefficient in the image spatial dimension; the installation defect area refers to a specific area where there is an installation defect at the connection of the grooved pipe fitting; the gradient direction field refers to the set of gradient direction distributions of all pixels of the defect edge line; the defect probability density map refers to the probability distribution map of each pixel in the image being a defect pixel; the multi-scale salient feature map refers to an image that highlights the features of defects of different sizes; the candidate defect pixel set refers to the set of suspected defect pixels selected from the defect probability density map; and the defect pixel refers to the basic pixel in the installation defect area that quantifies the defect area and morphological features.

[0036] In this embodiment, the defect type labeling of all abnormal pose contours using the defect pixels to obtain multiple defect impact levels can be achieved through the following steps: determining the contour coverage density and geometric distance distribution of the defect based on the spatial positional relationship between the defect pixels and all abnormal pose contours; clustering and labeling the defect types of all abnormal pose contours based on the contour coverage density and geometric distance distribution, combined with a predefined defect type feature template; and determining multiple defect impact levels based on the defect type labeling results and the degree of contour deformation at the defect.

[0037] In practical implementation, firstly, a two-dimensional local coordinate system is established with the center of the abnormal pose contour as the origin. The total number of defect pixels within the contour and the total number of pixels within the contour are counted, and the ratio of the two is calculated to obtain the contour coverage density. The vertical distance from each defect pixel to the contour edge is calculated, and the mean and variance of all distances are obtained to form a geometric distance distribution. Then, a defect type feature template library is constructed, and standard features of contour coverage density and geometric distance distribution of common defects such as excessive gaps, exposed sealing rings, and misaligned pipes are entered. The K-means clustering algorithm is used, taking the density and distance features of the abnormal pose contour to be detected as input, and using the features in the template library as cluster centers, the Euclidean distance between the feature to be detected and each cluster center is calculated. The feature to be detected is assigned to the cluster category with the smallest distance, matching the corresponding defect type and completing the labeling. Finally, the ratio of the overlapping area between the abnormal pose contour and the standard connection contour is calculated, and the difference between the overlapping area ratio and 1 is taken as the degree of contour deformation. Weight coefficients are set according to the defect type, with the defect weight of critical sealing areas being higher than that of non-critical areas. Grading rules are formulated, and the comprehensive impact value is calculated by combining the defect type weight and the degree of contour deformation. 800 sets of samples are selected for cross-validation to determine the corresponding interval between the comprehensive impact value and the defect impact level, which is divided into three levels: slight, moderate, and severe.

[0038] It should be noted that in this application, defect type labeling refers to the operation of assigning a corresponding defect category to each abnormal pose contour; contour coverage density is a quantitative index characterizing the density of defect pixels within the abnormal pose contour; geometric distance distribution refers to the statistical result of the distance from defect pixels to the edge of the abnormal pose contour; defect type feature template refers to a standard template library that stores the contour coverage density and geometric distance distribution features of common defects in grooved pipe fittings; contour deformation degree refers to the quantitative value of the morphological deviation between the abnormal pose contour and the standard connection contour; and defect impact level refers to the level standard that quantifies the degree of impact of defects on installation quality.

[0039] Preferably, in this embodiment, the installation quality score corresponding to each defect type is determined by all defect impact levels. Referring to Figure 3, which is a flowchart illustrating the process of determining the installation quality score in some embodiments of this application, the installation quality score can be determined in this embodiment using the following steps: In step S31, a defect mapping rule is constructed based on all defect impact levels and associated defect types, and the initial weight coefficient for each defect type is calculated; in step S32, the currently detected defect instances are matched item by item using the defect mapping rule to obtain a weighted deduction value; in step S33, the cumulative defect deduction value is determined based on the spatial distribution density of the weighted deduction value in a single contour and the overall image; in step S34, the installation quality score corresponding to each defect type is determined based on the cumulative defect deduction value and the initial weight coefficient.

[0040] In practice, the process begins by collecting measured data on 1000 sets of grooved pipe fitting installation defects. These defects are categorized by type (excessive gaps, exposed sealing rings, etc.) and impact level (minor, moderate, severe). The frequency of installation failures caused by different defect categories is statistically analyzed, and defect mapping rules are constructed to define the basic deduction values ​​corresponding to different type-level combinations. Using the analytic hierarchy process (AHP), the initial weight coefficients for each defect type are calculated based on the degree of impact on sealing performance and structural stability. The initial weight coefficients range from 0.1 to 0.8, with the coefficients for critical sealing defects being higher than those for structural defects. Next, all detected defect instances are retrieved, and the defect type and corresponding impact level of each instance are extracted. Based on the defect mapping rules, the basic deduction value for each defect instance is obtained. Finally, the basic deduction value is multiplied by the initial weight coefficient corresponding to the defect type to obtain the weighted deduction value for a single defect instance. Then, the ratio of the number of defects to the area of ​​a single abnormal pose contour is calculated to obtain the spatial distribution density of defects in a single contour; the ratio of the number of all defect instances in the overall image to the effective detection area of ​​the image is calculated to obtain the overall distribution density; a distribution density correction coefficient is set, which is greater than 1 when the density is higher than the mean of the sample statistics, and less than 1 otherwise; the weighted deduction values ​​of each defect instance are accumulated and multiplied by the corresponding distribution density correction coefficient to obtain the total cumulative defect deduction value. Finally, the method for setting the full score for installation quality is as follows: 1000 sets of grooved pipe fitting samples and 800 sets of unqualified pipe fitting samples covering all preset defect types and three defect impact levels (minor, moderate, and severe) are selected. All samples are manually inspected to confirm their quality status. Based on the established defect mapping rules and initial weight coefficients, the cumulative defect deduction value for a single set of pipe fittings with the most extreme defect combination is calculated. The full score for installation quality is initially set as an integer greater than this maximum theoretical deduction value, reserving a score redundancy space to avoid negative final scores. The initially set full score is then substituted into the scoring system for 1800 sets of samples. Batch scoring is conducted. If the scoring ranges of qualified and unqualified samples overlap, the full score is adjusted and re-verified until the scoring ranges of the two types of samples are completely distinguishable. After more than three rounds of cross-verification, once it is confirmed that the full score can stably distinguish between qualified and unqualified pipe fittings, this value is solidified as the full score for installation quality. The total accumulated defect deductions are subtracted from the full score for installation quality to obtain the preliminary quality score. The weighted deductions are categorized and summarized according to defect type, and the proportion of the deduction for each defect type to the total accumulated deductions is calculated. The preliminary quality score is multiplied by this proportion and the corresponding initial weight coefficient to obtain the installation quality score corresponding to each defect type.

[0041] It should be noted that in this application, the defect mapping rule refers to the set of rules that associate the defect impact level, defect type, and basic deduction value; the initial weight coefficient refers to the weight value set based on the degree of influence of the defect type on the installation quality; the defect instance refers to a single defect object with a clear defect type and defect impact level that is currently detected in the installation quality inspection of grooved pipe fittings; the weighted deduction value refers to the product of the basic deduction value of the defect instance and the corresponding initial weight coefficient; the spatial distribution density refers to the distribution density index of defect instances in a single abnormal pose contour or the overall image; the cumulative defect deduction total value refers to the total deduction value obtained by combining the weighted deduction values ​​of all defect instances and the spatial distribution density correction value; and the installation quality score refers to the quantitative score for determining whether the installation quality of grooved pipe fittings is qualified.

[0042] In step S4, the installation quality of the grooved pipe fittings is judged based on the installation quality score, and the corresponding defect location is output when the installation quality is unqualified.

[0043] In specific implementation, the installation quality of grooved pipe fittings is judged based on the installation quality score, and the corresponding defect location is output when the installation quality is unqualified. This can be achieved in the following way: First, based on the score distribution range of 1800 grids and unqualified grooved pipe fitting samples, an installation quality qualification threshold is set to ensure that the scores of qualified samples are all higher than the threshold and the scores of unqualified samples are all lower than the threshold. Then, the calculated installation quality score of the grooved pipe fitting is compared with the qualification threshold. If the score is greater than or equal to the qualification threshold, the installation quality of the grooved pipe fitting is judged to be qualified, and a detection report containing the installation quality score and minor defect type is generated. If the score is less than the qualification threshold, the installation quality is judged to be unqualified. The currently detected defect type, the corresponding abnormal pose contour three-dimensional coordinates (a three-dimensional coordinate system with the intersection of the pipe fitting axis and the connection point as the origin, the axis direction as the Z-axis, the horizontal direction as the X-axis, and the vertical direction as the Y-axis) and the defect pixel distribution range are associated and integrated to generate a defect location report containing the defect type, impact level, and specific three-dimensional coordinate range. This will not be elaborated here.

[0044] It should be noted that, in this application, the defect location refers to the specific spatial area where an installation defect is identified during the installation of the grooved pipe fitting.

[0045] Therefore, this application demonstrates the ability to locate and identify installation defects in grooved pipe fittings. Specifically, multi-angle grayscale image acquisition comprehensively covers all key areas at the joints of the grooved pipe fittings, avoiding blind spots caused by single-angle photography. It also eliminates color redundancy and reduces interference from reflections and shadows, solving the problem of missed defects in obscured areas in existing single-angle acquisition methods. The inversion matching of grayscale distribution features and edge texture features, through dual-feature cross-validation, effectively eliminates misjudgments caused by noise interference from single features, accurately identifying abnormal pose contours from multiple angles, thus overcoming the low accuracy of existing single-feature matching. Defect pixels are determined based on defect edge lines and contrast coefficients, and standardized marking of defect types is achieved using standard templates. By quantifying the defect impact level and installation quality score, the application overcomes the shortcomings of existing technologies that lack unified standards for defect marking and cannot objectively quantify quality. Finally, quality judgment is made based on the installation quality score, and the precise defect location is output, achieving accurate determination of installation quality.

[0046] In summary, the technical solution adopted in this application can locate and identify installation defects in grooved pipe fittings, thereby improving the accuracy of installation quality assessment.

[0047] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.

[0048] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compactdisc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.

[0049] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

Claims

1. A method for judging the installation quality of grooved pipe fittings based on image recognition, characterized in that, The determination method includes: acquiring surface grayscale images of the grooved pipe fitting to be inspected from multiple angles during installation; extracting grayscale distribution features of the grooved pipe fitting connection from all surface grayscale images; performing inversion matching of the grayscale distribution features with the edge texture features of each pixel at the grooved pipe fitting connection to identify abnormal pose contours of the grooved pipe fitting connection at multiple angles; determining the defect pixels in the installation defect area based on the defect edge lines in all edge texture features and the defect contrast coefficient in the installation defect image; marking all abnormal pose contours with defect types using the defect pixels to obtain multiple defect influence levels; determining the installation quality score corresponding to each defect type based on all defect influence levels; judging the installation quality of the grooved pipe fitting based on the installation quality score; and outputting the corresponding defect location when the installation quality is unqualified.

2. The method for judging the installation quality of grooved pipe fittings based on image recognition as described in claim 1, characterized in that, The aforementioned surface grayscale image refers to a surface image of a grooved pipe fitting that contains light and dark grayscale information and removes color redundancy.

3. The method for judging the installation quality of grooved pipe fittings based on image recognition as described in claim 1, characterized in that, Extracting the grayscale distribution features of the grooved pipe fitting connection from all surface grayscale images specifically includes: determining candidate regions for the grooved pipe fitting connection through multi-scale peak detection based on the global grayscale histogram of all surface grayscale images; determining the precise edge contour of the grooved pipe fitting connection through the local grayscale gradient flow field of the candidate regions; and performing feature encoding on the grayscale distribution within the precise edge contour to obtain the grayscale distribution features of the grooved pipe fitting connection.

4. The method for judging the installation quality of grooved pipe fittings based on image recognition as described in claim 1, characterized in that, The abnormal pose contour refers to the contour region that, even after reverse twisting and alignment, cannot match the standard connected pose template.

5. The method for judging the installation quality of grooved pipe fittings based on image recognition as described in claim 1, characterized in that, Determining defective pixels within an installation defect region based on the defect contrast coefficient between defective edge lines in all edge texture features and defects in the installation defect image specifically includes: spatially fusing the gradient direction field of the defective edge lines with the defect contrast coefficient to generate a defect probability density map and a multi-scale salient feature map; determining a candidate defective pixel set based on the defect probability density map; and obtaining the defective pixels within the installation defect region by weighting the candidate defective pixel set with the multi-scale salient feature map based on confidence.

6. The method for judging the installation quality of grooved pipe fittings based on image recognition as described in claim 1, characterized in that, The defect edge line refers to the outline line extracted from edge texture features that defines the boundary of the installation defect area.

7. The method for judging the installation quality of grooved pipe fittings based on image recognition as described in claim 1, characterized in that, The defect contrast coefficient refers to a quantitative indicator of the degree of overlap between the edge line of the defect to be detected and the edge line of the standard defect in the installation defect image.

8. The method for judging the installation quality of grooved pipe fittings based on image recognition as described in claim 1, characterized in that, The defect type labeling of all abnormal pose contours using the defect pixels to obtain multiple defect impact levels specifically includes: determining the contour coverage density and geometric distance distribution of the defect based on the spatial positional relationship between the defect pixels and all abnormal pose contours; performing defect type clustering identification and labeling on all abnormal pose contours based on the contour coverage density and geometric distance distribution, combined with a predefined defect type feature template; and determining multiple defect impact levels based on the defect type labeling results and the degree of contour deformation at the defect.

9. The method for judging the installation quality of grooved pipe fittings based on image recognition as described in claim 1, characterized in that, The installation quality score refers to the quantitative score used to determine whether the installation quality of grooved pipe fittings is up to standard.

10. The method for judging the installation quality of grooved pipe fittings based on image recognition as described in claim 1, characterized in that, The defect location refers to the specific spatial area where installation defects are identified during the installation of grooved pipe fittings.