Composite pipe quality inspection method and system based on machine vision

Through machine vision technology, texture symmetry lines and analysis symmetry points are used, combined with grayscale differences and distance changes, the actual crack points are accurately selected, which solves the problem of texture interference in the detection of corrugated composite tubes and improves detection accuracy.

CN118657759BActive Publication Date: 2024-11-08SHAANXI YONGCUN NEW MATERIAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411125376.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-11-08
Estimated Expiration
2044-08-16

AI Technical Summary

Technical Problem

In the internal quality detection of corrugated composite tubes, detection errors are caused by changes in gradients between texture and cracks, which affects detection accuracy.

Method used

Using a machine vision-based method, by obtaining the grayscale image of the inner tube, determining the texture symmetry line and analyzing the symmetry points, combining the grayscale difference and distance change trend, the actual crack points are accurately selected for detection.

Benefits of technology

The accuracy of quality detection of corrugated composite pipes is improved, the probability that textured pixel points are mistakenly identified as crack points is reduced, and the reliability of detection is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118657759B_ABST
    Figure CN118657759B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image analysis technology, and in particular to a composite pipe quality detection method and system based on machine vision. The method obtains the pixel points of the symmetrical position of each suspected crack point about the texture symmetry line in the grayscale image inside the pipe, that is, the analysis symmetry point of each suspected crack point; according to the grayscale difference of each suspected crack point and its analysis symmetry point and the pixel points on the straight line determined by the shooting center point, and the change trend of the distance between each analysis symmetry point and the adjacent suspected crack points on the straight line determined by the shooting center point, the actual crack point is obtained, and the pipe quality of the composite pipe is detected using the actual crack point. The present invention selects the actual crack point from the suspected crack point based on the symmetry characteristics of the internal texture of the pipe, reduces the interference of the pipe structure texture on crack detection, and improves the accuracy of pipe quality detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image analysis, and in particular to a composite pipe material quality detection method and system based on machine vision. Background Art

[0002] Corrugated composite pipes can enhance the flexibility and pressure resistance of pipes, and can be used to reduce vibration and shock caused by pumps or mechanical equipment in the pipeline system, protect other equipment and pipes in the system, and make corrugated composite pipes widely used in industries, automobiles, aerospace, etc. Improper operation or the influence of the external environment in the general production process may cause cracks inside the composite pipe. The existence of cracks leads to safety risks during the use of the composite pipe, so it is particularly important to conduct quality inspection on the inside of the corrugated composite pipe.

[0003] Existing methods usually use edge detection algorithms to detect cracks inside corrugated composite pipes when performing quality inspection on them. The special structure of the corrugated composite pipe produces texture inside the pipe. Since both the texture and cracks inside the pipe have large gradient changes, the texture inside the pipe will cause serious interference to crack detection, resulting in errors in crack detection inside the pipe, which in turn leads to inaccurate quality inspection of the corrugated composite pipe. Summary of the invention

[0004] In order to solve the technical problem that the internal texture of the corrugated composite pipe interferes with the crack detection, resulting in inaccurate pipe quality detection of the corrugated composite pipe, the purpose of the present invention is to provide a composite pipe quality detection method and system based on machine vision, and the technical scheme adopted is as follows:

[0005] In a first aspect, an embodiment of the present invention provides a composite pipe quality detection method based on machine vision, the method comprising:

[0006] Obtain suspected crack points in the grayscale image inside the composite pipe;

[0007] Based on the position distribution of the suspected crack points in the grayscale image inside the pipe, the shooting center point and the texture symmetry line are obtained; according to the pixel points of the symmetrical position of each suspected crack point in the grayscale image inside the pipe about the texture symmetry line, the analysis symmetry point of each suspected crack point is obtained;

[0008] According to the grayscale difference between each suspected crack point and all its analyzed symmetrical points and the pixel points on the straight line determined by the camera center point, and the change trend of the distance between each analyzed symmetrical point of each suspected crack point and the adjacent suspected crack points on the straight line determined by the shooting center point, the actual crack point is selected from the suspected crack points;

[0009] The pipe quality of the composite pipe is detected based on the actual crack points.

[0010] Furthermore, the method for obtaining the shooting center point and the texture symmetry line based on the position distribution of the suspected crack points in the grayscale image inside the pipe includes:

[0011] Perform circle fitting on the suspected crack points in the grayscale image inside the pipe, and use the closed curve obtained by fitting as the texture contour;

[0012] The number of pixels in the area formed by each texture contour is counted and recorded as the area index of the corresponding texture contour, and the texture contour corresponding to the smallest area index is used as the target contour; the precise center of the target contour is obtained based on the distance from the pixel point in the target contour to the texture contour, and recorded as the shooting center point;

[0013] The texture symmetry line is obtained by performing straight line fitting on the precise circle centers of all texture contours.

[0014] Furthermore, the method for obtaining the precise center of the target contour based on the distance from the pixel point in the target contour to the texture contour includes:

[0015] At least two suspected center points are selected from the area formed by the target contour, and at least two reference points are selected from the target contour; discrete indicators of the distances between each suspected center point and all reference points are used as judgment indicators for each suspected center point; and the suspected center point corresponding to the smallest judgment indicator is used as the precise center of the target contour.

[0016] Furthermore, the method for obtaining the analysis symmetric point of each suspected crack point includes:

[0017] Select any suspected crack point from the grayscale image inside the pipe as the test point, draw a straight line passing through the test point and the shooting center point, and record it as the analysis line of the test point; record the angle between the analysis line and the texture symmetry line as the reference angle of the test point, and record the distance from the test point to the texture symmetry line as the reference distance of the test point;

[0018] The pixel points in the grayscale image inside the pipe are divided into two categories according to the texture symmetry line, and the pixel points of another category except the category to which the test point belongs are recorded as the selected symmetric points of the test point, and the reference symmetric point of the test point is selected from the selected symmetric points; the angle between the analysis line of the reference symmetric point and the texture symmetry line is equal to the reference angle, and the distance from the reference symmetric point to the texture symmetry line is equal to the reference distance; the pixel points within a preset range of the reference symmetric point are recorded as the analysis symmetric points of the test point.

