A method for detecting surface defects of flat tubes

Through adaptive threshold filtering and B-spline fitting combined with curvature calculation, the problem of difficult detection of wire groove defects on the surface of the microchannel flat tube is solved, and efficient automatic detection effect is achieved.

CN115629078BActive Publication Date: 2025-07-08CHINA JILIANG UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211249616.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-12
Publication Date
2025-07-08
Estimated Expiration
2042-10-12

AI Technical Summary

Technical Problem

The prior art is difficult to accurately detect the wire groove defects on the surface of the microchannel flat tube, resulting in the airtightness and salt spray corrosion resistance, and are easily disturbed by benign defects such as zinc layer or oil stains.

Method used

采用自适应阈值滤波和形态学运算滤除图像噪声后,通过垂直投影直方图和B样条曲线拟合,结合曲率计算,精准定位扁管表面的丝槽缺陷。

Benefits of technology

Fast and accurate detection of wire groove defects on the surface of flat tubes is achieved, improving detection accuracy and reliability of automated detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115629078B_ABST
    Figure CN115629078B_ABST
Patent Text Reader

Abstract

The present invention provides a method for detecting surface defects of flat tubes, comprising the following steps: Step S1, obtaining an image of the flat tube surface and preprocessing it to obtain an image to be extracted; Step S2, equally dividing the image to be extracted into several groups of segmented images of the flat tube; Step S3, statistically analyzing each group of segmented images to obtain a vertical projection histogram, then mapping to obtain a first curve, and performing several B-spline curve fittings on the first curve to obtain a second curve; Step S4, calculating the curvature of each group of second curves to obtain a curvature curve, and locating local peaks in the curvature curve; Step S5, integrating each group of segmented images, sorting and integrating each group of curvature curves according to the corresponding segmented images, positioning the local peaks found in each group of curvature curves as wire groove points in the segmented images in sequence, and connecting every two adjacent located wire groove points to obtain a wire groove line; The advantage of the present invention is that it can accurately determine whether there are wire groove defects on the surface of the flat tube.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of flat tube detection, and more specifically, to a method for detecting surface defects of flat tubes. Background Art

[0002] The microchannel flat tube is a pipeline component that carries a new type of environmentally friendly refrigerant and is increasingly used in air conditioning systems. However, due to its high production difficulty, it is easy to form defects such as pits and holes on the surface of the flat tube during the production process, deteriorating its performance. Therefore, it is very necessary to detect the surface defects of the flat tube. At present, most domestic manufacturers still use traditional manual detection methods or automatic detection. The manual detection method has disadvantages such as low efficiency and poor stability. The existing automatic detection mainly performs deep learning and gray-scale processing after image acquisition and then compares the differences. However, this detection method mainly targets four types of defects on the surface of the flat tube: poor zinc spraying, water stain oxidation, holes or concave holes. These four types of defects are also relatively obvious to the naked eye. Therefore, the detection accuracy of image processing is relatively high. However, there are also wire groove defects on the surface of the flat tube. The wire groove will pose a hidden danger to the airtightness and salt spray corrosion resistance of the microchannel flat tube. The wire groove defects are easily interfered by benign defects such as zinc layers or oil stains. The characteristics of the wire groove defects are easily submerged in the background and are not easily detected by the original image processing method. Therefore, it is difficult to meet the requirements of automatic detection. Summary of the Invention

[0003] Aiming at the deficiencies of the existing technology, the purpose of the present invention is to provide a method for detecting surface defects of flat tubes, which can accurately determine whether there are wire groove defects on the surface of the flat tube.

[0004] To achieve the above purpose, the present invention provides the following technical solutions:

[0005] A method for detecting surface defects of flat tubes, comprising the following steps:

[0006] Step S1, obtaining an image of the flat tube surface and performing preprocessing to obtain an image to be extracted;

[0007] Step S2, equally dividing the image to be extracted into several segmented images of the flat tube;

[0008] Step S3, statistically analyzing each group of the segmented images to obtain a vertical projection histogram, mapping the vertical projection histogram to obtain a first curve, and performing B-spline curve fitting on the first curve several times to obtain a second curve;

[0009] Step S4, calculating the curvature of each group of the second curves to obtain a curvature curve, and finding and locating local peaks in the curvature curve;

[0010] Step S5: Integrate each group of the segmented images, sort and integrate each group of the curvature curves according to the corresponding segmented images, locate the wire groove points in the segmented images successively according to the local peaks found in each group of the curvature curves, and connect every two adjacent located wire groove points to obtain wire groove lines.

