Defect detection method and device based on panoramic image of drainage pipe inner wall
The multi-spectral camera collects panoramic images of the inner wall of the drainage pipe and constructs a spectral matrix to generate a defect judgment index, which solves the problem that traditional detection methods are difficult to accurately judge the defects in the inner wall of the pipe, and achieves efficient and accurate defect detection.
Patent Information
- Application Number
- CN202411714407.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-11-27
AI Technical Summary
Traditional drainage pipeline detection methods are difficult to accurately judge the defect status of the inner wall of the pipeline, and there are blind spots in detection, time-consuming and limited ability to analyze complex defects.
A multi-spectral camera is used to collect panoramic images of the inner wall of the drainage pipe under different wavelength conditions. By constructing the spectral matrix of the pixel points and the spectral matrix of the comparison pixel points, a defect judgment index is generated, and the defect type is initially judged.
It realizes the rapid and accurate identification of defective pixel points, reduces manual intervention and image processing time, improves detection efficiency and accuracy, and reduces the situation of missed detection and missed detection.
Smart Images

Figure CN119205776B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pipeline detection, and in particular to a method and device for defect detection based on a panoramic image of the inner wall of a drainage pipeline. Background Art
[0002] In the management and maintenance of modern urban infrastructure, the health status of drainage pipes is directly related to the city's flood control and drainage capabilities and environmental sanitation conditions. However, traditional drainage pipe inspection methods often rely on manual inspection or simple visual inspection tools, which make it difficult to accurately determine the defect status of the inner wall of the pipe. These methods are not only time-consuming, but also have detection blind spots, which can easily lead to problems such as missed detection and misjudgment, thus posing potential safety hazards. In addition, due to the diversity of pipeline materials and environmental conditions, the types of defects and their characteristics are also different, and the existing technology has limited quantitative and qualitative analysis capabilities for these complex defects. Therefore, there is an urgent need for an efficient and accurate drainage pipe defect detection method to improve the maintenance efficiency and safety of the pipeline.
[0003] In the prior art, publication number CN114742797A discloses a defect detection method for a panoramic image of the inner wall of a drainage pipe and an image acquisition robot. The acquisition robot acquires images of the interior of the drainage pipe, and a preset panoramic image expansion algorithm for the inner wall of the pipe is used to obtain a panoramic expanded image of the drainage pipe through the center of the image, image expansion, expanded image dedistortion and image stitching. The defect features are extracted from the panoramic expanded image of the pipe, the actual defect position of the drainage pipe is identified, and the pipe defect result is generated.
[0004] The main problems with the above method are: when the acquisition robot moves in the pipeline, it will be affected by environmental factors such as dirt, moisture, and insufficient light, resulting in unstable image quality and affecting the accuracy of the stitched panoramic image; and the performance is different for pipelines of different materials and shapes, resulting in limited scope of application.
[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention
[0006] The object of the present invention is to provide a defect detection method and device based on a panoramic image of the inner wall of a drainage pipe, so as to solve the problems raised in the above-mentioned background technology.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] A defect detection method based on a panoramic image of the inner wall of a drainage pipe, the specific steps comprising:
[0009] Step 1: Using a multispectral camera to collect panoramic images of the inner wall of the drainage pipe to be inspected under different wavelength conditions, and map the wavelengths and the corresponding panoramic images one by one;
[0010] Step 2: Select a panoramic image of one wavelength to establish a plane rectangular coordinate system, and map the plane rectangular coordinate system to panoramic images of other wavelengths, extract the spectral values of the same pixel in the panoramic images of different wavelengths, and construct a spectral matrix of the pixel points;
[0011] Step 3: Based on a non-defective drainage pipe with the same material and structure as the drainage pipe to be inspected, a panoramic image of the inner wall of the non-defective drainage pipe is collected by the same method as steps 1 and 2, and the pixel points in the panoramic image of the inner wall of the non-defective drainage pipe are used as reference pixel points of the pixel points in the panoramic image of the inner wall of the drainage pipe to be inspected, a spectral matrix of the reference pixel points is constructed, and the spectral mean and spectral standard deviation of the reference pixel points are calculated based on the spectral matrix;
[0012] Step 4: Based on the spectral matrix of the pixel point and the reference pixel point, generate the Euclidean distance between the pixel point and the reference pixel point, integrate the spectral mean and spectral standard deviation, generate the spectral threshold of the pixel point in the panoramic image of the inner wall of the drainage pipe to be detected, and generate a defect judgment index for judging whether the pixel point is a defective pixel point based on the Euclidean distance and the spectral threshold;
[0013] Step 5: extract all regions containing defective pixels in any panoramic image of the inner wall of the drainage pipe to be inspected, count the number of defective pixels in each region, generate the area of the defective region, extract the edge pixels of the defective region, generate the length of the defective boundary, generate the circularity based on the area of the defective region and the length of the defective boundary, and generate the aspect ratio of the circumscribed rectangle of the defective region;
[0014] Step 6: Preliminarily determine the defect type based on the boundary length, circularity and aspect ratio of the circumscribed rectangle of the defect area, and the defect type includes cracks, corrosion and holes.
[0015] Furthermore, the selected multispectral camera has a wavelength range of 400nm to 900nm, including the visible light band and the near infrared band. Within this wavelength range, starting from 400nm, an image is collected every 50nm.
[0016] Furthermore, the formula for constructing the spectral matrix of the pixel point is:
[0017] ;
[0018] in, Indicates that in the panoramic image of the inner wall of the drainage pipe to be detected, the coordinates are The spectral matrix of pixels at all wavelengths, The coordinates are The pixel point is The spectral value at wavelength, represents the index of the wavelength, and , Indicates the number of wavelength types.
[0019] Furthermore, the principle for generating the spectral matrix, spectral mean and spectral standard deviation of the reference pixel point is as follows:
[0020] The spectral matrix of the reference pixel is:
[0021] ;
[0022] in, Represents pixel The spectral matrix of the reference pixel at all wavelengths, Represents pixel The reference pixel is at Spectral values at wavelengths;
[0023] The formula for generating the spectral mean and spectral standard deviation is:
[0024] ;
[0025] ;
[0026] in, Represents pixel The mean spectral value of the control pixel point, Represents pixel The standard deviation of the reference pixel spectrum.
[0027] Furthermore, the principle for determining whether a pixel is a defective pixel is as follows:
[0028] Generate the Euclidean distance between each pixel and its reference pixel based on the formula:
[0029] ;
[0030] in, Represents pixel The Euclidean distance between its reference pixel;
[0031] The formula used to generate the spectral defect threshold is:
[0032] ;
[0033] in, Represents pixel The spectral defect threshold, represents the threshold adjustment constant;
[0034] The formula for generating the defect judgment index is:
[0035] ;
[0036] in, Represents pixel Defect judgment index;
[0037] when When , the pixel is a defective pixel;
[0038] when , the pixel is not a defective pixel.
[0039] Furthermore, the formula for generating circularity based on the defect area and defect boundary length is:
[0040] ;
[0041] ;
[0042] in, represents the defect area, Indicates the number of defective pixels in the defective area, Represents the actual area of the pixel. Indicates the circularity of the defect area, Indicates the defect boundary length;
[0043] The formula for generating the aspect ratio of the bounding rectangle is:
[0044] ;
[0045] in, represents the aspect ratio, Represents the length of the circumscribed rectangle, Indicates the width of the bounding rectangle.
[0046] Furthermore, the principle for preliminary determination of defect types is as follows:
[0047] when and When , the defective area is marked as a crack;
[0048] when and When , the defective area is marked as corrosion;
[0049] when and When , the defective area is marked as a hole;
[0050] in, Indicates the preset defect area threshold, Indicates the preset circularity threshold.
[0051] The present invention also provides a defect detection device based on a panoramic image of the inner wall of a drainage pipe, the device is used to implement the above-mentioned defect detection method based on a panoramic image of the inner wall of a drainage pipe, specifically comprising:
[0052] An image acquisition module is used to acquire panoramic images of the inner wall of the drainage pipe to be inspected under different wavelength conditions based on a multispectral camera, and map the wavelengths and corresponding panoramic images one by one;
[0053] A feature extraction module is used to select a panoramic image of one wavelength to establish a plane rectangular coordinate system, and map the plane rectangular coordinate system to panoramic images of other wavelengths, extract the spectral value of the same pixel in the panoramic images of different wavelengths, and construct a spectral matrix of the pixel points;
[0054] The feature pre-collection module is used to collect a panoramic image of the inner wall of a non-defective drainage pipe with the same material and structure as the drainage pipe to be detected by using the same method as the image acquisition module and the feature extraction module, and use the pixel points in the panoramic image of the inner wall of the non-defective drainage pipe as the reference pixel points of the pixel points in the panoramic image of the inner wall of the drainage pipe to be detected, construct a spectral matrix of the reference pixel points, and calculate the spectral mean and spectral standard deviation of the reference pixel points based on the spectral matrix;
[0055] A defect judgment module is used to generate the Euclidean distance between the pixel and the reference pixel based on the spectral matrix of the pixel and the reference pixel, integrate the spectral mean and the spectral standard deviation, generate the spectral threshold of the pixel in the panoramic image of the inner wall of the drainage pipe to be detected, and generate a defect judgment index for judging whether the pixel is a defective pixel based on the Euclidean distance and the spectral threshold;
[0056] The defect analysis module is used to extract all areas containing defective pixels in any panoramic image of the inner wall of the drainage pipe to be inspected, count the number of defective pixels in each area, generate the area of the defective area, extract the edge pixels of the defective area, generate the length of the defective boundary, generate the circularity based on the area of the defective area and the length of the defective boundary, and generate the aspect ratio of the circumscribed rectangle of the defective area;
[0057] The defect classification module is used to preliminarily determine the defect type based on the boundary length, circularity and aspect ratio of the circumscribed rectangle of the defect area, and the defect types include cracks, corrosion and holes. Compared with the prior art, the beneficial effects of the present invention are:
[0058] The present invention collects panoramic images at different wavelengths through a multi-spectral camera to obtain spectral information at different wavelengths at the same position, thereby providing accurate image data for subsequent spectral analysis; constructs a spectral matrix by extracting spectral values of pixel points at different wavelengths, and uses a non-defective drainage pipe with the same material and structure as a control, so that there is an objective standard for judgment, which increases the persuasiveness of the judgment; and generates a spectral threshold based on the spectral mean and spectral standard deviation of the control pixel points, compares the Euclidean distance between the pixel point to be detected and the control pixel point and the size of the spectral threshold to determine whether the pixel point is defective, can quickly and accurately identify defective pixels, convert defect judgment into a quantitative indicator rather than a subjective judgment, ensure the objectivity and accuracy of the detection, reduce manual intervention and subsequent image processing time, and improve the overall detection efficiency.
[0059] The present invention also quantifies the difference between the image to be inspected and the defect-free image through the Euclidean distance of the pixel points, generates a defect judgment index to judge whether the pixel point is a defective pixel point, comprehensively analyzes the spectral information characteristics, and reduces missed detection and false detection. After the defect area is determined by the spectral characteristics, the feature type is preliminarily determined based on the morphology of the feature through geometric features, which can realize the classification of defect types, integrate defect extraction and classification into one process, and improve the efficiency and operability of the entire detection solution. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 This is a schematic diagram of a method flow chart of an embodiment of the present invention;
[0061] Figure 2 Schematic diagram of a device module according to an embodiment of the present invention. DETAILED DESCRIPTION
[0062] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments.
[0063] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0064] Example:
[0065] See also Figure 1 , the present invention provides a technical solution:
[0066] A defect detection method based on a panoramic image of the inner wall of a drainage pipe, the specific steps comprising:
[0067] Step 1: Using a multispectral camera to collect panoramic images of the inner wall of the drainage pipe to be inspected under different wavelength conditions, and map the wavelengths and the corresponding panoramic images one by one;
[0068] In this embodiment, the band range of the selected multispectral camera is 400nm~900nm, including the visible light band and the near-infrared band. Within this band range, starting from 400nm, several different wavelengths are selected for multispectral image acquisition, and the specific number of bands is determined based on expert scoring.
[0069] Different bands capture different features for different defects on the inner wall of the drainage pipe, specifically:
[0070] Blue light, with a wavelength range of 400nm to 495nm, is used to capture features such as moisture and bubbles;
[0071] Green light, with a wavelength range of 495nm to 570nm, is used to capture plant features on the concrete surface;
[0072] Red light, with a wavelength range of 620nm~750nm, is used to capture most common materials, including concrete, plastics, coatings, metals, etc.;
[0073] Near-infrared band, with a band range of 750nm~900nm, is used to detect moisture content and internal characteristics of materials, defects such as cracks and corrosion, and metal and plastic materials.
[0074] Step 2: Select a panoramic image of one wavelength to establish a plane rectangular coordinate system, and map the plane rectangular coordinate system to panoramic images of other wavelengths, extract the spectral values of the same pixel in the panoramic images of different wavelengths, and construct a spectral matrix of the pixel points;
[0075] In this embodiment, when a panoramic image of a certain wavelength is selected to establish a plane rectangular coordinate system, the column where the leftmost pixel is located is used as the x-axis, and the row where the bottommost pixel is located is used as the y-axis to establish the plane rectangular coordinate system. All pixels in the image are in the first quadrant, and the established plane rectangular coordinate system is mapped to other images with the same shooting content but different wavelengths as the currently selected image.
[0076] In this embodiment, the formula for constructing the spectrum matrix of pixel points is:
[0077] ;
[0078] in, Indicates that in the panoramic image of the inner wall of the drainage pipe to be detected, the coordinates are The spectral matrix of pixels at all wavelengths, The coordinates are The pixel point is The spectral value at wavelength, represents the index of the wavelength, and , Indicates the number of wavelength types.
[0079] The spectral matrix represents the spectral values of the pixel point at the same coordinate at n different wavelengths. The defective part and the normal part have different reflection characteristics at different wavelengths, so there will be differences in the spectral matrix. Therefore, the reflection spectra of multiple wavelengths are fused through the spectral matrix, and each element in the spectral matrix corresponds to the spectral value at one wavelength.
[0080] Step 3: Based on a non-defective drainage pipe with the same material and structure as the drainage pipe to be inspected, a panoramic image of the inner wall of the non-defective drainage pipe is collected by the same method as steps 1 and 2, and the pixel points in the panoramic image of the inner wall of the non-defective drainage pipe are used as reference pixel points of the pixel points in the panoramic image of the inner wall of the drainage pipe to be inspected, a spectral matrix of the reference pixel points is constructed, and the spectral mean and spectral standard deviation of the reference pixel points are calculated based on the spectral matrix;
[0081] In this embodiment, when collecting images in a non-defective drainage pipe with the same material and structure as the drainage pipe to be inspected, ensure that the angle of collection and the light intensity at different wavelengths are consistent with the panoramic image of the drainage pipe to be inspected, and only change the size of the wavelength;
[0082] In this embodiment, the principle for generating the spectral matrix, spectral mean and spectral standard deviation of the reference pixel point is as follows:
[0083] The spectral matrix of the defect-free drainage pipe image is:
[0084] ;
[0085] in, Represents pixel The spectral matrix of the reference pixel at all wavelengths, Represents pixel The reference pixel is at Spectral values at wavelengths;
[0086] The formula for generating the spectral mean and spectral standard deviation is:
[0087] ;
[0088] ;
[0089] in, Represents pixel The mean spectral value of the control pixel point, Represents pixel The standard deviation of the reference pixel spectrum.
[0090] The spectral mean represents the average value of the spectral characteristics of each wavelength in the case of no defects, reflecting the ability of the inner wall of the drainage pipe to reflect, absorb and transmit light of different wavelengths under normal conditions; the spectral standard deviation represents the distribution around the spectral mean in the case of no defects, reflecting the variation range and consistency of the spectral characteristics.
[0091] Step 4: Based on the spectral matrix of the pixel point and the reference pixel point, generate the Euclidean distance between the pixel point and the reference pixel point, integrate the spectral mean and spectral standard deviation, generate the spectral threshold of the pixel point in the panoramic image of the inner wall of the drainage pipe to be detected, and generate a defect judgment index for judging whether the pixel point is a defective pixel point based on the Euclidean distance and the spectral threshold;
[0092] In this embodiment, the principle for determining whether a pixel is a defective pixel is as follows:
[0093] Generate the Euclidean distance between each pixel and its reference pixel based on the formula:
[0094] ;
[0095] in, Represents pixel The Euclidean distance between its reference pixel;
[0096] The Euclidean distance reflects the difference between the spectral characteristics of the panoramic image to be detected and the defect-free sample image. Whether the pixel is a defective pixel is determined based on the size of the difference. A larger Euclidean distance indicates a larger difference from the defect-free sample image, which may be a defective pixel. The Euclidean distance is compared with the set spectral defect threshold to accurately identify which pixels are defective.
[0097] The formula used to generate the spectral defect threshold is:
[0098] ;
[0099] in, Represents pixel The spectral defect threshold, represents the threshold adjustment constant;
[0100] The mean indicates the center position of the data, and the standard deviation indicates the degree of dispersion of the data. 68% of the data points fall within the range of the mean ± one standard deviation, and 95% of the data points fall within the range of the mean ± two standard deviations. Using the mean plus the standard deviation to set the threshold can effectively cover most of the data points.
[0101] The spectral defect threshold is set based on the spectral mean and spectral standard deviation of the defect-free sample to determine a normal range. When the Euclidean distance of the pixel to be detected is within the defect threshold, it can be determined that the pixel is not a defective pixel. Represents the threshold adjustment constant, which is used to control sensitivity and is determined based on expert analysis The specific value of The larger the value, the larger the spectral defect threshold, which reduces the sensitivity to defects and reduces false alarms, but may ignore defects and cause missed alarms. The smaller the value, the smaller the spectral defect threshold, which increases the sensitivity to defects and can detect more defects, but increases the risk of false alarms. or 2.
[0102] The formula for generating the defect judgment index is:
[0103] ;
[0104] in, Represents pixel Defect judgment index;
[0105] when When , the pixel is a defective pixel;
[0106] when , the pixel is not a defective pixel.
[0107] The defect judgment index reflects the similarity between the spectral characteristics of the image to be detected and the spectral characteristics of the defect-free sample. The lower the defect judgment index, the more similar the spectral characteristics of the image to be detected and the defect-free sample are. Conversely, the more dissimilar they are. When the defect judgment index exceeds 1, it means that the Euclidean distance of the current pixel is greater than the spectral defect threshold, indicating that the pixel is a defective pixel.
[0108] Step 5: Extract all regions containing defective pixels, count the number of defective pixels in each region, generate the area of the defective region, extract the edge pixels of the defective region, generate the length of the defective boundary, generate the circularity based on the area of the defective region and the length of the defective boundary, and generate the aspect ratio of the circumscribed rectangle of the defective region;
[0109] In this embodiment, the actual area represented by each pixel is equal;
[0110] In this embodiment, the formula for generating the circularity based on the defect area and the defect boundary length is:
[0111] ;
[0112] ;
[0113] in, represents the defect area, Indicates the number of defective pixels in the defective area, Represents the actual area of the pixel. Indicates the circularity of the defect area, Indicates the defect boundary length;
[0114] The circularity reflects the regularity of the defect area. The circularity value is between 0 and 1. The closer it is to 1, the closer the defect area is to a circle. The closer it is to 0, the more irregular the shape of the defect area is. The circularity is used to judge the regularity of the defect area, and then the defect is determined according to the shape characteristics of different defects.
[0115] The formula for generating the aspect ratio of the bounding rectangle is:
[0116] ;
[0117] in, represents the aspect ratio, Represents the length of the circumscribed rectangle, Indicates the width of the bounding rectangle.
[0118] The aspect ratio of the circumscribed rectangle is used to reflect the shape characteristics of the defect area. A defect area with an aspect ratio close to 1 is close to a square or a circle, while an aspect ratio far greater than 1 or far less than 1 indicates that the defect area is slender or irregular in shape. It is mainly used to identify slender defect areas, such as cracks.
[0119] Step 6: Preliminarily determine the defect type based on the boundary length, circularity and aspect ratio of the circumscribed rectangle of the defect area, and the defect type includes cracks, corrosion and holes.
[0120] First, make a preliminary judgment on several common defect types inside the drainage pipe. The characteristics of cracks are: longer boundary length, higher aspect ratio, and smaller area; the characteristics of corrosion parts are: irregular shape and larger area; the characteristics of holes are: more regular shape;
[0121] In this embodiment, the principle for preliminarily judging the defect type is as follows:
[0122] when and When , the defect area is marked as a crack, which means that the defect area has a high aspect ratio and a small area, which meets the shape characteristics of the crack;
[0123] when and When , the defect area is marked as corrosion, which means that the defect area is large and irregular, and meets the defect shape characteristics caused by corrosion;
[0124] when and When , the defect area is marked as a hole, which means that the defect area tends to be circular and meets the shape characteristics of a hole;
[0125] in, Indicates the preset defect area threshold, Indicates the preset circularity threshold.
[0126] By collecting known data of different defects, including the affected area, the defect area thresholds are set for different defects according to the statistical results; the circularity threshold is set to 0.7. When When the defect is round, the defect is considered to be circular.
[0127] See also Figure 2 The present invention also provides a defect detection device based on a panoramic image of the inner wall of a drainage pipe, the device is used to implement the above-mentioned defect detection method based on a panoramic image of the inner wall of a drainage pipe, specifically comprising:
[0128] An image acquisition module is used to acquire panoramic images of the inner wall of the drainage pipe to be inspected under different wavelength conditions based on a multispectral camera, and map the wavelengths and corresponding panoramic images one by one;
[0129] A feature extraction module is used to select a panoramic image of one wavelength to establish a plane rectangular coordinate system, and map the plane rectangular coordinate system to panoramic images of other wavelengths, extract the spectral value of the same pixel in the panoramic images of different wavelengths, and construct a spectral matrix of the pixel points;
[0130] The feature pre-collection module is used to collect a panoramic image of the inner wall of a non-defective drainage pipe with the same material and structure as the drainage pipe to be detected by using the same method as the image acquisition module and the feature extraction module, and use the pixel points in the panoramic image of the inner wall of the non-defective drainage pipe as the reference pixel points of the pixel points in the panoramic image of the inner wall of the drainage pipe to be detected, construct a spectral matrix of the reference pixel points, and calculate the spectral mean and spectral standard deviation of the reference pixel points based on the spectral matrix;
[0131] A defect judgment module is used to generate the Euclidean distance between the pixel and the reference pixel based on the spectral matrix of the pixel and the reference pixel, integrate the spectral mean and the spectral standard deviation, generate the spectral threshold of the pixel in the panoramic image of the inner wall of the drainage pipe to be detected, and generate a defect judgment index for judging whether the pixel is a defective pixel based on the Euclidean distance and the spectral threshold;
[0132] The defect analysis module is used to extract all areas containing defective pixels in any panoramic image of the inner wall of the drainage pipe to be inspected, count the number of defective pixels in each area, generate the area of the defective area, extract the edge pixels of the defective area, generate the length of the defective boundary, generate the circularity based on the area of the defective area and the length of the defective boundary, and generate the aspect ratio of the circumscribed rectangle of the defective area;
[0133] The defect classification module is used to preliminarily determine the defect type based on the boundary length, circularity and aspect ratio of the defect area, including cracks, corrosion and holes. The above formulas are all dimensionless and numerical calculations. The formula is a formula obtained by collecting a large amount of data and performing software simulation to obtain the most recent real situation. The preset parameters in the formula are set by technicians in this field according to actual conditions.
[0134] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product. Those skilled in the art may appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software methods depends on the specific application and design constraints of the technical solution.
[0135] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0136] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.
Claims
1. A defect detection method based on a panoramic image of the inner wall of a drainage pipe, characterized in that: The specific steps include: Step 1: Using a multispectral camera to collect panoramic images of the inner wall of the drainage pipe to be inspected under different wavelength conditions, and map the wavelengths and the corresponding panoramic images one by one; Step 2: Select a panoramic image of one wavelength to establish a plane rectangular coordinate system, and map the plane rectangular coordinate system to panoramic images of other wavelengths, extract the spectral values of the same pixel in the panoramic images of different wavelengths, and construct a spectral matrix of the pixel points; Step 3: Based on a non-defective drainage pipe with the same material and structure as the drainage pipe to be inspected, a panoramic image of the inner wall of the non-defective drainage pipe is collected by the same method as steps 1 and 2, and the pixel points in the panoramic image of the inner wall of the non-defective drainage pipe are used as reference pixel points of the pixel points in the panoramic image of the inner wall of the drainage pipe to be inspected, a spectral matrix of the reference pixel points is constructed, and the spectral mean and spectral standard deviation of the reference pixel points are calculated based on the spectral matrix; Step 4: Based on the spectral matrix of the pixel point and the reference pixel point, generate the Euclidean distance between the pixel point and the reference pixel point, integrate the spectral mean and spectral standard deviation, generate the spectral threshold of the pixel point in the panoramic image of the inner wall of the drainage pipe to be detected, and generate a defect judgment index for judging whether the pixel point is a defective pixel point based on the Euclidean distance and the spectral threshold; Step 5: extract all regions containing defective pixels in any panoramic image of the inner wall of the drainage pipe to be inspected, count the number of defective pixels in each region, generate the area of the defective region, extract the edge pixels of the defective region, generate the length of the defective boundary, generate the circularity based on the area of the defective region and the length of the defective boundary, and generate the aspect ratio of the circumscribed rectangle of the defective region; Step 6: Preliminarily determine the defect type based on the boundary length, circularity and aspect ratio of the circumscribed rectangle of the defect area, and the defect type includes cracks, corrosion and holes.
2. The defect detection method based on the panoramic image of the inner wall of the drainage pipe according to claim 1 is characterized in that: The band range of the multispectral camera selected in step 1 is 400nm~900nm, including the visible light band and the near infrared band. Within this band range, starting from 400nm, an image is collected every 50nm.
3. The defect detection method based on the panoramic image of the inner wall of the drainage pipe according to claim 1 is characterized in that: The formula for constructing the spectral matrix of the pixel points in step 2 is: ; in, Indicates that in the panoramic image of the inner wall of the drainage pipe to be detected, the coordinates are The spectral matrix of pixels at all wavelengths, The coordinates are The pixel point is The spectral value at wavelength, represents the index of the wavelength, and , Indicates the number of wavelength types.
4. The defect detection method based on the panoramic image of the inner wall of the drainage pipe according to claim 3 is characterized in that: The principle for generating the spectral matrix, spectral mean and spectral standard deviation of the reference pixel is: The spectral matrix of the reference pixel is: ; in, Represents pixel The spectral matrix of the reference pixel at all wavelengths, Represents pixel The reference pixel is at Spectral values at wavelengths; The formula for generating the spectral mean and spectral standard deviation is: ; ; in, Represents pixel The mean spectral value of the control pixel point, Represents pixel The standard deviation of the reference pixel spectrum.
5. The defect detection method based on the panoramic image of the inner wall of the drainage pipe according to claim 4 is characterized in that: The principle for judging whether a pixel is a defective pixel is as follows: Generate the Euclidean distance between each pixel and its reference pixel based on the formula: ; in, Represents pixel The Euclidean distance between its reference pixel; The formula used to generate the spectral defect threshold is: ; in, Represents pixel The spectral defect threshold, represents the threshold adjustment constant; The formula for generating the defect judgment index is: ; in, Represents pixel Defect judgment index; when When , the pixel is a defective pixel; when , the pixel is not a defective pixel.
6. The defect detection method based on the panoramic image of the inner wall of the drainage pipe according to claim 1 is characterized by: The formula for generating the circularity based on the defect area and the defect boundary length in step 5 is: ; ; in, represents the defect area, Indicates the number of defective pixels in the defective area, Represents the actual area of the pixel. Indicates the circularity of the defect area, Indicates the defect boundary length; The formula for generating the aspect ratio of the bounding rectangle is: ; in, represents the aspect ratio, Represents the length of the circumscribed rectangle, Indicates the width of the bounding rectangle.
7. The defect detection method based on the panoramic image of the inner wall of the drainage pipe according to claim 6 is characterized in that: The principle for preliminary judgment of defect types is: when and When , the defective area is marked as a crack; when and When , the defective area is marked as corrosion; when and When , the defective area is marked as a hole; in, Indicates the preset defect area threshold, Indicates the preset circularity threshold.
8. A defect detection device based on a panoramic image of the inner wall of a drainage pipe, characterized in that: The device is used to implement the defect detection method based on the panoramic image of the inner wall of the drainage pipe according to any one of claims 1 to 7, and specifically includes: An image acquisition module is used to acquire panoramic images of the inner wall of the drainage pipe to be inspected under different wavelength conditions based on a multispectral camera, and map the wavelengths and corresponding panoramic images one by one; A feature extraction module is used to select a panoramic image of one wavelength to establish a plane rectangular coordinate system, and map the plane rectangular coordinate system to panoramic images of other wavelengths, extract the spectral value of the same pixel in the panoramic images of different wavelengths, and construct a spectral matrix of the pixel points; The feature pre-collection module is used to collect a panoramic image of the inner wall of a non-defective drainage pipe with the same material and structure as the drainage pipe to be detected by using the same method as the image acquisition module and the feature extraction module, and use the pixel points in the panoramic image of the inner wall of the non-defective drainage pipe as the reference pixel points of the pixel points in the panoramic image of the inner wall of the drainage pipe to be detected, construct a spectral matrix of the reference pixel points, and calculate the spectral mean and spectral standard deviation of the reference pixel points based on the spectral matrix; A defect judgment module is used to generate the Euclidean distance between the pixel and the reference pixel based on the spectral matrix of the pixel and the reference pixel, integrate the spectral mean and the spectral standard deviation, generate the spectral threshold of the pixel in the panoramic image of the inner wall of the drainage pipe to be detected, and generate a defect judgment index for judging whether the pixel is a defective pixel based on the Euclidean distance and the spectral threshold; The defect analysis module is used to extract all areas containing defective pixels in any panoramic image of the inner wall of the drainage pipe to be inspected, count the number of defective pixels in each area, generate the area of the defective area, extract the edge pixels of the defective area, generate the length of the defective boundary, generate the circularity based on the area of the defective area and the length of the defective boundary, and generate the aspect ratio of the circumscribed rectangle of the defective area; The defect classification module is used to preliminarily determine the defect type based on the boundary length, circularity and aspect ratio of the circumscribed rectangle of the defect area, and the defect types include cracks, corrosion and holes.
Citation Information
Patent Citations
Defect detection method for panoramic image of inner wall of drainage pipeline and image acquisition robot
CN114742797A
Steel pipe defect intelligent detection method
CN114937039A