[0019] Furthermore, the method of selecting an actual crack point from suspected crack points includes:

[0020] For each suspected crack point in the grayscale image inside the pipe, the original grayscale consistency index between the suspected crack point and all its analyzed symmetrical points is obtained according to the grayscale difference between the suspected crack point and the pixels on the straight line determined by the camera center point;

[0021] Obtaining a grayscale weight coefficient of each analysis symmetric point of the suspected crack point according to a change trend of the distance between adjacent suspected crack points on a straight line determined by each analysis symmetric point of the suspected crack point and the shooting center point;

[0022] The original grayscale consistency index is adjusted using the grayscale weight coefficient to obtain a corrected grayscale consistency index of the suspected crack point; when the corrected grayscale consistency index is less than a preset threshold, the suspected crack point is an actual crack point.

[0023] Furthermore, the method for obtaining the original grayscale consistency index of the suspected crack point and each of its analyzed symmetric points includes:

[0024] The point to be tested and its analysis symmetrical point are recorded as the target point, and on the analysis line of the target point, the pixel points within the preset window of the target point are sequentially arranged to obtain a neighborhood pixel sequence of the target point;

[0025] The cumulative sum of the grayscale value differences between the point to be tested and each of its analyzed symmetrical points and the pixel points at the same position in the neighborhood pixel sequence is negatively correlated to obtain the original grayscale consistency index between the point to be tested and each of its analyzed symmetrical points.

[0026] Furthermore, the method for obtaining the grayscale weight coefficient of each analysis symmetric point of the suspected crack point includes:

[0027] Select any one of the analysis symmetrical points of the point to be measured as the analysis point, take the shooting center point as the endpoint, draw a ray passing through the analysis point, and record it as the analysis ray of the analysis point; arrange the suspected crack points on the analysis ray in order to obtain a suspected crack point sequence of the analysis point;

[0028] Arrange the distances between each suspected crack point and its next adjacent suspected crack point in the suspected crack point sequence in order to obtain a distance sequence of analysis points; and obtain a first-order difference sequence of the distance sequence;

[0029] An interval change value is set, and an initial value of the interval change value is a constant of 0; the first element in the first-order difference sequence is taken as the element to be updated, and it is determined whether the signs of the element to be updated and its next adjacent element are equal. If so, the interval change value remains unchanged; if not, the interval change value is updated, and the sum of the interval change value and the constant 1 is taken as the updated interval change value; the next adjacent element of the element to be updated is taken as the new element to be updated, and it is determined whether the signs of the new element to be updated and its next adjacent element are equal, the first-order difference sequence is traversed, and the updated interval change value is negatively correlated and normalized to obtain the grayscale weight coefficient of the analysis point.

[0030] Furthermore, the method of adjusting the original grayscale consistency index by using the grayscale weight coefficient to obtain a corrected grayscale consistency index of a suspected crack point includes:

[0031] According to the original grayscale consistency index of the suspected crack point and all its analyzed symmetrical points and the grayscale weight coefficient, a weighted average value of the suspected crack point is obtained, and the weighted average value is normalized to obtain a corrected grayscale consistency index of the suspected crack point.

[0032] Furthermore, the suspected crack point is an edge pixel point obtained by edge detection of the grayscale image inside the pipe.

[0033] In a second aspect, another embodiment of the present invention provides a composite pipe quality inspection system based on machine vision, the system comprising:

[0034] A data acquisition module, used to obtain suspected crack points in the grayscale image inside the composite pipe;

[0035] A symmetry point acquisition module is used to acquire the shooting center point and the texture symmetry line based on the position distribution of the suspected crack points in the grayscale image inside the pipe; and to obtain the analysis symmetry point of each suspected crack point according to the pixel points of the symmetric position of each suspected crack point in the grayscale image inside the pipe about the texture symmetry line;

[0036] A crack point selection module is used to select actual crack points from suspected crack points based on the grayscale differences between each suspected crack point and all its analyzed symmetrical points and the pixel points on the straight line determined by the camera center point, as well as the change trend of the distance between each analyzed symmetrical point of each suspected crack point and the adjacent suspected crack points on the straight line determined by the shooting center point;

[0037] The composite pipe quality detection module is used to detect the pipe quality of the composite pipe based on the actual crack point.

[0038] The present invention has the following beneficial effects:

[0039] In an embodiment of the present invention, the internal texture of the pipe is an axisymmetric figure. This scheme determines the actual crack point through the symmetry characteristics of the internal texture structure of the pipe. First, it is necessary to obtain the texture symmetry line and the shooting center point; the application method of the texture symmetry characteristics is: the grayscale distribution in the local range of the texture pixel point and the pixel point at the symmetric position with respect to the texture symmetry line is relatively close to the texture structure, while the grayscale distribution in the local range of the crack pixel point and the pixel point at the symmetric position with respect to the texture symmetry line is different from the texture structure; in order to analyze the texture symmetry characteristics of the suspected crack point, first determine the pixel point at the symmetric position of the suspected crack point with respect to the texture symmetry line, that is, the analysis symmetric point of the suspected crack point; the grayscale difference between the suspected crack point and all its analysis symmetric points and the pixel points on the straight line determined by the camera center point, showing the suspected crack point. The degree to which the texture points conform to the texture symmetry characteristics, analyzing the symmetric points as the pixel points of the crack position will reduce the accuracy of judging the texture symmetry of the suspected crack points. The distance between adjacent texture contours in a group of texture contours composed of the internal texture of the pipe shows a trend of gradually increasing or decreasing. Therefore, combined with the grayscale difference of the pixel points on the straight line determined by the suspected crack point and its analyzed symmetric point and the center point of the camera, the changing trend of the distance between the adjacent suspected crack points on the straight line determined by the analyzed symmetric point of the suspected crack point and the shooting center point is analyzed, which can effectively improve the accuracy of judging the texture symmetry of the suspected crack point and reduce the probability of texture pixels being misidentified as actual crack points; finally, the pipe quality of the composite pipe is tested based on the actual crack points to improve the accuracy of pipe quality detection of corrugated composite pipes. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 A flow chart of the steps of a composite pipe quality inspection method based on machine vision provided by one embodiment of the present invention;