[0011] Further, step S31 is also included in step S3. Two endpoints for B-spline curve fitting are selected near the starting point and the ending point of the sub-curve point set in the first curve. A rectangular area is divided according to the coordinates of the two endpoints. Control points are calculated within the rectangular area by the random sampling method. The second curve is calculated according to the control points and the two endpoints by using the B-spline curve fitting formula.

[0012] Further, the first curve is fitted with a cubic B-spline curve to obtain the second curve.

[0013] Further, step S310 is also included in step S31. A range interval of two endpoints and two control points is calculated by performing a regional division arithmetic formula on the sub-curve point set in the first curve. The regional division arithmetic formula is configured as:

[0014]

[0015]

[0016]

[0017]

[0018]

[0019]

[0020] where T0 is a corresponding dispersion threshold representing the control points in the distribution space. is the range interval of the two endpoints. is the range interval of the two control points. are both sub-data point sets, and j and J are both coordinates.

[0021] Further, step S311 is also included in step S31. Any two control points are selected within the range interval of the two control points. The two control points are calculated to obtain target control points through a similarity arithmetic formula representing the similarity between the cubic B-spline curve and the data point set. The similarity arithmetic formula is configured as:

[0022]

[0023]

[0024] Among them, F(x, ζ) is a function, x is a coordinate, and ζ is a random variable. is a candidate sub - contour, which is defined by a combined vector ω of randomly generated control points.

[0025] Furthermore, step S41 is further included in step S4. The curvature value at any point on the second curve is calculated through a curvature formula for the second curve. The central - point curvature is found based on the curvature value, and then a curvature curve is constructed according to the curvature of the corresponding point in the first curve.

[0026] Furthermore, the curvature formula is configured as:

[0027]

[0028] Among them, K(t) is the curvature value at any point on the second curve, P x '(t), P y '(t) are both first - order derivatives, and P x ”(t), P y ”(t) are both second - order derivatives.

[0029] Furthermore, step S411 is further included in step S41. The variable t value of the central point is obtained based on the first - order derivative and second - order derivative of the cubic B - spline curve. The central - point curvature of the second curve after fitting is calculated through the curvature according to the variable t value. The first - order derivative is:

[0030]

[0031] The second - order derivative is:

[0032]

[0033] The curvature calculation formula is:

[0034]

[0035] Furthermore, step S11 is further included in step S1. The surface image of the flat tube is processed through rectification and grayscale to obtain a first expected image.

[0036] Furthermore, step S12 is further included in step S1. The first expected image is processed through adaptive threshold filtering to obtain an image to be extracted.

[0037] Advantages of the present invention: Through optical characteristics, the present invention uses an automatic threshold segmentation method to extract the defective area for discrimination, and locates the wire groove defects based on the peak value of the curvature of the vertical projection histogram. Specifically, after filtering out strong noise in the image through adaptive threshold filtering and morphological operations, the image is evenly divided into multiple segments, and the vertical projection histogram of each segment is statistically calculated. At each point on the histogram curve, the best cubic B-spline fitting curve is solved by random sampling method, and the curvature of its center point is calculated to form the corresponding curvature curve. Then, by finding the local peak of the curvature curve, the position points of the wire groove defects on the flat tube surface are located correspondingly, and the detection and feedback of the wire groove defects on the flat tube surface can be completed quickly and accurately. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 is the flowchart of the defect detection method of the present invention;

[0039] Figure 2 is the comparison diagram of the correction and extraction of the flat tube image in the present invention;

[0040] Figure 3 is the state diagram of the first curve, the second curve and the curvature curve in the present invention;

[0041] Figure 4 is the curve fitting and B-spline curve representation diagram of a selected sub-curve point set in the present invention;

[0042] Figure 5 is the representation diagram of the cubic B-spline curve in the present invention;

[0043] Figure 6 is the regional diagram of the endpoints and control points in the sub-curve point set of the present invention;

[0044] Figure 7 is the effect diagram of wire groove detection in the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0045] The present invention will be further described in detail below with reference to the drawings and embodiments. The same components are denoted by the same reference numerals. It should be noted that the terms "front", "rear", "left", "right", "upper" and "lower" used in the following description refer to the directions in the drawings, and the terms "bottom surface" and "top surface", "inner" and "outer" refer to the directions towards or away from the geometric center of the specific component respectively.

