Quality detection method for highway engineering construction pipe
By acquiring grayscale images of pipes and utilizing Otsu thresholding and sliding window analysis, combined with contrast matrix and light absorption amplitude, pitting defects on the pipe surface are identified, solving the problems of low detection efficiency and low accuracy in existing technologies, and realizing automated and adaptive quality inspection.
Patent Information
- Application Number
- CN202511337352.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-18
- Publication Date
- 2025-12-19
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing methods for inspecting the quality of pipe materials used in highway construction rely on manual visual inspection, which is inefficient and easily affected by human factors. Furthermore, the parameter settings of superpixel segmentation algorithms lack adaptability, resulting in poor inspection results and failing to effectively address the issue.
Image processing technology is used to acquire grayscale images of pipes. Otsu thresholding and sliding window analysis are then used, combined with contrast matrix and light absorption amplitude, to identify pitting defects on the pipe surface and construct a saliency map of pitting depressions for segmentation.
It enables efficient and accurate identification of pitting defects on pipe surfaces, providing an automated and adaptive quality inspection method that improves inspection accuracy and the reliability of the production process.
Smart Images

Figure CN121169879A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image data processing, in particular to a quality detection method for highway engineering construction pipes. BACKGROUND
[0002] With the continuous advancement of infrastructure construction, especially the large-scale development of highway engineering, plastic pipes have been widely used in water supply, irrigation, communication, and chemical fluid transportation (such as strong acid and strong base) due to their corrosion resistance, lightness, and easy installation. Highway engineering construction pipes, as an important type, directly affect the safety, reliability, and service life of the project.
[0003] However, during the production process, the quality control of highway engineering construction pipes faces many challenges. For example, improper temperature control during processing can cause pipe brittleness, resulting in surface pitting and other defects. These defects not only affect the appearance of the pipe, but more importantly, they significantly reduce its structural strength and service life, increasing the risk of project operation.
[0004] Traditional quality detection methods mainly rely on manual visual inspection, which is inefficient and easily affected by human factors, making it difficult to meet the needs of modern large-scale, high-precision production. In recent years, with the development of machine vision technology, automatic detection methods based on image processing have gradually become a research hotspot. Through a machine vision system, image information of the pipe surface can be quickly obtained, and image processing algorithms can be used to identify defects.
[0005] Currently, some research attempts to use superpixel segmentation technology for defect recognition. This technology divides the image into several superpixel blocks with similar texture, color, and other characteristics, simplifying the image processing process and improving the efficiency of defect recognition. However, the performance of the superpixel segmentation algorithm largely depends on the setting of the number of superpixel blocks, which is usually manually adjusted based on experience, lacking adaptability. Unreasonable parameter settings can lead to poor segmentation results, affecting the accuracy of defect recognition and making it difficult to accurately judge the quality of the pipe.
[0006] Therefore, developing an efficient, accurate, and adaptive quality detection method for highway engineering construction pipes is of great significance for improving product quality and ensuring project safety. This method should overcome the limitations of existing technology, automatically and accurately identify defects such as pitting on the pipe surface, and provide reliable technical support for quality control during the production process. SUMMARY
[0007] The present application provides a quality detection method for highway engineering construction pipes to solve the problem of poor defect segmentation accuracy. The technical solution adopted is as follows: One embodiment of the application is a quality detection method for highway engineering construction pipes, which comprises the following steps: Obtaining a gray image of the highway engineering construction pipes; According to the gray image of the highway engineering construction pipes, obtaining a plastic pipe area image and a sliding window of each pixel point in the plastic pipe area; according to the gradient amplitude of each pixel point in the plastic pipe area image, obtaining a contrast matrix of each pixel point in the plastic pipe area image; according to the contrast matrix of each pixel point in the plastic pipe area image, obtaining a contrast sampling matrix of the contrast matrix of each pixel point; according to the contrast sampling matrix of the contrast matrix of each pixel point, obtaining a contrast variation coefficient of each pixel point in the plastic pipe area; according to the contrast variation coefficient of each pixel point in the plastic pipe area, obtaining a contrast variation law index of each pixel point in the plastic pipe area; According to the gray level change in the sliding window of each pixel point in the plastic pipe area, obtaining a light absorption amplitude of each pixel point in the plastic pipe area; according to the light absorption amplitude and the contrast variation law index of each pixel point in the plastic pipe area, obtaining a pitting degree of each pixel point in the plastic pipe area; and according to the pitting degree of each pixel point in the plastic pipe area, obtaining a pitting significant image of the plastic pipe area. Using Otsu threshold segmentation technology to obtain a segmentation result of the pitting significant image of the plastic pipe area, and identifying the pitting defects on the surface of the highway engineering construction pipe according to the segmentation result of the pitting significant image of the plastic pipe area.
[0008] Preferably, the method for obtaining the plastic pipe area image and the sliding window of each pixel point in the plastic pipe area according to the gray image of the highway engineering construction pipe is as follows: Using Otsu threshold segmentation technology, the region composed of all pixel points with a gray value lower than a first segmentation threshold in the gray image of the highway engineering construction pipe is taken as the plastic pipe area, each plastic pipe area is taken as a target region in the gray image of the highway engineering construction pipe, and the image composed of all target regions in the gray image of the highway engineering construction pipe is taken as the plastic pipe area image; and a rectangular window with a first preset parameter size centered on each pixel point in the plastic pipe area is taken as the sliding window of each pixel point in the plastic pipe area.
[0009] Preferably, the method for obtaining the contrast matrix of each pixel point in the plastic pipe area image according to the gradient amplitude of each pixel point in the plastic pipe area image is as follows: Using Sobel operator to obtain the gradient amplitude of each pixel point in the plastic pipe area image, taking the gradient amplitude of each pixel point as the contrast of each pixel point, and taking the matrix composed of the contrasts in the sliding window of each pixel point according to the pixel point position as the contrast matrix of each pixel point.
[0010] Preferably, the method for obtaining the contrast sampling matrix of the contrast matrix of each pixel point in the plastic pipe material region image according to the contrast matrix of each pixel point in the plastic pipe material region image is as follows: For the contrast matrix of each pixel point in the plastic pipe material region image and the transpose matrix of the contrast matrix, the sequence composed of each row element in the contrast matrix is taken as each horizontal contrast sequence in the contrast matrix, and the sequence composed of each row element in the transpose matrix of the contrast matrix is taken as each vertical contrast sequence in the contrast matrix. For each horizontal contrast sequence of the contrast matrix of each pixel point in the plastic pipe material region image, continuous sampling is performed with a continuous number of the second preset parameter and a sampling interval of the third preset parameter, and the matrix composed of the results of the continuous sampling of the horizontal contrast sequence in the order of sampling is taken as the horizontal contrast sampling matrix of the horizontal contrast sequence. For each vertical contrast sequence of the contrast matrix of each pixel point in the plastic pipe material region image, continuous sampling is performed with a continuous number of the second preset parameter and a sampling interval of the third preset parameter, and the matrix composed of the results of the continuous sampling of the vertical contrast sequence in the order of sampling is taken as the vertical contrast sampling matrix of the vertical contrast sequence. The contrast sampling matrix of the contrast matrix of each pixel point includes the horizontal contrast sampling matrix and the vertical contrast sampling matrix.
[0011] Preferably, the method for obtaining the contrast variation coefficient of each pixel point in the plastic pipe material region according to the contrast sampling matrix of the contrast matrix of each pixel point is as follows: The contrast difference index of each contrast sequence in the contrast matrix of each pixel point in the plastic pipe material region is obtained according to the contrast sampling matrix corresponding to the pixel point in the plastic pipe material region image, and the contrast difference index includes a horizontal contrast difference index and a vertical contrast difference index. For each pixel point in the plastic pipe material region, the horizontal contrast difference index of each horizontal contrast sequence in the contrast matrix of the pixel point is accumulated on the contrast matrix of the pixel point, and the mean value of the accumulated sum is taken as the horizontal contrast variation coefficient of the pixel point. For each pixel point in the plastic pipe material region, the vertical contrast difference index of each vertical contrast sequence in the contrast matrix of the pixel point is accumulated on the contrast matrix of the pixel point, and the mean value of the accumulated sum is taken as the vertical contrast variation coefficient of the pixel point.
[0012] The contrast variation coefficient of each pixel point includes the horizontal contrast variation coefficient and the vertical contrast variation coefficient.
[0013] Preferably, the method for obtaining the contrast difference index of each contrast sequence in the contrast matrix of each pixel in the plastic pipe material region according to the contrast sampling matrix corresponding to each pixel in the plastic pipe material region image is as follows: For each transverse contrast sequence of the contrast matrix of each pixel in the plastic pipe material region, taking the absolute value of the difference between adjacent elements in each row of the transverse contrast sampling matrix as a first product factor, taking the absolute value of the difference between the average values of elements in adjacent two rows in the transverse contrast sampling matrix as a second product factor, obtaining the accumulation sum of the product between the first product factor and the second product factor on all rows in the transverse contrast sampling matrix, and taking the average value of the accumulation sum as the transverse contrast difference index of each transverse contrast sequence. For each longitudinal contrast sequence of the contrast matrix of each pixel in the plastic pipe material region, taking the absolute value of the difference between adjacent elements in each row of the longitudinal contrast sampling matrix as a third product factor, taking the absolute value of the difference between the average values of elements in adjacent two rows in the longitudinal contrast sampling matrix as a fourth product factor, obtaining the accumulation sum of the product between the third product factor and the fourth product factor on all rows in the longitudinal contrast sampling matrix, and taking the average value of the accumulation sum as the longitudinal contrast difference index of each longitudinal contrast sequence. The contrast difference index of each contrast sequence in the contrast matrix of each pixel in the plastic pipe material region includes the transverse contrast difference index of each transverse contrast sequence and the longitudinal contrast difference index of each longitudinal contrast sequence.
[0014] Preferably, the method for obtaining the contrast variation law index of each pixel in the plastic pipe material region according to the contrast variation coefficient of each pixel in the plastic pipe material region is as follows: In the formula, represents the contrast variation law index of pixel x in the plastic pipe material region, represents the transverse contrast variation coefficient of pixel x in the plastic pipe material region, represents the longitudinal contrast variation coefficient of pixel x in the plastic pipe material region, , is a preset weight parameter.
[0015] Preferably, the method for obtaining the light absorption amplitude of each pixel in the plastic pipe material region according to the gray level change in the sliding window of each pixel in the plastic pipe material region is as follows: In the formula, represents the light absorption amplitude of pixel in the plastic pipe material region, the mean square error of the gray value of the pixel point in the sliding window of the pixel point in the highway engineering construction pipe material region, the total number of the neighborhood pixel points of the pixel point in the sliding window, the gray value of the first neighborhood pixel point in the sliding window of the pixel point in the highway engineering construction pipe material region, the gray value of the first neighborhood pixel point in the sliding window of the pixel point in the highway engineering construction pipe material region, the gray value of the pixel point in the highway engineering construction pipe material region.
[0016] Preferably, the method for obtaining the pitting degree of each pixel point in the plastic pipe material region according to the light absorption amplitude and the contrast variation law index of each pixel point in the plastic pipe material region, and obtaining the pitting significant map of the plastic pipe material region according to the pitting degree of each pixel point in the plastic pipe material region is: the integral result of the product between the light absorption amplitude and the contrast variation law index of each pixel point in the plastic pipe material region as the pitting degree of each pixel point; the normalization result of the pitting degree of each pixel point as the pitting significant index of each pixel point, replacing the gray value of each pixel point with the pitting significant index of each pixel point, traversing all the pixel points in the plastic pipe material region image, and taking the replaced result as the pitting significant map of the plastic pipe material region.
[0017] Preferably, the method for obtaining the pitting significant map of the plastic pipe material region by using the Otsu threshold segmentation technology, and identifying the pitting defects on the surface of the highway engineering construction pipe according to the segmentation result of the pitting significant map of the plastic pipe material region is: regarding the region composed of all the pixel points with the pitting significant index higher than the second segmentation threshold value in the pitting significant map of the plastic pipe material as the pitting defect region of the plastic pipe material, segmenting out the pitting defect region in the pitting significant map of the plastic pipe material by using the Otsu threshold segmentation technology, and identifying the pitting defects on the plastic pipe according to the segmentation result.
[0018] The application has the beneficial effects that based on the differences in the light absorption amplitude and the contrast variation law index between the pitting pits and other parts, the pitting degree of each pixel point in the plastic pipe material region is obtained, and then the pitting significant map of the plastic pipe material region is constructed, the pitting defects on the highway engineering construction pipe material region are obtained by using the image segmentation technology. Based on the specific characteristics of the pitting defects in the plastic pipe material image, the pitting significant map is constructed, and then the image is segmented, so that the pitting region obtained by segmentation is more accurate, and a strong basis is provided for the subsequent evaluation of the quality of the highway engineering construction pipe. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description only show some of the embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without any creative effort.
[0020] Figure 1 A flowchart of a quality detection method for highway engineering construction pipes provided by an embodiment of the present application. DETAILED DESCRIPTION
[0021] The technical solutions in the embodiments of the present application will be described clearly and completely in the following with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without any creative effort are within the scope of protection of the present application.
[0022] Please refer to Figure 1 which shows a flowchart of a quality detection method for highway engineering construction pipes provided by an embodiment of the present application. The method comprises the following steps: Step S001, obtaining a highway engineering construction pipe gray image.
[0023] There are various types of pipes used in highway engineering construction, and here mainly plastic pipes in highway engineering construction are discussed. Common plastic pipes in highway engineering include PVC-U pipe (hard polyvinyl chloride pipe), HDPE pipe (high-density polyethylene pipe), PPR pipe (random copolymer polypropylene pipe), PVC-C pipe (chlorinated polyvinyl chloride pipe), MPP pipe (modified polypropylene pipe), etc.
[0024] A CCD camera is used to collect the image of the surface of the highway engineering construction pipe to obtain a highway engineering construction pipe image in RGB space. The collected image is preprocessed to eliminate the influence of some external interference and noise and to enhance the accuracy of subsequent highway engineering construction pipe defect identification. In order to remove noise while preserving boundary information, the present application selects non-local mean filtering to process the image, and the implementer can also use other noise removal methods. In order to more accurately obtain the concave pitting defects on the highway engineering construction pipe, the obtained RGB image of the highway engineering construction pipe is converted into a highway engineering construction pipe gray image, and then a histogram equalization algorithm is used to enhance the highway engineering construction pipe gray image. The preprocessed image is denoted as a highway engineering construction pipe gray image. The non-local mean filtering and the histogram equalization algorithm are well-known technologies and will not be described in detail.
[0025] At this point, the pre-processed highway engineering construction pipe gray image is obtained.
[0026] In step S002, a contrast matrix is obtained according to the highway engineering construction pipe gray image, a horizontal contrast variation coefficient and a vertical contrast variation coefficient are obtained according to the contrast matrix, and a contrast variation law index is obtained according to the horizontal contrast variation coefficient and the vertical contrast variation coefficient.
[0027] According to the obtained highway engineering construction pipe gray image, since the highway engineering construction pipe is obviously distinguished from the background and the gray value on the highway engineering construction pipe is low, the Otsu threshold segmentation technology is used, the part higher than the threshold value is taken as the background, the image of the highway engineering construction pipe region is segmented and extracted, and the plastic pipe region image is obtained. According to the obtained plastic pipe region image, since the raw material for manufacturing the highway engineering construction pipe has moisture and the process temperature is too high, the plastic pipe surface will appear concave pitting. However, the pitting is large or small, and the characteristic information of the pitting on the highway engineering construction pipe cannot be obtained intuitively, and further analysis is needed.
[0028] Specifically, in order to more clearly obtain the information of the pitting, for the gray image of the highway engineering construction pipe region, taking each pixel point as a center pixel point, taking the region window of the size as a rectangular sliding window, the experience value is 11.
[0029] Since different parts of the highway engineering construction pipe region image are affected by different degrees of illumination, since the edge shape of the pitting concave is similar to a circle, the pitting edge will show the characteristics of large gradient in different directions. Therefore, the gradient amplitude of each pixel point in the highway engineering construction pipe region image is calculated by using the Sobel operator. The gradient amplitude of each pixel point can reflect the contrast between each pixel point and the surrounding pixel points to a certain extent, so the gradient amplitude of each pixel point is taken as the contrast of each pixel point.
[0030] Since the pitting edge in the highway engineering construction pipe region has the characteristics of large contrast and small contrast around the edge, the contrast variation law of the pitting region pixel point and the other region pixel point is different.
[0031] Specifically, for the sliding window of each pixel point in the highway engineering construction pipe region, the contrast in the sliding window is horizontally sampled and vertically sampled.
[0032] Taking the transverse sampling as an example, for the sliding window of the pixel point x, the sliding window size of the pixel point is 11*11, the contrast in the sliding window is taken as the contrast matrix composed of the position of the pixel point, the sequence composed of each row of the contrast in the contrast matrix is taken as the transverse contrast sequence of each, and the transverse contrast sequence of the i-th in the contrast matrix is denoted as . The transverse contrast sequence is subjected to the transverse sampling with the continuous number of 3 and the sampling interval of 1, and the matrix composed of the result of the transverse sampling is taken as the transverse contrast sampling matrix.
[0033] For example, the transverse contrast sequence of the i-th in the contrast matrix of the pixel point x in the plastic pipe region: The transverse contrast sequence is subjected to the transverse sampling with the continuous number of 3 and the sampling interval of 1, and the contrast sampling matrix of the i-th row of the contrast sequence is obtained: In the formula, denotes the transverse contrast sampling matrix of the i-th, denotes the first row element of the transverse contrast sampling matrix, denotes the second row element of the transverse contrast sampling matrix, denotes the third row element of the transverse contrast sampling matrix, and so on, denotes the last row element of the transverse contrast sampling matrix.
[0034] Similarly, in the longitudinal sampling, the contrast matrix of each pixel point is subjected to the transposition transformation to obtain the transposed matrix of the contrast matrix, and the longitudinal contrast sampling matrix of each longitudinal contrast sequence of the contrast matrix of each pixel point can be obtained according to the above method.
[0035] According to the transverse contrast sampling matrix of each transverse contrast sequence of the contrast matrix of each pixel point in the plastic pipe region, the transverse contrast difference index of each transverse contrast sequence in the contrast matrix of each pixel point in the plastic pipe region is calculated: In the formula, denotes the transverse contrast difference index of the i-th transverse contrast sequence in the contrast matrix of the pixel point x in the plastic pipe region, denotes the number of rows of the transverse contrast sampling matrix of the i-th transverse contrast sequence in the contrast matrix of the pixel point x in the plastic pipe region, denotes the number of elements of each row in the transverse contrast sampling matrix of the i-th transverse contrast sequence in the contrast matrix of the pixel point x in the plastic pipe region, and respectively represent the s-th, (s-1)-th element value in the s-th row element of the transverse contrast sampling matrix of the i-th transverse contrast sequence in the contrast matrix of the pixel point x in the plastic pipe material region, and respectively represent the s-th, (s-1)-th element value in the s-th row element of the transverse contrast sampling matrix of the i-th transverse contrast sequence in the contrast matrix of the pixel point x in the plastic pipe material region, respectively represent the s-th, (s-1)-th element value in the s-th row element of the transverse contrast sampling matrix of the i-th transverse contrast sequence in the contrast matrix of the pixel point x in the plastic pipe material region,
[0036] respectively represent the s-th, (s-1)-th element value in the s-th row element of the transverse contrast sampling matrix of the i-th transverse contrast sequence in the contrast matrix of the pixel point x in the plastic pipe material region, The greater the difference between the s-th element value and the (s-1)-th element value in the s-th row element of the transverse contrast sampling matrix of the i-th transverse contrast sequence in the contrast matrix of the pixel point x in the plastic pipe material region, the greater the first product factor The greater the difference between the s-th element value and the (s-1)-th element value in the s-th row element of the transverse contrast sampling matrix of the i-th transverse contrast sequence in the contrast matrix of the pixel point x in the plastic pipe material region, the greater the second product factor The greater the difference between the s-th element value and the (s-1)-th element value in the s-th row element of the transverse contrast sampling matrix of the i-th transverse contrast sequence in the contrast matrix of the pixel point x in the plastic pipe material region, the greater the first product factor The greater the difference between the s-th element value and the (s-1)-th element value in the s-th row element of the transverse contrast sampling matrix of the i-th transverse contrast sequence in the contrast matrix of the pixel point x in the plastic pipe material region, the greater the second product factor The greater the difference between the s-th element value and the (s-1)-th element value in the s-th row element of the transverse contrast sampling matrix of the i-th transverse contrast sequence in the contrast matrix of the pixel point x in the plastic pipe material region, the greater the first product factor The greater the difference between the s-th element value and the (s-1)-th element value in the s-th row element of the transverse contrast sampling matrix of the i-th transverse contrast sequence in the contrast matrix of the pixel point x in the plastic pipe material region, the greater the second product factor
[0037] Further, according to the transverse contrast difference index of each transverse contrast sequence in the contrast matrix of each pixel point in the plastic pipe material region, the transverse contrast gradient coefficient of each pixel point in the plastic pipe material region is calculated: In the formula, x represents the pixel point in the plastic pipe material region, x represents the transverse contrast gradient coefficient of the pixel point x in the plastic pipe material region, n represents the number of transverse contrast sequences in the contrast matrix of the pixel point x in the plastic pipe material region, x represents the transverse contrast difference index of the i-th transverse contrast sequence in the contrast matrix of the pixel point x in the plastic pipe material region.
[0038] The greater the transverse contrast difference index of the i-th transverse contrast sequence in the contrast matrix of the pixel point x in the plastic pipe material region, The greater the difference between the s-th element value and the (s-1)-th element value in the s-th row element of the transverse contrast sampling matrix of the i-th transverse contrast sequence in the contrast matrix of the pixel point x in the plastic pipe material region, the greater the first product factor
[0039] Similarly, according to the longitudinal contrast sampling matrix of each longitudinal contrast sequence of the contrast matrix of each pixel point in the plastic pipe material region, the longitudinal contrast difference index of each longitudinal contrast sequence of the contrast matrix of each pixel point in the plastic pipe material region and the longitudinal contrast variation coefficient of each pixel point in the plastic pipe material region can be obtained by using the same calculation method. The logical relationship reflected by the longitudinal contrast difference index and the longitudinal contrast variation coefficient is the same as that of the lateral contrast difference index and the lateral contrast variation coefficient.
[0040] Further, according to the longitudinal contrast variation coefficient and the lateral contrast variation coefficient of each pixel point in the plastic pipe material region, the same weight in different directions is given, and the contrast variation law index of each pixel point in the plastic pipe material region is calculated: In the formula, represents the contrast variation law index of pixel point x in the plastic pipe material region, represents the lateral contrast variation coefficient of pixel point x in the plastic pipe material region, represents the longitudinal contrast variation coefficient of pixel point x in the plastic pipe material region, , are all preset weights, , The size of each of 0.5 and 0.5 is an empirical value.
[0041] With the movement of the sliding window on the plastic pipe material region, when the sliding window contains the edge of the concave pitting, the lateral contrast variation coefficient and the longitudinal contrast variation coefficient of the pixel point will become larger, and then the contrast variation law index is larger, that is, it is more likely to be a concave pitting position.
[0042] At this point, the contrast variation law index of each pixel point in the plastic pipe material region is obtained.
[0043] Step S003, according to the light reflection characteristics generated by the pitting, the light absorption amplitude is obtained, according to the light absorption amplitude and the contrast variation law index, the pitting degree of the pitting is obtained, and the pitting significant map of the pitting is obtained.
[0044] In the scenario of the appearance of the pimple in the highway engineering construction pipe, the plastic pipe will have a light reflection response under the influence of light, but due to the concave phenomenon of each pimple in the plastic pipe, the light reflection effect of the pixel point at the pimple is weakened. At the same time, the greater the concave degree of the pimple, the greater the weakening degree of the light reflection effect; the relatively smaller the concave degree of the pimple, the smaller the weakening degree of the light reflection effect. Therefore, it is explained that the pimple has the characteristics of absorbing the incident light. When the center pixel point is located on the concave pimple of the plastic pipe, the difference between the remaining pixel points in the rectangular sliding window and the center pixel point is large. Usually in the gray scale conversion technology, that is, converting the RGB image into a gray scale image, the area with lower brightness in the RGB image has lower gray scale after gray scale conversion, and the area with higher brightness has higher gray scale after gray scale conversion. Therefore, because the pimple on the plastic pipe absorbs the incident light, that is, the brightness is lower in the RGB image, the gray scale value at the pimple after gray scale conversion is smaller, thereby causing a large difference between the gray scale value at the pimple position and the gray scale value of the neighborhood.
[0045] The light absorption amplitude of each pixel point in the plastic pipe region is calculated: In the formula, represents the light absorption amplitude of the pixel point in the plastic pipe region, represents the mean square error of the pixel points in the sliding window of the pixel point in the highway engineering construction pipe region, represents the total number of neighborhood pixel points of the pixel points in the sliding window, represents the gray scale value of the neighborhood pixel point in the sliding window of the pixel point in the highway engineering construction pipe region, represents the gray scale value of the pixel point in the highway engineering construction pipe region.
[0046] The mean square error in the sliding window can measure the uniformity of the gray scale value in the sliding window to some extent. Due to the concave of the pimple, the local mean square error will be large, that is, the mean square error of the pixel points in the sliding window of the pixel point in the highway engineering construction pipe region is larger, which can better explain that the distribution of the gray scale value in the window is uneven, that is, the pixel point x is more likely to be located in the pimple region, and the light absorption amplitude of the pixel point is larger. At the same time, the difference between the gray scale value of the neighborhood pixel point in the sliding window of the pixel point in the highway engineering construction pipe region and the gray scale value of the pixel point x is larger, which can better explain that the pixel point The greater the difference with the surrounding pixels, that is, the greater the possibility that the pixel belongs to the pitting area, the greater the light absorption amplitude of the pixel.
[0047] The contrast gradient index considers the gradient of contrast in different directions, and reduces the influence of the light reflection effect on each pixel by combining the gradient of contrast in different directions. At the same time, since the contrast gradient index is calculated according to the characteristics of the edge of the pitting hemp dot, it can reflect the characteristics of the large hemp dot with a large degree of pitting to some extent. The light absorption amplitude is based on the gray difference between the surrounding pixels and the center pixel, which can reflect the characteristics of the small hemp dot with a small degree of pitting and the edge of the large hemp dot to some extent.
[0048] Further, according to the light absorption amplitude and the contrast gradient index of each pixel in the plastic pipe area, the pitting degree of each pixel in the plastic pipe area is calculated: In the formula, represents the pitting degree of the pixel x in the plastic pipe area, represents the rounding function, represents the contrast gradient index of the pixel x in the plastic pipe area, represents the light absorption amplitude of the pixel x in the plastic pipe area.
[0049] The greater the contrast gradient index of the pixel x in the plastic pipe area, the greater the possibility that the pixel is in the hemp dot position, and the greater the pitting degree of the hemp dot; on the contrary, the smaller the contrast gradient index of the pixel x in the plastic pipe area, the smaller the change in the contrast around the pixel, and the more likely it is a flat area of the highway engineering construction pipe, and the smaller the pitting degree of the hemp dot. The greater the light absorption amplitude of the pixel x in the plastic pipe area, the smaller the amount of light reflection of the pixel and the greater the degree of pitting, and the greater the pitting degree of the pixel; on the contrary, the smaller the light absorption amplitude of the pixel x in the plastic pipe area, the greater the amount of light reflection of the pixel and the smaller the degree of pitting, and the smaller the pitting degree of the pixel.
[0050] For any pixel in the gray scale image of the highway engineering construction pipe area, the normalized pitting degree of the pixel is obtained, and the normalized pitting degree is replaced by the gray value of the pixel. All pixels in the gray scale image of the highway engineering construction pipe area are traversed and replaced, and the result after replacement is taken as the pitting significant map of the highway engineering construction pipe area.
[0051] Thus, the pitting and depression significant map of the pipeline material region of the highway engineering construction is obtained.
[0052] In step S004, the segmentation result of the pitting and depression significant map is obtained by using the Otsu threshold segmentation technology, and the pitting defects on the surface of the pipeline material of the highway engineering construction are identified according to the segmentation result.
[0053] For the pitting and depression significant map of the pipeline material of the highway engineering construction, the pitting and depression is relatively significant, and the Otsu threshold segmentation technology is used to segment the pitting and depression of the pipeline material of the highway engineering construction.
[0054] If the pitting and depression part is not segmented from the pipeline material region of the highway engineering construction, it indicates that the pipeline material of the highway engineering construction does not have pitting and depression defects; if the pitting and depression shape region is segmented from the pipeline material region of the highway engineering construction, it indicates that the surface of the pipeline material of the highway engineering construction has pitting and depression defects, and the staff needs to further process the pipeline material of the highway engineering construction to ensure the quality requirements of the pipeline material of the highway engineering construction.
[0055] Each of the embodiments in the specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other. Each embodiment mainly describes the difference from other embodiments. The above is only the preferred embodiment of the present application, and is not used to limit the present application. Any modification, equivalent replacement, improvement, etc. within the principle of the present application should be included in the protection scope of the present application.
Claims
1. A quality inspection method for pipe materials used in highway engineering construction, characterized in that, The method includes the following steps: Obtain grayscale images of pipe materials used in highway construction; Based on the grayscale image of the pipes used in highway engineering construction, obtain the image of the plastic pipe region and the sliding window of each pixel in the plastic pipe region; obtain the contrast matrix of each pixel in the plastic pipe region image based on the gradient magnitude of each pixel in the plastic pipe region image; obtain the contrast sampling matrix of the contrast matrix of each pixel in the plastic pipe region image based on the contrast sampling matrix of the contrast matrix of each pixel in the plastic pipe region image; obtain the contrast variation coefficient of each pixel in the plastic pipe region based on the contrast variation coefficient of each pixel in the plastic pipe region image; obtain the contrast variation law index of each pixel in the plastic pipe region. The light absorption amplitude of each pixel in the plastic pipe area is obtained based on the grayscale change within the sliding window of each pixel in the plastic pipe area; the pitting indentation degree of each pixel in the plastic pipe area is obtained based on the light absorption amplitude and contrast variation law index of each pixel in the plastic pipe area; and the pitting indentation saliency map of the plastic pipe area is obtained based on the pitting indentation degree of each pixel in the plastic pipe area. The Otsu threshold segmentation technique was used to obtain the segmentation results of the saliency map of pitting depressions in the plastic pipe area. Based on the segmentation results of the saliency map of pitting depressions in the plastic pipe area, pitting defects on the surface of the construction pipe in highway engineering were identified.
2. The quality inspection method for pipe materials used in highway engineering construction according to claim 1, characterized in that, The method for obtaining the image of the plastic pipe region and the sliding window of each pixel in the plastic pipe region based on the grayscale image of the pipe material in highway engineering construction is as follows: Using the Otsu threshold segmentation technique, the region consisting of all pixels in the grayscale image of highway construction pipe materials whose grayscale values are lower than the first segmentation threshold is taken as the plastic pipe material region. Each plastic pipe material region is taken as a target region in the grayscale image of highway construction pipe materials. The image composed of all target regions in the grayscale image of highway construction pipe materials is taken as the plastic pipe material region image. A rectangular window of a size with a first preset parameter centered on each pixel in the plastic pipe material region is taken as the sliding window for each pixel in the plastic pipe material region.
3. The quality inspection method for pipe materials used in highway engineering construction according to claim 1, characterized in that, The method for obtaining the contrast matrix of each pixel in the plastic pipe region image based on the gradient magnitude of each pixel in the plastic pipe region image is as follows: The Sobel operator is used to obtain the gradient magnitude of each pixel in the image of the plastic pipe region. The gradient magnitude of each pixel is used as the contrast of each pixel. The contrast within the sliding window of each pixel is used as the contrast matrix of each pixel according to the pixel position.
4. The quality inspection method for pipe materials used in highway engineering construction according to claim 1, characterized in that, The method for obtaining the contrast sampling matrix of each pixel based on the contrast matrix of each pixel in the plastic pipe area image is as follows: For each pixel in the plastic pipe region image, the contrast matrix and the transpose of the contrast matrix are used as the sequence of each row of elements in the contrast matrix as each horizontal contrast sequence in the contrast matrix, and the sequence of each row of elements in the transpose of the contrast matrix is used as each vertical contrast sequence in the contrast matrix. For each pixel in the image of the plastic pipe region, for each horizontal contrast sequence, the number of consecutive samples is the second preset parameter and the sampling interval is the third preset parameter. The matrix formed by the results of the continuous sampling of the horizontal contrast sequence according to the sampling order is used as the horizontal contrast sampling matrix of the horizontal contrast sequence. For each vertical contrast sequence of the contrast matrix of each pixel in the plastic pipe area image, continuous sampling is performed with a number of consecutive samples equal to the second preset parameter and a sampling interval equal to the third preset parameter. The matrix formed by the continuous sampling results of the vertical contrast sequence according to the sampling order is used as the vertical contrast sampling matrix of the vertical contrast sequence. The contrast sampling matrix of each pixel's contrast matrix includes the horizontal contrast sampling matrix and the vertical contrast sampling matrix.
5. The quality inspection method for pipe materials used in highway engineering construction according to claim 1, characterized in that, The method for obtaining the contrast variation coefficient of each pixel in the plastic pipe region based on the contrast sampling matrix of the contrast matrix of each pixel is as follows: The contrast difference index of each contrast sequence in the contrast matrix of each pixel in the plastic pipe region is obtained based on the contrast sampling matrix corresponding to each pixel in the plastic pipe region image. The contrast difference index includes the horizontal contrast difference index and the vertical contrast difference index. For each pixel in the plastic pipe region, the sum of the horizontal contrast difference index of each horizontal contrast sequence in the contrast matrix of the pixel is obtained on the contrast matrix of the pixel, and the mean of the sum is used as the horizontal contrast variation coefficient of the pixel. For each pixel in the plastic pipe region, the sum of the longitudinal contrast difference index of each longitudinal contrast sequence in the contrast matrix of the pixel is obtained on the contrast matrix of the pixel, and the mean of the sum is used as the longitudinal contrast variation coefficient of the pixel. The contrast gradient coefficient for each pixel includes the horizontal contrast gradient coefficient and the vertical contrast gradient coefficient.
6. The quality inspection method for pipe materials used in highway engineering construction according to claim 5, characterized in that, The method for obtaining the contrast difference index of each contrast sequence in the contrast matrix of each pixel in the plastic pipe region image based on the contrast sampling matrix corresponding to each pixel in the plastic pipe region image is as follows: For each horizontal contrast sequence of the contrast matrix of each pixel in the plastic pipe region, the absolute value of the difference between adjacent elements in each row of the horizontal contrast sampling matrix is used as the first product factor, and the absolute value of the difference between the mean values of adjacent two rows of elements in the horizontal contrast sampling matrix is used as the second product factor. The product between the first product factor and the second product factor is accumulated in all rows of the horizontal contrast sampling matrix, and the mean of the accumulated sum is used as the horizontal contrast difference index of each horizontal contrast sequence. For each vertical contrast sequence of the contrast matrix of each pixel in the plastic pipe region, the absolute value of the difference between adjacent elements in each row of the vertical contrast sampling matrix is used as the third product factor, and the absolute value of the difference between the mean values of adjacent two rows of elements in the vertical contrast sampling matrix is used as the fourth product factor. The product between the third product factor and the fourth product factor is accumulated in all rows of the vertical contrast sampling matrix, and the mean of the accumulated sum is used as the vertical contrast difference index of each vertical contrast sequence. The contrast difference index of each contrast sequence in the contrast matrix of each pixel in the plastic pipe area includes the horizontal contrast difference index of each horizontal contrast sequence and the vertical contrast difference index of each vertical contrast sequence.
7. The quality inspection method for pipe materials used in highway engineering construction according to claim 1, characterized in that, The method for obtaining the contrast variation law index of each pixel in the plastic pipe area based on the contrast variation coefficient of each pixel in the plastic pipe area is as follows: In the formula, This represents the index indicating the variation pattern of contrast at pixel x in the plastic pipe region. This represents the horizontal contrast variation coefficient of pixel x in the plastic pipe region. This represents the vertical contrast variation coefficient of pixel x in the plastic pipe region. , These are preset weight parameters.
8. The quality inspection method for pipe materials used in highway engineering construction according to claim 1, characterized in that, The method for obtaining the light absorption amplitude of each pixel in the plastic pipe region based on the grayscale change within the sliding window of each pixel in the plastic pipe region is as follows: In the formula, Represents pixels in the plastic pipe area The amplitude of light absorption, Represents pixels in the pipeline area of highway engineering construction. The mean square error of the grayscale values of pixels within the sliding window. Represents the number of pixels within the sliding window The total number of neighboring pixels, Represents the pixels in the pipe material area of highway engineering construction. The first sliding window grayscale values of neighboring pixels Represents the pixels in the pipe material area of highway engineering construction. The grayscale value.
9. A quality inspection method for pipe materials used in highway engineering construction according to claim 1, characterized in that, The method for obtaining the pitting indentation degree of each pixel in the plastic pipe area based on the light absorption amplitude and contrast variation law index of each pixel in the plastic pipe area, and obtaining the pitting indentation saliency map of the plastic pipe area based on the pitting indentation degree of each pixel in the plastic pipe area is as follows: The rounded result of the product between the light absorption amplitude of each pixel in the plastic pipe area and the contrast variation law index is taken as the pitting degree of each pixel. The normalized result of the pitting indentation degree of each pixel is used as the pitting saliency index of each pixel. The gray value of each pixel is replaced with the pitting saliency index of each pixel. All pixels in the plastic pipe area image are traversed, and the replaced result is used as the pitting indentation saliency map of the plastic pipe area.
10. A method for quality inspection of pipe materials used in highway engineering construction according to claim 1, characterized in that, The method for identifying pitting defects on the surface of highway construction pipes based on the segmentation results of the saliency map of pitting depressions in the plastic pipe area obtained by the Otsu threshold segmentation technique is as follows: The region consisting of all pixels whose salience index in the salience map of the pitting depression of the plastic pipe is higher than the second segmentation threshold is taken as the pitting defect region of the plastic pipe. The Otsu threshold segmentation technique is used to segment the pitting defect region described in the salience map of the pitting depression of the plastic pipe, and the pitting defect on the plastic pipe is identified based on the segmentation results.