[0042] Figure 2 A schematic diagram of a grayscale image of the interior of a pipe provided by an embodiment of the present invention;

[0043] Figure 3 A schematic diagram of the internal texture structure deviation of a pipe provided by an embodiment of the present invention;

[0044] Figure 4 A flowchart of the steps of a method for obtaining actual crack points provided by an embodiment of the present invention;

[0045] Figure 5 A structural diagram of a composite pipe material quality inspection system based on machine vision provided by one embodiment of the present invention;

[0046] Figure 6 A computer device schematic diagram of a composite pipe material quality inspection device based on machine vision provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0047] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the composite pipe quality detection method and system based on machine vision proposed by the present invention, its specific implementation method, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0048] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0049] The following is a detailed description of a method and system for detecting quality of composite pipes based on machine vision provided by the present invention in conjunction with the accompanying drawings.

[0050] Embodiment 1:

[0051] The present invention proposes a composite pipe quality inspection method based on machine vision, please refer to Figure 1 , which shows a flow chart of the steps of a composite pipe quality detection method based on machine vision provided by an embodiment of the present invention, the method comprising:

[0052] Step S1: obtaining suspected crack points in the grayscale image inside the composite pipe.

[0053] This solution mainly tests the quality of corrugated composite pipes. Specifically, a camera is inserted into the composite pipe from the inlet, and the camera is arranged at other positions except the central axis of the composite pipe. The camera is used to capture the internal image of the composite pipe, which is an RGB image. The internal image of the pipe is grayscaled and denoised to obtain a grayscale image of the internal part of the corrugated composite pipe. Figure 2 A schematic diagram of a grayscale image of the interior of a pipe provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown, Figure 2 The black line L1 in the middle is the crack inside the composite tube.

[0054] It should be noted that in the embodiment of the present invention, a weighted average grayscale algorithm is used for grayscale processing, and a Gaussian filter is used for denoising processing. The specific methods are not introduced here, and they are all technical means well known to those skilled in the art. In other embodiments of the present invention, other image acquisition devices and image preprocessing algorithms may also be selected. Image acquisition and image preprocessing algorithms are both technical means well known to those skilled in the art and are not limited here.

[0055] In order to detect cracks inside the pipe, edge detection is performed on the grayscale image inside the pipe, and the obtained edge pixels are recorded as suspected crack points. Due to the special structure of the corrugated composite pipe, texture is generated inside the pipe, and the texture and cracks inside the pipe have large gradient changes. Therefore, the suspected crack points may be crack pixels, i.e., pixels at the crack position, and texture pixels, i.e., pixels at the special texture position inside the pipe.

[0056] Step S2: based on the position distribution of the suspected crack points in the grayscale image inside the pipe, the shooting center point and the texture symmetry line are obtained; according to the pixel points of the symmetrical position of each suspected crack point in the grayscale image inside the pipe about the texture symmetry line, the analysis symmetry point of each suspected crack point is obtained.

[0057] The internal texture of the corrugated composite tube is circular. When the camera is on the central axis of the composite tube, the internal texture of the composite tube appears as a group of concentric circles in the image. When the camera is not on the central axis of the composite tube, the concentric circles formed by the internal texture of the tube are offset as a whole due to the change in the camera shooting angle, and the offset direction is consistent, so the internal texture of the tube is an axisymmetric figure; the arrangement of the circles formed by the offset texture is that each smaller circle is completely contained in the next larger circle, but the centers of the circles do not overlap. Figure 3 FIG. 1 is a schematic diagram of the internal texture structure offset of a pipe provided by an embodiment of the present invention. After the camera is offset to the bottom of the central axis of the composite pipe, the internal texture of the pipe is as follows: Figure 3 As shown, Figure 3 Each circle is the texture outline formed by the internal texture of the composite tube.

[0058] This scheme selects actual crack points from suspected crack points based on the symmetric characteristics of the texture structure in the grayscale image inside the pipe. Therefore, it is necessary to obtain the symmetry axis of the circle formed by the internal texture of the pipe, that is, the texture symmetry line and the shooting center point.

[0059] Step S210: perform circle fitting on the suspected crack points in the grayscale image inside the pipe, and use the closed curve obtained by fitting as the texture contour; count the number of pixels in the area formed by each texture contour, record it as the area index of the corresponding texture contour, and use the texture contour corresponding to the smallest area index as the target contour; obtain the precise center of the target contour based on the distance from the pixel point in the target contour to the texture contour, and record it as the shooting center point.

[0060] It should be noted that, since the texture inside the corrugated composite pipe is circular, it is necessary to perform circular fitting on the suspected crack points, and the texture contour is the texture inside the corrugated composite pipe. The embodiment of the present invention uses the least squares method to perform circular fitting on the suspected crack points; wherein, the least squares method is a well-known technology for those skilled in the art and will not be described in detail here.

[0061] The group of circles formed by the texture structure in the grayscale image inside the pipe will change with the change of the shooting center. When the shooting angle changes, the shooting center of the image is the center of the smallest circle in the group of circles formed by the texture. The target contour is the smallest circle formed by the texture, and the center of the target contour can be recorded as the shooting center point of the image.

[0062] Preferably, in an embodiment of the present invention, the method for obtaining the precise center of the target contour is: randomly select at least two suspected center points from the area formed by the target contour, and randomly select at least two reference points from the target contour; use the discrete indicators of the distance between each suspected center point and all reference points as the judgment indicators of each suspected center point; and use the suspected center point corresponding to the smallest judgment indicator as the precise center of the target contour.

[0063] The method for obtaining the judgment index of the suspected center point is as follows: the pixel points in the circular area with the fitted circle center of the target contour as the center and the preset length as the radius are recorded as the suspected center point; any pixel point on the target contour is selected as the starting point, and multiple pixel points are evenly selected on the target contour as reference points; the Euclidean distance between each suspected center point and all reference points is obtained, and the arithmetic mean difference of the Euclidean distance between each suspected center point and all reference points is used as the judgment index of each suspected center point.