[0046] During the extrusion forming process of the microchannel flat tube, non-metallic inclusions adhere to the die, resulting in concave groove scratches on the surface of the flat tube. This defect is called "wire groove". The wire groove will pose a hidden danger to the airtightness and salt spray corrosion resistance of the microchannel flat tube. The wire groove defect is easily interfered by benign defects such as zinc layer or oil stain, and the characteristics of the wire groove defect are easily obscured in the background and are not easily detected by the original image processing method. Therefore, it is difficult to meet the requirements of automated detection. Therefore, the present invention provides a method for detecting surface defects of a flat tube, as Figure 1 shown, which includes the following steps:

[0047] Step S1, obtaining an image of the surface of the flat tube and preprocessing it to obtain an image to be extracted;

[0048] In step S1, steps S11 and S12 are also included, and both are detailed descriptions of the preprocessing. Specifically, step S11 is to obtain a first expected image by correcting and gray processing the image of the surface of the flat tube, that is, as Figure 2 shown, first perform affine correction processing on the captured image of the surface of the flat tube (affine correction processing is also an existing technology), then extract the region of interest (RIO), and then perform gray histogram statistics on the RIO image (the gray processing method is also an existing technology). According to the obtained row and column and gray mean and other information, eliminate the flat tubes with surface strength defects such as poor zinc spraying and water stain oxidation, and obtain the first expected image of the flat tube to be detected for wire grooves. The first expected image is an image after correction and gray processing. Then, step S12 is to obtain the image to be extracted by performing adaptive threshold filtering on the first expected image, that is, analyze all points in the first expected image, extract normal points as reference points, filter all normal points in the first expected image, and leave abnormal points as the image to be extracted.

[0049] Step S2, equally dividing the image to be extracted into several segmented images of the flat tube;

[0050] Since the wire groove itself may be inclined and the flat tube is relatively long, if processed as a whole, it will cause misalignment of the histogram projection. Therefore, it is necessary to perform uniform segmentation. In the present invention, the image is evenly divided into 10 segments.

[0051] Step S3, statistically analyzing each segmented image to obtain a vertical projection histogram, mapping the vertical projection histogram to obtain a first curve, and performing cubic B-spline curve fitting on the first curve to obtain a second curve;

[0052] Due to the obvious background noise of the flat tube, the first curve corresponding to the single projection histogram still has obvious fluctuations, that is, as Figure 3As shown, there are many local peaks in the non-slot region of the first curve, and the absolute values are relatively high, which is not conducive to positioning the slot position. It is also necessary to further perform 3-order B-spline curve fitting on the first curve. The step S3 also includes step S31. Near the starting point and the ending point of the sub-curve point set in the first curve, two endpoints for B-spline curve fitting are selected. A rectangular region is divided according to the coordinates of the two endpoints, and control points are calculated by the random sampling method within the rectangular region. According to the control points and the two endpoints, a second curve is calculated using the B-spline curve fitting formula.

[0053] The B-spline representation of the data point set is as follows: For each segmented first curve, it can be represented by an ordered point set {CP m}1≤m≤M, where M is the total number of points on the first curve. For any point CP m , a sub-curve point set consisting of 2j + 1 points can be constructed:

[0054]

[0055] As Figure 4 shown, the sub-curve point set is centered on CP m , and simultaneously includes J points before the point CP m and J points after the point CP m . For this sub-curve point set, if a smooth second curve can be fitted, and then the curvature of the midpoint of the second curve is obtained to form a new curvature curve, then this curvature curve can not only well reflect the mutated local peaks, but also filter out small fluctuations. At the same time, this curvature is not sensitive to the absolute values of the points on the first curve, and only amplifies the mutated peaks. Therefore, the position of the slot can be accurately found. Specifically, given n + 1 points P0, P1, P2.....P n in space, the n-order B-spline curve can be described in the form containing the Bernstein basis function B i,n (t):

[0056]

[0057]

[0058] where the first derivative P'(t) and the second derivative P”(t) of the B-spline curve can be expressed as:

[0059]

[0060]

[0061] As Figure 5 shown, for the B-spline curve, it is generally called the one composed of P0P1P2....Pn The composed broken line is the control polygon of the curve P(t), and P0, P1, P2.....P are called n the control vertices of P(t). For a cubic B-spline curve, in its control polygon P0P1P2P3 and the fitted curve, P0 is the starting point and P3 is the ending point, both of which are located at the two ends of the fitted curve, and the other two control points P1 and P2 are located outside the curve.

[0062] For a cubic B-spline curve, by only changing two endpoints and two control points, the shape and position of the entire curve can be changed. If it is expressed in matrix form, the cubic B-spline curve can be represented as:

[0063]