[0064] Since the shooting center point is located at the center of the target contour, the distance between the shooting center point and the reference point on the target contour is equal; if the distance between the suspected center point and the reference point is more discrete, that is, the judgment index is larger, it means that the possibility that the suspected center point is the shooting center point is smaller; if the distance between the suspected center point and the reference point is more concentrated, that is, the judgment index is smaller, it means that the possibility that the suspected center point is the shooting center point is greater.

[0065] It should be noted that in the embodiment of the present invention, the fitting center of the target contour is the target contour calculated during the fitting process; the number of reference points is an empirical value of 10, and on the target contour, the number of pixels between each reference point and the next adjacent reference point in the counterclockwise direction is equal, and the implementer can select the reference point according to the specific situation; the preset length is less than the radius of the target contour. Statistical indicators such as arithmetic mean difference, variance and coefficient of variation can all reflect the degree of discreteness of a set of data. In other embodiments, the arithmetic mean difference can also be replaced by variance or coefficient of variation.

[0066] Step S220: performing straight line fitting on the precise center points of all texture contours to obtain texture symmetry lines.

[0067] If the camera is not on the central axis of the composite tube, all texture contours in the image will be offset and the offset direction will be consistent, so that the center of the texture contour is approximately distributed on a straight line. The straight line is the symmetry axis of the texture structure. The symmetry axis of the texture structure in the image, that is, the texture symmetry line, can be determined by the center of the texture contour.

[0068] Since the composite tube is irregular during the production process or is squeezed during use, the texture profile obtained by circle fitting is not a strict circle, but an approximate circle. Directly using the fitting center of the texture profile for analysis is prone to errors. In the embodiment of the present invention, the precise center of all texture profiles is linearly fitted to obtain the texture symmetry line, such as Figure 3 As shown, Figure 3 The middle dotted line L2 is the texture symmetry line.

[0069] It should be noted that the method for obtaining the precise center of each texture contour is the same as the method for obtaining the precise center of the target contour; in the embodiment of the present invention, the least squares method is used to perform straight line fitting on the precise center of the texture contour, and the obtained fitting straight line is recorded as the texture symmetry line; in another embodiment of the present invention, the Hough straight line can be used for straight line fitting; wherein, the least squares method is a well-known technology for those skilled in the art and will not be described in detail here.

[0070] Step S230: obtaining the analysis symmetric point of each suspected crack point according to the pixel points at the symmetric position of each suspected crack point about the texture symmetry line in the grayscale image inside the pipe.

[0071] This scheme mainly selects actual crack points from suspected crack points based on the symmetry characteristics of the internal texture structure of the pipe. The specific application method of the symmetry characteristics is: the grayscale distribution in the local range of the texture pixel point and the pixel point at the symmetric position with respect to the texture symmetry line is closer to the texture structure, while the grayscale distribution in the local range of the crack pixel point and the pixel point at the symmetric position with respect to the texture symmetry line is different from the texture structure. To screen the actual crack points based on the above basis, it is first necessary to obtain the pixel point at the symmetric position of each suspected crack point with respect to the texture symmetry line, that is, the analysis symmetric point of the suspected crack point.

[0072] Preferably, in some possible implementations of the embodiments of the present invention, the method for obtaining the analysis symmetry point of each suspected crack point includes: randomly selecting a suspected crack point from the grayscale image of the inside of the pipe as the point to be tested, and drawing a straight line passing through the point to be tested and the center point of the shooting, which is recorded as the analysis line of the point to be tested; recording the angle between the analysis line and the texture symmetry line as the reference angle of the point to be tested, and recording the distance from the point to be tested to the texture symmetry line as the reference distance of the point to be tested; dividing the pixel points in the grayscale image of the inside of the pipe into two categories according to the texture symmetry line, recording the pixel points of another category other than the category to which the point to be tested belongs as the selected symmetry points of the point to be tested, and selecting the reference symmetry points of the point to be tested from the selected symmetry points; the angle between the analysis line of the reference symmetry point and the texture symmetry line is equal to the reference angle, and the distance from the reference symmetry point to the texture symmetry line is equal to the reference distance; recording the pixel points within a preset range of the reference symmetry point as the analysis symmetry points of the point to be tested. Figure 3 As shown, Figure 3 The pixel points located on the left side of the texture symmetry line L2 are one type of pixel points, and the pixel points located on the right side of the texture symmetry line L2 are another type of pixel points. The pixel points on the texture symmetry line L2 are not analyzed.

[0073] It should be noted that if the point to be measured is the intersection of any texture contour and texture symmetry line, then this solution considers that the point to be measured is a pixel point at the texture position inside the pipe, that is, a texture pixel point, and no subsequent analysis is required. In the embodiment of the present invention, since there may be errors in the process of determining the shooting center point, resulting in the reference symmetry point of each suspected crack point not being the actual symmetry point of the suspected crack point, the pixel points within the preset range of the reference symmetry point of each suspected crack point are recorded as the analysis symmetry point of each suspected crack point. The reference symmetry point of each suspected crack point is located at the center of its preset range, and the size of the preset range is an empirical value. , implementers can set it according to specific circumstances.

[0074] It should be noted that the method for obtaining the analytical symmetric point of each suspected crack point in the grayscale image inside the pipe is the same as the method for obtaining the analytical symmetric point of the point to be tested; the method for obtaining the analytical line between the point to be tested and the reference symmetric point is the same.

[0075] Step S3: Select the actual crack point from the suspected crack points based on the grayscale difference between each suspected crack point and all its analyzed symmetrical points and the pixel points on the straight line determined by the camera center point, as well as the changing trend of the distance between each analyzed symmetrical point of each suspected crack point and the adjacent suspected crack points on the straight line determined by the shooting center point.

[0076] Since the internal texture of the pipe is symmetrical in the image, while the cracks are irregularly distributed in the image, and the cracks will break the symmetrical expression of the texture in the image, specifically: the texture pixel points have the same grayscale expression as their analytical symmetrical points, while the crack pixel points have different grayscale expressions from their analytical symmetrical points. Therefore, this scheme selects the actual crack points based on the similarity of the grayscale expression of the suspected crack points and their analytical symmetrical points.

[0077] See also Figure 4 , which shows a flowchart of the steps of a method for obtaining actual crack points provided by an embodiment of the present invention, the method comprising:

[0078] Step S310: For each suspected crack point in the grayscale image inside the pipe, obtain the original grayscale consistency index of the suspected crack point and each of its analyzed symmetrical points based on the grayscale difference between the suspected crack point and all of its analyzed symmetrical points and the pixel points on the straight line determined by the camera center point.

[0079] The internal texture structure of the pipe is symmetrical in the image. Compared with simply judging the texture symmetry by the grayscale difference between the suspected crack pixel point and its analyzed symmetrical point, it is more effective to measure the texture symmetry by the grayscale difference between the suspected crack point and the pixel points on the straight line determined by the suspected crack point and its analyzed symmetrical point and the camera center point. The straight line determined by the suspected crack point and the camera center point may pass through multiple texture contours, which can better reflect the internal texture structure of the pipe and improve the accuracy of selecting the actual crack point through the original grayscale consistency index.

[0080] Preferably, in some possible implementation modes of the embodiments of the present invention, the method for obtaining the original grayscale consistency index includes: recording the test point and its analysis symmetrical point as target points, and arranging the pixel points in a preset window of the target point in sequence on the analysis line of the target point to obtain a neighborhood pixel sequence of the target point; performing negative correlation mapping on the cumulative sum of the grayscale value differences of the pixel points at the same position in the neighborhood pixel sequence of the test point and each of its analysis symmetrical points, to obtain the original grayscale consistency index of the test point and each of its analysis symmetrical points.

[0081] It should be noted that the target point is located at the center of its preset window, and the size of the preset window is , the preset window of the target point is parallel to the target line direction of the target point. The implementer can set the length of the preset window according to the specific situation. On the target line of the target point, the pixel point closest to the shooting center point in the preset window of the target point is taken as the starting point, and the pixel points in the preset window of the target point are arranged in sequence along the target line direction, that is, from the shooting center point to the target point, to obtain the neighborhood pixel sequence of the target point; the elements in the neighborhood pixel sequence of the target point are pixel points. The method for obtaining the analysis line of the target point is the same as the method for obtaining the analysis line of the point to be measured.

[0082] Taking the w-th analysis symmetric point of the test point as an example, the original grayscale consistency index between the test point and its w-th analysis symmetric point is expressed as follows:

[0083]

[0084] In the formula, is the original grayscale consistency index between the tested point and its w-th analyzed symmetrical point; N is the total number of elements in the neighborhood pixel sequence of the suspected crack point in the grayscale image inside the pipe; is the gray value of the nth pixel in the neighborhood pixel sequence of the point to be tested; is the gray value of the nth pixel in the neighborhood pixel sequence of the wth symmetrical analysis point of the point to be tested; is an absolute value function; exp is an exponential function with a natural constant e as the base. In the embodiment of the present invention, an exponential function with a natural constant as the base is selected for negative correlation mapping.

[0085] It should be noted that It represents the grayscale difference between the pixel at the same position in the neighborhood pixel sequence of the tested point and its w-th analyzed symmetric point. The smaller the value is, the more consistent the grayscale performance of the pixel points at the symmetrical position on the analysis line between the test point and its w-th analysis symmetrical point is. The larger the value is, the more obvious the texture symmetry feature between the test point and its w-th analysis symmetric point in the direction of the analysis line is, and the greater the possibility that the test point is a pixel point at the texture position inside the pipe.

[0086] Step S320: Obtain the grayscale weight coefficient of each analyzed symmetrical point of the suspected crack point according to the change trend of the distance between each analyzed symmetrical point of the suspected crack point and the adjacent suspected crack points on the straight line determined by the shooting center point.

[0087] The analysis symmetric point of the suspected crack point may be a crack pixel point. If the analysis symmetric point of the suspected crack point is a crack pixel point, the credibility of the original grayscale consistency index between the suspected crack point and its analysis symmetric point is low. It is necessary to set different weights for the original grayscale consistency index of each analysis symmetric point of the suspected crack point to improve the accuracy of the calculation.

[0088] Due to the change in the camera shooting angle, the concentric circles formed by the internal texture of the pipe are offset as a whole and the offset direction is consistent, so that the spacing between adjacent texture contours has a regular change, which is specifically manifested in the image as follows: with the shooting center point as the endpoint, the distance between adjacent texture contours in any direction is gradually increasing or decreasing. Therefore, the grayscale weight coefficient of each analysis symmetric point can be determined by the change trend of the distance between each analysis symmetric point of the suspected crack point and the suspected crack point on the straight line determined by the shooting center point.

[0089] Preferably, in some possible implementations of the embodiments of the present invention, the method for obtaining the grayscale weight coefficient includes: selecting any one point from the analysis symmetric points of the point to be measured as the analysis point, taking the shooting center point as the endpoint, making a ray passing through the analysis point, and recording it as the analysis ray of the analysis point; arranging the suspected crack points on the analysis ray in order to obtain a suspected crack point sequence of the analysis point; arranging the distances between each suspected crack point in the suspected crack point sequence and its next adjacent suspected crack point in order to obtain a distance sequence of the analysis point; obtaining a first-order difference sequence of the distance sequence; setting an interval change value, and the interval change The initial value of the value is a constant 0; the first element in the first-order difference sequence is taken as the element to be updated, and it is determined whether the signs of the element to be updated and its next adjacent element are equal. If so, the interval change value remains unchanged; if not, the interval change value is updated, and the sum of the interval change value and the constant 1 is taken as the updated interval change value; the next adjacent element of the element to be updated is taken as the new element to be updated, and it is determined whether the signs of the new element to be updated and its next adjacent element are equal. The first-order difference sequence is traversed, and the updated interval change value is negatively correlated and normalized to obtain the grayscale weight coefficient of the analysis point.