[0064] For a known set of sub-curve point sets, by searching for different control points, different B-spline curves can be obtained to represent these points. However, only one curve can best fit all the sub-curve point sets. Therefore, it is necessary to find the control points corresponding to the optimal B-spline curve. For the solution of such deterministic problems, when there are cases where the solution conditions are not satisfied, the random sampling method can be used. Different from general vertical calculations, it is a method of approximate calculation using a probability model, and its basic steps are as follows:

[0065] 1. Establish a probability model for the solution so that the solution is the mathematical expectation of the model;

[0066] 2. Conduct random sampling observations on the established model, that is, generate random variables;

[0067] 3. Use the arithmetic mean as the approximate average value of the solution, and give the variance or standard deviation of the statistical estimate value of the solution, that is, the accuracy of the solution;

[0068] Combined with the scenario of cubic B-spline curve fitting, and then combined with the random sampling method, the required curve can be obtained relatively quickly.

[0069] Specifically, as Figure 6 shown, step S31 also includes step S310, which calculates the range intervals of two endpoints and two control points by performing regional division arithmetic operations on the sub-curve point set in the first curve. The regional division arithmetic operation is configured as:

[0070]

[0071]

[0072]

[0073]

[0074]

[0075]

[0076] Among them, T0 is the corresponding dispersion threshold of the control points in the distribution space. is the range interval of the two endpoints. is the range interval of the two control points. Both are sub-data point sets, and both j and J are coordinates.

[0077] Specifically, step S31 further includes step S311. In the range interval of the two control points, any two control points are selected, and the two control points are used to calculate the target control point through the similarity formula between the cubic B-spline curve and the data point set. The similarity formula is configured as:

[0078]

[0079]

[0080] Among them, F(x,ζ) is a function of two variables x ∈ R n and ζ ∈ R d x ∈ R n is the given set, represented as a given sub-curve point set x is the coordinate, ζ is the random variable. is the candidate sub-profile, which is defined by the combined vector ω of randomly generated control points. Two control points P1 and P2 are randomly sampled from the sub-curve point set and substituted into F(x,ζ) to calculate the minimum value as the target point. Specifically, as Figure 6 shown.

[0081] If a sub-curve point set is given then the corresponding control points of the candidate sub-curve profile are determined by a group of randomly generated control point vectors ω ζ , ζ = 1, 2.... N, where N is the number of sampling times. Then each candidate sub-curve can be expressed in the form of a cubic B-spline curve:

[0082]

[0083] Step S4: Calculate the curvature of each group of second curves to obtain the curvature curve, and locate the local peaks in the curvature curve; Step S4 further includes step S41. Calculate the curvature value at any point on the second curve through the curvature formula for the second curve, that is, by using the method of random sampling, an optimal-fitting second curve determined by the control points {P i best , i = 0, 1, 2, 3} can be obtained. The second curve can be expressed as a parametric equation containing the variable t, Px (t), P y (t) is second-order differentiable, and P x '(t), P y '(t) are not simultaneously zero, then the curvature formula for any point on the second curve is:

[0084]

[0085] Among them, K(t) is the curvature value of any point on the second curve, P x '(t), P y '(t) are all first-order derivatives, P x ”(t), P y ”(t) are all second-order derivatives;

[0086] Step S41 also includes step S411. Obtain the variable t value of the center point according to the first-order derivative and second-order derivative of the cubic B-spline curve. Calculate the curvature of the center point of the second curve after fitting according to the variable t value through curvature calculation. Search for the center point curvature according to the curvature value, and then construct a curvature curve according to the curvature of the corresponding point in the first curve. Among them, the sub-contour point set is centered on the point CP m and consists of J contour points before it and J contour points after it. Therefore, the curvature of the midpoint of the best-fitting sub-curve obtained is the estimated curvature of the contour point CP m , that is, t = 0.5, and the first-order derivative is:

[0087]

[0088] The second-order derivative is:

[0089]

[0090] The curvature calculation formula is:

[0091]

[0092] Step S5. Integrate each group of segmented images. Sort and integrate each group of curvature curves according to the corresponding segmented images. Locate the wire groove points in the segmented images in turn according to the local peaks found in each group of curvature curves. Connect every two adjacent located wire groove points to obtain a wire groove line; as Figure 7As shown, in the projection histogram of Detection Example 1 in Figure (a), there are 11 local peak points where the segmented histogram curves meet the segmentation threshold. Among them, since the wire groove defect feature in the first segment of the image is weak, there are no peak points meeting the requirements on the corresponding histogram curve. One peak point is located in each of the second to eighth segments, and the horizontal axis coordinates of these points on the image are close to each other, so it can be considered that there is a wire groove here. In addition to the horizontal axis coordinates of the peak points located in the histogram curves of the ninth and tenth segments being close to those of the above peak points, there are other points with relatively remote X-axis coordinates, which are regarded as interference points. By counting the number of peak positioning points within the range of similar horizontal axis coordinates in each segment and eliminating the interference points, the positioning of the wire groove is finally achieved. In the original image of Detection Example 2 in Figure (b), although the wire groove defect appears intermittently, this method can also well achieve the search and positioning of this wire groove defect.