[0090] It should be noted that on the analysis ray of the analysis point, the suspected crack point closest to the shooting center point is taken as the starting point, and the suspected crack points on the analysis ray of the analysis point are arranged in sequence along the direction of the analysis ray to obtain a suspected crack point sequence of the analysis point. If there is no crack in the direction from the shooting center point to the analysis point, the suspected crack point on the analysis ray of the analysis point is the intersection of the analysis ray and all texture contours; if there is a crack in the direction from the shooting center point to the analysis point, the suspected crack point on the analysis ray of the analysis point includes: the intersection of the analysis ray and all texture contours, the suspected crack point at the crack position; and the suspected crack point at the crack position will destroy the distance between adjacent texture contours and show a trend of gradually increasing or decreasing. When the suspected crack point at the crack position destroys the above trend more seriously, the credibility of the original grayscale consistency index between the test point and the analysis point is lower, and a smaller grayscale weight coefficient should be set. The elements in the distance sequence are the Euclidean distances between two adjacent pixels in the suspected crack point sequence.

[0091] As an example, if the first-order difference sequence of the distance sequence of the analysis point is X1 (1, 2, -1, 4), element 1 is used as the element to be updated, and both element 1 and element 2 are positive numbers, which satisfies the distance between adjacent texture contours showing a trend of gradually increasing, and the interval change value remains unchanged, which is still a constant 0. Element 2 is used as a new element to be updated; element 2 has a different sign from element -1, which destroys the distance between adjacent texture contours and shows a trend of gradually increasing. There are actual crack points in the suspected crack points corresponding to the position of element -1. The interval change value is added with a constant 1, and the updated interval change value is 1. Element -1 is used as a new element to be updated; element -1 has a different sign from element 4, which destroys the distance between adjacent texture contours and shows a trend of gradually decreasing. There are actual crack points in the suspected crack points corresponding to the position of element 4. The interval change value is added with a constant 1, and the updated interval change value is 2; after traversing the first-order difference sequence X1, the updated interval change value is 2. If the first-order difference sequence of the distance sequence of the analysis point is X2 (1, 2, 1, 4), the final updated interval change value is 0.

[0092] When the interval change value is larger, the distance between adjacent texture contours shows a trend of gradually increasing or decreasing. The more serious the degree of damage, the more cracks the analysis ray of the analysis point passes through, and the lower the credibility of the original grayscale consistency index between the test point and the analysis point. A smaller grayscale weight coefficient should be set. Therefore, it is necessary to negatively correlate and normalize the updated interval change value to obtain the grayscale weight coefficient of the analysis point. It should be noted that the embodiment of the present invention performs negative correlation and normalization processing through exp (-x), and replaces the independent variable x with the final updated interval change value.

[0093] It should be noted that the method for obtaining the grayscale weight coefficient of each analysis symmetric point of each suspected crack point in the grayscale image inside the pipe is the same as the method for obtaining the grayscale weight coefficient of the analysis point.

[0094] Step S330: Use the grayscale weight coefficient to adjust the original grayscale consistency index to obtain a corrected grayscale consistency index of the suspected crack point; when the corrected grayscale consistency index is less than a preset threshold, the suspected crack point is an actual crack point.

[0095] Preferably, the method for obtaining the corrected grayscale consistency index of the suspected crack point is: according to the original grayscale consistency index and grayscale weight coefficient of the suspected crack point and all its analyzed symmetrical points, the weighted average value of the suspected crack point is obtained, and the weighted average value is normalized to obtain the corrected grayscale consistency index of the suspected crack point. Taking the vth suspected crack point in the grayscale image inside the pipe as an example for analysis, the corrected grayscale consistency index of the suspected crack point is expressed by the formula:

[0096]

[0097] In the formula, is the corrected grayscale consistency index of the vth suspected crack point in the grayscale image inside the pipe; It is the original grayscale consistency index between the vth suspected crack point and its wth analysis symmetric point in the grayscale image inside the pipe; is the grayscale weight coefficient of the wth analysis symmetric point of the vth suspected crack point in the grayscale image inside the pipe; W is the total number of analysis symmetric points of the vth suspected crack point in the grayscale image inside the pipe; Norm is the normalization function.

[0098] The larger the corrected grayscale consistency index of the suspected crack point, the more similar and accurate the grayscale distribution of the suspected crack point and its analyzed symmetric point and the pixel points on the straight line determined by the camera center point, the greater the possibility that the vth suspected crack point is a pixel point at the internal texture position of the pipe. When the corrected grayscale consistency index of the suspected crack point is less than the preset threshold, the suspected crack point is the actual crack point, that is, the pixel point at the crack position; when the corrected grayscale consistency index of the suspected crack point is greater than or equal to the preset threshold, the suspected crack point is a texture pixel point, that is, a pixel point at the internal texture position of the pipe.

[0099] It should be noted that the preset threshold is an empirical value of 0.8, and implementers can set it according to specific circumstances.

[0100] Step S4: Detect the quality of the composite pipe based on the actual crack points.

[0101] If there are no actual crack points in the grayscale image inside the pipe, the internal quality of the corrugated composite pipe is good; if there are actual crack points in the grayscale image inside the pipe, a curve fitting is performed on the actual crack points in the grayscale image inside the pipe, and the fitted curve is recorded as a crack. When the number of cracks is less than or equal to the preset number, the internal quality of the corrugated composite pipe is qualified, and when the number of cracks is greater than the preset number, the internal quality of the corrugated composite pipe is unqualified. It should be noted that the preset number is an empirical value of 2, and the implementer can set it according to the specific situation; the method for curve fitting the actual crack points in the grayscale image inside the pipe is the least squares method, where the least squares method is a well-known technology and will not be repeated here.

[0102] So far, the present invention is completed.

[0103] In summary, in an embodiment of the present invention, the pixel points of the symmetrical position of each suspected crack point about the texture symmetry line in the grayscale image inside the pipe are obtained, that is, the analytical symmetric points of each suspected crack point; according to the grayscale difference between each suspected crack point and its analytical symmetric point and the pixel points on the straight line determined by the shooting center point, as well as the change trend of the distance between each analytical symmetric point and the adjacent suspected crack points on the straight line determined by the shooting center point, the actual crack point is obtained, and the pipe quality of the composite pipe is detected using the actual crack point. The present invention selects the actual crack point from the suspected crack points based on the symmetric characteristics of the internal texture of the pipe, reduces the interference of the pipe structure texture on crack detection, and improves the accuracy of pipe quality detection.

[0104] Embodiment 2:

[0105] The present invention proposes a composite pipe quality inspection system based on machine vision, please refer to Figure 5 , which shows a structure diagram of a composite pipe quality inspection system based on machine vision provided by an embodiment of the present invention, the system comprising:

[0106] The data acquisition module 510 is used to obtain suspected crack points in the grayscale image inside the composite pipe;

[0107] The symmetry point acquisition module 520 is used to acquire the shooting center point and the texture symmetry line based on the position distribution of the suspected crack points in the grayscale image of the interior of the pipe; and obtain the analysis symmetry point of each suspected crack point according to the pixel points of the symmetric position of each suspected crack point in the grayscale image of the interior of the pipe about the texture symmetry line;

[0108] A crack point selection module 530 is used to select an actual crack point from the suspected crack points according to the grayscale difference between each suspected crack point and all its analyzed symmetrical points and the pixel points on the straight line determined by the camera center point, and the change trend of the distance between each analyzed symmetrical point of each suspected crack point and the adjacent suspected crack points on the straight line determined by the camera center point;

[0109] The composite pipe quality detection module 540 is used to detect the pipe quality of the composite pipe based on the actual crack points.

[0110] It should be noted that: the equipment provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the composite pipe material quality detection system based on machine vision and the composite pipe material quality detection method based on machine vision provided in the above embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0111] Embodiment 3:

[0112] Figure 6 A computer device schematic diagram of a composite pipe quality inspection device based on machine vision provided by an embodiment of the present invention. For example, Figure 6 As shown, the computer device includes: a memory 601, a processor 602, and a computer program 603 stored in the memory 601 and running on the processor 602, wherein when the processor 602 executes the computer program 603, the computer device can execute any one of the composite pipe quality detection methods based on machine vision introduced above.

[0113] In addition, an embodiment of the present application also protects a device, which may include a memory and a processor, wherein the memory stores an executable program code, and the processor is used to call and execute the executable program code to execute a composite pipe quality detection method based on machine vision provided in an embodiment of the present application.

[0114] In this embodiment, the functional modules of the device can be divided according to the above method example. For example, each functional module can be corresponded, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0115] It should be understood that the device provided in this embodiment is used to execute the above-mentioned composite pipe quality detection method based on machine vision, and thus can achieve the same effect as the above-mentioned implementation method.

[0116] In the case of an integrated unit, the device may include a processing module and a storage module. When the device is applied to a device, the processing module may be used to control and manage the actions of the device. The storage module may be used to support the device to execute mutual program codes, etc.

[0117] The processing module may be a processor or a controller, which may implement or execute various exemplary logic blocks, modules and circuits disclosed in the present application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc. The storage module may be a memory.

[0118] It should be noted that the sequence of the above embodiments of the present invention is for description only and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0119] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0120] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A composite pipe quality inspection method based on machine vision, characterized in that: The method includes: Obtain suspected crack points in the grayscale image inside the composite pipe; Based on the position distribution of the suspected crack points in the grayscale image inside the pipe, the shooting center point and the texture symmetry line are obtained; according to the pixel points of the symmetrical position of each suspected crack point in the grayscale image inside the pipe about the texture symmetry line, the analysis symmetry point of each suspected crack point is obtained; According to the grayscale difference between each suspected crack point and all its analyzed symmetrical points and the pixel points on the straight line determined by the camera center point, and the change trend of the distance between each analyzed symmetrical point of each suspected crack point and the adjacent suspected crack points on the straight line determined by the shooting center point, the actual crack point is selected from the suspected crack points; Detecting the quality of the composite pipe based on the actual crack point; The method for obtaining the shooting center point and the texture symmetry line based on the position distribution of the suspected crack points in the grayscale image inside the pipe includes: Perform circle fitting on the suspected crack points in the grayscale image inside the pipe, and use the closed curve obtained by fitting as the texture contour; The number of pixels in the area formed by each texture contour is counted and recorded as the area index of the corresponding texture contour, and the texture contour corresponding to the smallest area index is used as the target contour; the precise center of the target contour is obtained based on the distance from the pixel point in the target contour to the texture contour, and recorded as the shooting center point; Performing straight line fitting on the precise circle centers of all texture contours to obtain texture symmetry lines; The method for obtaining the analysis symmetric point of each suspected crack point includes: Select any suspected crack point from the grayscale image inside the pipe as the test point, draw a straight line passing through the test point and the shooting center point, and record it as the analysis line of the test point; record the angle between the analysis line and the texture symmetry line as the reference angle of the test point, and record the distance from the test point to the texture symmetry line as the reference distance of the test point; The pixel points in the grayscale image inside the pipe are divided into two categories according to the texture symmetry line, and the pixel points of another category except the category to which the test point belongs are recorded as the selected symmetric points of the test point, and the reference symmetric point of the test point is selected from the selected symmetric points; the angle between the analysis line of the reference symmetric point and the texture symmetry line is equal to the reference angle, and the distance from the reference symmetric point to the texture symmetry line is equal to the reference distance; the pixel points within a preset range of the reference symmetric point are recorded as the analysis symmetric points of the test point.

2. The method for inspecting composite pipe quality based on machine vision according to claim 1, characterized in that: The method for obtaining the precise center of the target contour based on the distance from the pixel point in the target contour to the texture contour comprises: At least two suspected center points are selected from the area formed by the target contour, and at least two reference points are selected from the target contour; discrete indicators of the distances between each suspected center point and all reference points are used as judgment indicators for each suspected center point; and the suspected center point corresponding to the smallest judgment indicator is used as the precise center of the target contour.