[0093] The above is only the preferred implementation mode of the present invention. The protection scope of the present invention is not limited to the above embodiments. All technical solutions within the idea of the present invention belong to the protection scope of the present invention. It should be pointed out that for those of ordinary skill in the art in this technical field, several improvements and refinements made without departing from the principle of the present invention should also be regarded as within the protection scope of the present invention.

Claims

1. A method for detecting surface defects of flat tubes, characterized in that: It includes the following steps: Step S1: Obtain the surface image of the flat tube and perform preprocessing to obtain the image to be extracted; Step S2: Equally divide the image to be extracted into several segmented images of the flat tube; Step S3: Statistically analyze each group of the segmented images to obtain a vertical projection histogram, map the vertical projection histogram to obtain a first curve, and perform several B-spline curve fittings on the first curve to obtain a second curve; Step S4: Calculate the curvature of each group of the second curves to obtain a curvature curve, and locate local peaks in the curvature curve; Step S5: Integrate each group of the segmented images, sort and integrate each group of the curvature curves according to the corresponding segmented images, locate the wire groove points in the segmented images in sequence according to the local peaks found in each group of the curvature curves, and connect every two adjacent located wire groove points to obtain wire groove lines; Step S31 is further included in Step S3: Select two endpoints for B-spline curve fitting near the starting point and the ending point of the sub-curve point set in the first curve, divide a rectangular area according to the coordinates of the two endpoints, calculate control points by the random sampling method within the rectangular area, and calculate the second curve according to the control points and the two endpoints using the B-spline curve fitting formula; Step S310 is further included in Step S31: Calculate the range intervals of two endpoints and two control points through the regional division arithmetic formula for the sub-curve point set in the first curve, and the regional division arithmetic formula is configured as: Among them, is the corresponding dispersion threshold for characterizing the control points in the distribution space, , are the range intervals of the two endpoints, , are the range intervals of the two control points, , are both subsets of data points, , are both coordinates; Step S311 is further included in Step S31: Select any two control points within the range intervals of the two control points, calculate the target control points by the similarity arithmetic formula between the two control points representing the cubic B-spline curve and the data point set, and the similarity arithmetic formula is configured as: Among them, is a function, is a coordinate, is a random variable, is a candidate sub-contour, which is defined by a combined vector of randomly generated control points defined by.

2. The method for detecting surface defects of a flat tube according to claim 1, characterized in that: The second curve is obtained by performing cubic B-spline curve fitting on the first curve.

3. The surface defect detection method for flat tubes according to claim 1, characterized in that: Step S41 is further included in Step S4: Calculate the curvature value at any point on the second curve by the curvature arithmetic formula for the second curve, find the central point curvature according to the curvature value, and then construct a curvature curve according to the curvature of the corresponding point in the first curve.

4. The surface defect detection method for flat tubes according to claim 3, wherein: The curvature arithmetic formula is configured as: wherein, is the curvature value of any point on the second curve, and are both first-order derivatives, and are both second-order derivatives.

5. The surface defect detection method for flat tubes according to claim 4, characterized in that: Step S411 is further included in Step S41: Obtain the variable t value of the central point according to the first derivative and the second derivative of the cubic B-spline curve, calculate the central point curvature of the second curve after fitting by the curvature calculation according to the variable t value, and the first derivative is: The second derivative is: The curvature calculation formula is: 。 6. The surface defect detection method for flat tubes according to claim 1, wherein: Step S11 is further included in Step S1: Rectify and perform grayscale processing on the surface image of the flat tube to obtain a first expected image.

7. The surface defect detection method for flat tubes according to claim 6, characterized in that: Step S12 is further included in Step S1: Perform adaptive threshold filtering processing on the first expected image to obtain the image to be extracted.

Citation Information

Patent Citations

  • Digital aerial image deformation automatic check method based on image statistical characteristics

    CN104008556A

  • Pipeline inner surface detection method and device based on three-dimensional point cloud

    CN112581457A

  • Hose tail indentation quality detection method based on machine vision

    CN113870211A