3. The method for inspecting composite pipe quality based on machine vision according to claim 1, characterized in that: The method for selecting actual crack points from suspected crack points includes: For each suspected crack point in the grayscale image inside the pipe, the original grayscale consistency index between the suspected crack point and all its analyzed symmetrical points is obtained according to the grayscale difference between the suspected crack point and the pixels on the straight line determined by the camera center point; Obtaining a grayscale weight coefficient of each analysis symmetric point of the suspected crack point according to a change trend of the distance between adjacent suspected crack points on a straight line determined by each analysis symmetric point of the suspected crack point and the shooting center point; The original grayscale consistency index is adjusted using the grayscale weight coefficient to obtain a corrected grayscale consistency index of the suspected crack point; when the corrected grayscale consistency index is less than a preset threshold, the suspected crack point is an actual crack point.

4. The method for inspecting composite pipe quality based on machine vision according to claim 3 is characterized in that: The method for obtaining the original grayscale consistency index of the suspected crack point and each of its analyzed symmetric points includes: The point to be tested and its analysis symmetrical point are recorded as the target point, and on the analysis line of the target point, the pixel points within the preset window of the target point are sequentially arranged to obtain a neighborhood pixel sequence of the target point; The cumulative sum of the grayscale value differences between the point to be tested and each of its analyzed symmetrical points and the pixel points at the same position in the neighborhood pixel sequence is negatively correlated to obtain the original grayscale consistency index between the point to be tested and each of its analyzed symmetrical points.

5. The method for inspecting composite pipe quality based on machine vision according to claim 3 is characterized in that: The method for obtaining the grayscale weight coefficient of each analysis symmetric point of the suspected crack point includes: Select any one of the analysis symmetrical points of the point to be measured as the analysis point, take the shooting center point as the endpoint, draw a ray passing through the analysis point, and record it as the analysis ray of the analysis point; arrange the suspected crack points on the analysis ray in order to obtain a suspected crack point sequence of the analysis point; Arrange the distances between each suspected crack point and its next adjacent suspected crack point in the suspected crack point sequence in order to obtain a distance sequence of analysis points; and obtain a first-order difference sequence of the distance sequence; An interval change value is set, and an initial value of the interval change value is a constant of 0; the first element in the first-order difference sequence is taken as the element to be updated, and it is determined whether the signs of the element to be updated and its next adjacent element are equal. If so, the interval change value remains unchanged; if not, the interval change value is updated, and the sum of the interval change value and the constant 1 is taken as the updated interval change value; the next adjacent element of the element to be updated is taken as the new element to be updated, and it is determined whether the signs of the new element to be updated and its next adjacent element are equal, the first-order difference sequence is traversed, and the updated interval change value is negatively correlated and normalized to obtain the grayscale weight coefficient of the analysis point.

6. The method for inspecting composite pipe quality based on machine vision according to claim 3, characterized in that: The method of adjusting the original grayscale consistency index by using the grayscale weight coefficient to obtain a corrected grayscale consistency index of a suspected crack point includes: According to the original grayscale consistency index of the suspected crack point and all its analyzed symmetrical points and the grayscale weight coefficient, a weighted average value of the suspected crack point is obtained, and the weighted average value is normalized to obtain a corrected grayscale consistency index of the suspected crack point.

7. The method for inspecting composite pipe quality based on machine vision according to claim 1, characterized in that: The suspected crack point is an edge pixel point obtained by edge detection of the grayscale image inside the pipe.

8. A composite pipe quality inspection system based on machine vision, characterized in that: The system includes: A data acquisition module, used to obtain suspected crack points in the grayscale image inside the composite pipe; A symmetry point acquisition module is used to acquire the shooting center point and the texture symmetry line based on the position distribution of the suspected crack points in the grayscale image inside the pipe; and to obtain the analysis symmetry point of each suspected crack point according to the pixel points of the symmetric position of each suspected crack point in the grayscale image inside the pipe about the texture symmetry line; A crack point selection module is used to select actual crack points from suspected crack points based on the grayscale differences between each suspected crack point and all its analyzed symmetrical points and the pixel points on the straight line determined by the camera center point, as well as the change trend of the distance between each analyzed symmetrical point of each suspected crack point and the adjacent suspected crack points on the straight line determined by the shooting center point; A composite pipe quality detection module, used to detect the pipe quality of the composite pipe based on the actual crack point; The method for obtaining the shooting center point and the texture symmetry line based on the position distribution of the suspected crack points in the grayscale image inside the pipe includes: Perform circle fitting on the suspected crack points in the grayscale image inside the pipe, and use the closed curve obtained by fitting as the texture contour; The number of pixels in the area formed by each texture contour is counted and recorded as the area index of the corresponding texture contour, and the texture contour corresponding to the smallest area index is used as the target contour; the precise center of the target contour is obtained based on the distance from the pixel point in the target contour to the texture contour, and recorded as the shooting center point; Performing straight line fitting on the precise circle centers of all texture contours to obtain texture symmetry lines; The method for obtaining the analysis symmetric point of each suspected crack point includes: Select any suspected crack point from the grayscale image inside the pipe as the test point, draw a straight line passing through the test point and the shooting center point, and record it as the analysis line of the test point; record the angle between the analysis line and the texture symmetry line as the reference angle of the test point, and record the distance from the test point to the texture symmetry line as the reference distance of the test point; The pixel points in the grayscale image inside the pipe are divided into two categories according to the texture symmetry line, and the pixel points of another category except the category to which the test point belongs are recorded as the selected symmetric points of the test point, and the reference symmetric point of the test point is selected from the selected symmetric points; the angle between the analysis line of the reference symmetric point and the texture symmetry line is equal to the reference angle, and the distance from the reference symmetric point to the texture symmetry line is equal to the reference distance; the pixel points within a preset range of the reference symmetric point are recorded as the analysis symmetric points of the test point.