Steel surface scratch detection method based on machine vision

By using relative total variation algorithm and Gaussian function fitting technology in the steel surface detection system, the accuracy problem of scratch detection in complex backgrounds is solved, and more efficient scratch area extraction and more accurate edge position and width calculation are achieved.

CN119991593AActive Publication Date: 2025-05-13CHANGZHOU UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510059924.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-05-13
Estimated Expiration
2045-01-15

AI Technical Summary

Technical Problem

The prior art is difficult to accurately obtain the edge position and width of steel surface scratches in complex backgrounds, affecting the accuracy and efficiency of detection.

Method used

The relative total variation algorithm is used to suppress the background texture, the image horizontal grayscale gradient data is fitted through the Gaussian function, the scratch position is judged and the edge position is corrected, and the scratch length and area are calculated based on morphological operation, and the actual width is calculated through the scratch path method.

Benefits of technology

Improves the efficiency of scratch area extraction processing in complex backgrounds, enhances the accuracy of edge locations, and makes the definition of scratch width more accurate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119991593A_ABST
    Figure CN119991593A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, in particular to a steel surface scratch detection method based on machine vision. A steel surface scratch detection method based on machine vision comprises the specific steps that a steel surface image is obtained through a camera, the surface image is processed, and a scratch structure area is obtained; fitting gray scale gradient data in the horizontal direction of the image by using a Gaussian function, and further judging the horizontal edge position and the horizontal center point position of the scratch by using a Gaussian curve; and carrying out edge smoothing processing on the detected scratch area, and calculating the actual width of the scratch area. The accuracy of steel surface scratch detection under the complex background is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of image processing, and in particular to a method for detecting scratches on a steel surface based on machine vision. Background Art

[0002] In modern manufacturing, the quality of steel surface directly affects the performance and reliability of the final product. Traditional defect detection methods rely on manual inspection, which is inefficient and easily affected by subjective factors, making it difficult to ensure consistency and accuracy. With the development of machine vision technology, vision-based automated inspection systems have gradually become the mainstream method for steel surface defect detection.

[0003] In the prior art, adaptive image processing or image filtering algorithms are often used for scratch detection. For example, the patent with announcement number CN117197138B discloses the use of shooting angle and heat dissipation hole position relationship characteristics to achieve adaptive changes in the matching template during template matching, thereby improving the accuracy and robustness of computer host housing scratches. The patent with announcement number CN115690105B discloses that the surface defect probability of the milling cutter grayscale image is obtained based on the surface roughness complexity factor in the calculated sub-image, and the surface scratches of the milling cutter are detected based on the probability of surface defects. The patent with announcement number CN115359044B discloses that the optimal enhancement image is obtained by filtering the spectrum graph by obtaining the low-frequency gain coefficient, high-frequency gain coefficient, cutoff frequency and other data of the grayscale image.

[0004] Based on the key information of the scratch length, width, area, etc. on the plane image, the scratch edge position must be accurately obtained. This work is particularly important for plane images taken when there are textures and uneven lighting. Therefore, developing efficient and concise image processing algorithms is a key technical challenge in this field. Summary of the invention

[0005] The technical problem to be solved by the present invention is: in order to solve the problems existing in the prior art in the above-mentioned background technology, a method for detecting scratches on the surface of steel based on machine vision is provided.

[0006] The technical solution adopted by the present invention to solve the technical problem is: a method for detecting scratches on the surface of steel based on machine vision, comprising the following steps:

[0007] S1, obtaining steel surface images through a camera;

[0008] S2, preprocessing the steel surface image obtained in step S1 to obtain a scratch structure area;

[0009] S3. Use Gaussian function to fit the grayscale gradient data in the horizontal direction of the image: The horizontal gradient of the image is used to describe the change law of the grayscale value in the horizontal direction of the image. The horizontal gradient of the image is calculated using the first-order central difference. The calculation formula is as follows:

[0010]

[0011] In formula (1), δf(x,y k ) is the grayscale gradient value of the kth column in the horizontal direction, f(x,y k+1 ) and f(x,y k-1 ) are respectively the k+1th column and the k-1th column in the same horizontal direction;

[0012] The position information of the scratch is determined by the fitted Gaussian curve;

[0013] S4, judging the horizontal edge position and the horizontal center point position of the scratch by the fitted Gaussian curve;

[0014] S5. Correct the scratch edge position in the horizontal direction of the detected scratch area. The calculation formula is:

[0015]

[0016] In formula (2), x i is the edge position of the i-th row of the image, n is the total number of scratch sub-regions in the horizontal direction of the scratch detection area, N is the number parameter of adjacent correction positions, the edge positions on both sides of the n-2N sub-regions are re-corrected, and the smoothing range of the current sub-region correction is modified by modifying the size of N;

[0017] Then the image is processed by morphological opening operation to calculate the scratch length and area;

[0018] S6. Calculate the actual scratch width based on the direction of the scratch area.

[0019] Furthermore, in step S2, the steel surface image is preprocessed, specifically: the image is grayed, the background texture area in the image is suppressed using a relative total variation algorithm, and the scratch structure area in the image is enhanced.

[0020] Furthermore, in the enhanced image scratch structure area, the image is segmented by an adaptive threshold segmentation method, and the non-scratch connected areas initially segmented in the image are filtered using a method based on geometric morphological features. The connected areas that do not meet the constraints are regarded as non-scratch connected areas, and the grayscale value in the area before segmentation is replaced by the average grayscale value of the pixels in the non-connected area.

[0021] Furthermore, the constraint range of the geometric feature is specifically:

[0022]

[0023] Among them, S is the area of ​​the connected region, R L is the aspect ratio of the connected region, R S is the area ratio of the connected region, C is the circularity of the connected region;

[0024] The gray value processing calculation formula of the non-scratch connected area is:

[0025]

[0026] In formula (3), g(x, y) is the gray value of the pixel at position (x, y), p is the pixel in region R, and N(p) represents the number of p.

[0027] Furthermore, the step S3 further includes: assuming that the distribution of the horizontal gradient near the scratch edge in the image is a normal distribution, and the horizontal gradient at the scratch position is represented as a linear superposition of two Gaussian functions, and the calculation formula of the Gaussian function is:

[0028]

[0029] In formula (4), p1 and p2 are the peak values ​​of the horizontal gradients on both sides of the scratch, p3 and p4 are the positions of the two peak values, and p5 and p6 are the standard deviations of the two Gaussian curves.

[0030] Furthermore, the step S6 is specifically as follows: by calculating the connecting line of the center points of the adjacent sub-regions and making the normal of the connecting line, the intersection points of the connecting line at the left and right sides of the adjacent sub-region and the normal are calculated, and the distance between the two intersection points is recorded as the actual width of the scratch of the current sub-region.

[0031] Beneficial effects of the present invention: The present invention utilizes a relative total variation algorithm to suppress background texture and a preprocessing method for geometric shape filtering, which can improve the processing efficiency of extracting scratch areas under complex backgrounds, and based on the calculation of grayscale gradients, uses Gaussian function fitting to determine the scratch edge; and the present invention uses an algorithm that uses the normal width of the scratch path as the actual width of the scratch to make the definition of the scratch width more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0033] Figure 1 It is a flow chart of the steel surface scratch detection method based on machine vision of the present invention.

[0034] Figure 2 is the original image of steel obtained in the embodiment of the present invention; wherein, Figure 2 (a) is an original image of steel containing point interference obtained in an embodiment of the present invention; Figure 2 (b) is an original image of steel containing clumping interference obtained in an embodiment of the present invention.

[0035] Figure 3 is a preprocessed image obtained in an embodiment of the present invention; wherein, Figure 3 (a) is a pre-processed image containing point interference obtained in an embodiment of the present invention; Figure 3 (b) is a pre-processed image containing clumping interference obtained in an embodiment of the present invention.

[0036] Figure 4 is a Gaussian fitting curve in the horizontal direction obtained in the embodiment of the present invention.

[0037] Figure 5 is the scratch area detected in the embodiment of the present invention; wherein, Figure 5 (a) is an image detection area containing point interference in an embodiment of the present invention; Figure 5 (b) is an image detection area including cluster interference in an embodiment of the present invention.

[0038] Figure 6 is the scratch area detected by the Otsu algorithm in the embodiment of the present invention; wherein, Figure 6 (a) is the image detection area containing point interference; Figure 6 (b) is the image detection area containing cluster interference.

[0039] Figure 7 is the scratch area detected by the triangular threshold algorithm in the embodiment of the present invention; wherein, Figure 7 (a) is the image detection area containing point interference; Figure 7 (b) is the image detection area containing cluster interference.

[0040] Figure 8 Schematic diagram of a method for calculating the actual width of a scratch in an embodiment of the present invention. DETAILED DESCRIPTION

[0041] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.

[0042] like Figure 1 As shown, a method for detecting scratches on a steel surface based on machine vision comprises the following steps:

[0043] Step 1: Use the camera to obtain the steel surface image; Step 2: Perform grayscale processing on the surface image to obtain the following Figure 2The original image shown: The background texture of the image is suppressed using the relative total variation algorithm, and the scratch structure area in the image is enhanced.

[0044] exist Figure 2 The image is segmented preliminarily in the scratch structure area by the adaptive threshold segmentation method, and the non-scratch area preliminarily segmented in the image is filtered by the method based on geometric morphological features. The connected areas that do not meet the constraint range are regarded as non-scratch connected areas, and the grayscale value in the area of ​​the image before segmentation is replaced by the average grayscale value of the pixels in the non-connected area.

[0045] The constraints of the geometric features are as follows:

[0046]

[0047] Among them, S is the area of ​​the connected region, R L is the aspect ratio of the connected region, R S is the area ratio of the connected region, and C is the circularity of the connected region.

[0048] The calculation formula for gray value processing of non-scratch connected areas is:

[0049]

[0050] In formula (3), g(x, y) is the gray value of the pixel at position (x, y), R is the non-connected region, p is the pixel in region R, and N(p) represents the number of p.

[0051] The connected region geometry filtering reduces the influence of the interference region on the subsequently extracted horizontal grayscale gradient data (this influence may reduce the accuracy of Gaussian function fitting), thereby improving the accuracy of Gaussian function fitting. The processed original image contains point-shaped, cluster-shaped, and strip-shaped defects, among which point-shaped and cluster-shaped defects are non-scratch connected areas, and only the strip-shaped scratch defect part is retained after processing.

[0052] According to the above image preprocessing, we can get Figure 3 The preprocessed image shown.

[0053] Step 3: Use the Gaussian function to fit the grayscale gradient data distribution in the horizontal direction of the image: First, use the horizontal gradient of the image to describe the grayscale value change law in the horizontal direction of the image, and use the first-order central difference to calculate the horizontal gradient of the image. The calculation formula is as follows:

[0054]

[0055] In formula (1), δf(x,y k ) is the grayscale gradient value of the kth column in the horizontal direction, f(x,yk+1 ) and f(x,y k-1 ) are the k+1th column and k-1th column in the same horizontal direction respectively. For the convenience of calculation, the calculated gradient values ​​are normalized;

[0056] The Gaussian function is used to fit the grayscale gradient data structure in the horizontal direction of the image, and the position information of the scratch is determined by the fitted Gaussian curve;

[0057] The distribution of the horizontal gradient near the scratch edge in the image is assumed to be a normal distribution, and the horizontal gradient at the scratch position is expressed as a linear superposition of two Gaussian functions, where the expression of the Gaussian function is:

[0058]

[0059] In formula (4), p1 and p2 are the peak values ​​of the horizontal gradients on both sides of the scratch, p3 and p4 are the positions of the two peak values, and p5 and p6 are the standard deviations of the two Gaussian curves.

[0060] Formula (1) calculates the horizontal grayscale gradient to obtain the relationship between the horizontal grayscale gradient value and the corresponding horizontal position. Formula (4) performs Gaussian curve fitting through the data in Table 1 and Table 2. The distribution of the horizontal grayscale gradient at the scratch can be determined by the Gaussian curve obtained by fitting, so as to obtain the edge position of the scratch in the horizontal direction.

[0061] Table 1 Figure 3 (a) Fitting curve parameters in each horizontal direction

[0062] Serial number p1 p2 p3 p4 p5 p6 Serial number p1 p2 p3 p4 p5 p6 Serial number p1 p2 p3 p4 p5 p6 Serial number p1 p2 p3 p4 p5 p6 1 1.38 0.21 18.47 31.5 0.58 0.31 65 1.03 0.98 58.28 43.93 1.17 1.39 129 1.01 0.69 44.76 56.12 1.08 1.42 193 1.09 0.88 43.44 54.56 0.98 1.18 2 1.3 0.21 19.47 5.5 0.63 0.31 66 1.06 1.02 58.04 44.39 1.42 1.76 130 1.02 0.54 43.46 56.09 1.33 2.42 194 0.97 0.97 44.18 54.84 1.45 1.39 3 1.51 1.51 10.52 20.48 0.53 0.53 67 0.97 0.54 43.72 57.97 1.22 2.07 131 1 0.78 44.3 57.52 1.39 1.58 195 0.99 0.83 44.45 54.8 1.48 1.64 4 1.51 5.43 20.48 6.5 0.53 0.26 68 0.97 0.88 43.2 58.11 1.27 1.21 132 1.05 0.88 43.86 56.79 1.29 1.38 196 0.99 0.83 44.96 55.7 1.13 1.21 5 1.51 1.4 20.48 6.52 0.53 0.54 69 1.05 0.72 57.32 43.15 1 1.67 133 1.05 0.82 44.25 57 1.16 1.32 197 1.03 1 45.16 56.08 1.03 0.97 6 1.22 1.34 6.57 20.48 0.63 0.53 70 1.13 0.9 57.55 44.59 1.01 1.45 134 1.11 0.84 44.55 57.19 1.13 1.33 198 1.1 0.99 45.36 56.51 0.95 0.99 7 1.22 1.3 6.57 18.47 0.63 0.63 71 1.08 0.84 43.31 56.43 1.31 1.57 135 1.05 0.84 43.96 56.51 1.26 1.47 199 1.17 0.95 43.48 54.94 0.9 1.04 8 1.22 5.74 6.57 18.5 0.63 0.25 72 0.95 1 56.73 42.84 1.34 1.42 136 1.06 0.93 43.6 56.14 1.56 1.68 200 1.09 0.86 43.63 55.23 0.91 1.09 9 1.27 5.43 6.56 18.5 0.61 0.26 73 1.04 0.76 56.28 42.58 1.07 1.67 137 0.97 0.96 43.5 55.84 1.64 1.57 201 1.05 0.78 42.74 54.47 0.91 1.15 10 1.12 1.69 13.32 35.5 0.74 0.26 74 1.04 0.72 56.78 43.98 0.94 1.51 138 1.06 1.01 44.47 56.55 1.22 1.19 202 1.02 0.72 42.88 54.74 0.93 1.25 11 0 0 0 0 0 0 75 1.05 0.92 44.26 56.47 1.32 1.35 139 1.02 1.01 43.92 55.85 1.09 1.03 203 1.02 0.67 43.08 55.09 0.92 1.35 12 0 0 0 0 0 0 76 1.06 0.9 44.26 56.94 1.53 1.68 140 1.01 0.96 44.15 56.03 1.05 1 204 1.06 0.67 43.28 55.65 0.94 1.43 13 0 0 0 0 0 0 77 1.04 1 44.31 56.94 1.49 1.43 141 1 1.01 43.47 55.26 1.23 1.09 205 1.11 0.84 43.53 56.41 1.04 1.35 14 0.32 0.2 38.15 22.5 0.93 0.31 78 0.99 0.88 44.08 56.54 1.16 1.2 142 1.03 0.98 55.65 44 1.29 1.53 206 0.99 0.92 56.93 43.92 1.03 1.2 15 1 0.13 38.26 23.5 1.07 0.3 79 1.08 0.88 44.67 57.2 1.15 1.26 143 1.11 1.05 44.91 56.82 1.61 1.53 207 1.04 0.78 57.25 44.82 0.95 1.42 16 1.05 0.1 37.57 26.5 1.29 0.29 80 0.97 0.88 44.56 57.51 1.53 1.55 144 0.95 0.84 44.86 56.92 1.24 1.33 208 1.13 1 57.56 45.55 0.95 1.2 17 0.99 0.71 46.15 35.7 1.29 1.94 81 0.96 1.02 45.13 57.67 1.62 1.39 145 1.08 0.84 44.35 56.22 0.99 1.24 209 1.01 1.02 44.88 56.69 1.08 0.97 18 0.98 1.06 46.93 35.02 1.44 1.45 82 0.97 0.84 43.94 56.27 1.13 1.27 146 1.11 0.82 44.6 56.36 0.91 1.18 210 1.02 0.96 44.11 55.77 1.03 1 19 1.1 0.89 35.03 48.6 1.4 1.7 83 1.05 0.77 44.3 56.95 0.97 1.25 147 1.03 0.74 44.86 56.46 0.9 1.17 211 1.07 0.98 44.37 55.82 1.01 1.01 20 1.01 0.85 50.12 35.21 1.06 1.37 84 1.02 0.92 43.82 57.23 1.12 1.14 148 1.01 0.7 45.12 56.67 0.95 1.29 212 1.04 0.96 44.73 55.89 1.09 1.05 21 0.97 0.9 51.01 36.32 1.36 1.56 85 1.02 0.68 56.85 43.98 1.02 1.74 149 1.01 0.66 43.42 55.3 1.14 1.62 213 0.98 1.02 55.05 44.21 1.14 1.24 22 0.96 0.79 37.79 52.37 1.41 1.74 86 0.97 0.81 55.24 43.36 1.18 1.55 150 1.05 0.85 42.9 55.5 1.45 1.59 214 0.97 0.77 44.89 55.64 1.38 1.62 23 1.03 0.77 38.43 53.38 1.13 1.47 87 0.99 0.65 43.01 54.94 1.14 1.64 151 0.99 0.91 56.23 43.67 1.35 1.68 215 1.06 0.74 44.58 55.59 1.32 1.74 24 1.04 0.91 39.32 54.42 1.43 1.53 88 1.05 0.88 43.58 57.54 1.17 1.28 152 0.96 0.91 44.72 57.21 1.31 1.27 216 1 0.92 45.16 56.86 1.09 1.01 25 0.97 0.76 41.01 56.45 1.44 1.85 89 1 0.82 57.3 43.61 1.08 1.46 153 1.04 0.79 44.19 56.86 1.07 1.38 217 1.07 0.99 44.47 56.24 1.08 0.98 26 0.97 0.91 42.04 57.47 1.26 1.32 90 1.06 1.02 56.78 43.77 1.32 1.51 154 1.1 0.74 43.4 56.42 1.09 1.57 218 1.08 0.76 43.67 55.48 1.12 1.23 27 1.03 0.92 41.71 57.1 1.41 1.55 91 1.04 0.82 42.46 55.26 1.33 1.59 155 1.02 0.72 42.64 56.08 1.17 1.62 219 1.03 0.62 43.89 55.97 1.2 1.71 28 0.97 0.95 58.48 42.72 1.48 1.62 92 1.01 0.65 43.01 55.8 1.16 1.73 156 0.97 0.81 42.96 56.72 1.23 1.42 220 1.05 0.67 44.38 56.68 1.45 2.08 29 1.11 0.98 58.57 43.16 1.07 1.34 93 0.98 0.75 42.9 55.57 1.25 1.56 157 1.01 0.78 57.29 43.75 1.09 1.54 221 0.98 0.95 45.03 56.79 1.49 1.14 30 0.99 0.96 57.74 42.91 1.62 1.77 94 1.02 0.93 55.62 43.15 1.12 1.4 158 1.04 0.84 56.8 43.96 1.14 1.55 222 1.01 0.66 45.06 56.31 0.97 1.14 31 1.06 0.94 42.38 57.09 1.54 1.59 95 0.97 1 55.11 42.36 1.23 1.31 159 0.97 1 57.17 44.59 1.21 1.29 223 1.06 0.67 45.33 56.69 0.94 1.13 32 0.97 1.03 56.91 42.03 1.23 1.35 96 1.02 0.89 42.39 55.88 1.4 1.57 160 1.02 0.81 42.97 55.55 1.2 1.4 224 1.15 0.77 44.51 55.97 0.91 1.08 33 1.04 0.87 57.71 42.87 1.09 1.53 97 1.09 0.65 57.29 41.56 1.39 2.59 161 1.07 0.7 43.43 56.2 1.17 1.73 225 1.08 0.86 44.7 56.25 0.97 1.1 34 1.06 0.89 41.55 56.45 1.66 1.79 98 1.04 0.6 56.78 41.96 1.21 1.38 162 1 0.76 44 57.32 1.2 1.48 226 0.98 0.87 44.25 55.87 1.29 1.27 35 1.08 1.01 41.89 57.09 1.59 1.45 99 1.05 0.65 56.14 44.26 1.27 1.18 163 0.99 0.89 56.95 43.65 1.04 1.28 227 1.04 0.95 45.32 56.79 1.58 1.46 36 0.97 1.04 57.22 42.06 1.76 1.87 100 1.09 0.76 42.47 54.92 1.05 1.73 164 1.03 0.92 56.28 43.21 1.05 1.28 228 1.01 0.72 44.13 55.8 1.25 1.53 37 1 0.86 41.57 56.67 1.46 1.55 101 1.09 0.68 41.58 55.44 1.13 1.65 165 1.06 0.98 56.66 43.71 1.04 1.25 229 1.09 0.7 44.57 56.64 0.97 1.35 38 1.03 0.83 42.54 57.77 1.2 1.34 102 0.96 1 42.25 56.55 1.43 1.22 166 1.01 1.01 56.97 44.19 1.01 1.11 230 1.02 0.59 44.87 57.07 0.9 1.38 39 1.09 1.01 43 58.02 1.81 1.71 103 0.92 0.83 43.76 56.51 1.47 1.53 167 1 0.98 56.06 43.53 1.03 1.16 231 1.01 0.6 43.08 55.29 0.95 1.5 40 0.94 0.87 42.54 57.46 1.75 1.65 104 1.04 0.72 42.44 55.88 1.26 1.71 168 0.99 0.95 56.17 43.96 1.1 1.25 232 1.03 0.62 42.58 55.09 1.26 1.94 41 0.98 0.91 41.55 56.36 1.76 1.71 105 0.94 0.95 42.04 55.85 1.6 1.43 169 0.98 0.95 55.35 43.46 1.23 1.38 233 0.99 0.96 56.16 43.77 1.07 1.78 42 0.97 0.74 43.39 57.78 1.55 1.82 106 1.02 0.79 56.63 43.85 1.3 1.85 170 1.07 0.94 44.26 55.94 1.46 1.56 234 1.02 0.78 45.06 56.64 1.22 0.97 43 0.98 0.93 43.85 58.72 1.24 1.15 107 1.01 0.62 43.78 57.73 1.16 1.74 171 0.99 0.95 45.19 57.25 1.34 1.33 235 1.11 1.03 55.6 44.59 1 1.12 44 0.98 0.96 43.2 57.64 1.71 1.56 108 0.99 0.96 57.84 43.3 1.07 1.28 172 1.01 1.02 56.75 44.7 1.1 1.16 236 1.01 1.1 44.93 55.58 1.11 1 45 1.04 0.88 41.52 56.41 1.82 1.93 109 1.01 0.7 56.11 42.11 0.99 1.58 173 1.01 0.99 43.93 55.95 1.07 1 237 1.07 0.92 54.44 44.34 1.05 1.25 46 1.04 0.93 56.55 41.57 1.23 1.65 110 1.04 0.72 55.35 42.25 1.01 1.7 174 1.01 0.96 44.08 56.08 1.01 0.98 238 1 0.84 52.16 42.85 1.15 1.41 47 1.01 0.83 42.92 58.39 1.67 1.84 111 1.06 0.73 43.58 56.65 1.27 1.69 175 1.03 0.99 44.23 56.21 0.99 0.94 239 0.96 0.83 51.69 43.63 1.41 1.71 48 1 0.97 41.59 57.43 1.5 1.33 112 1 0.96 57.66 43.82 1.12 1.32 176 1.05 1.05 43.38 55.34 1.03 0.94 240 0 0 0 11 1 1 49 0.98 0.94 58.02 42.11 1.66 2.01 113 0.98 0.93 43.02 56.31 1.46 1.34 177 1.06 1.1 43.47 55.41 1.09 0.96 241 0 0 0 11 1 1 50 0.93 0.91 41.6 57.08 1.71 1.59 114 1.02 0.66 43.79 57.47 1.28 1.88 178 1.1 1.05 54.51 42.57 1.01 1.16 242 0 0 0 11 1 1 51 0.99 0.75 41.57 57.36 1.4 1.67 115 1.03 0.71 44.39 58.9 1.15 1.57 179 1.04 0.97 54.63 42.72 1.04 1.24 243 0 0 0 11 1 1 52 1 0.9 59.15 43.56 1.13 1.38 116 1.01 0.77 57.72 43.62 1.13 1.66 180 0.98 1 54.87 42.99 1.24 1.33 244 0 0 0 11 1 1 53 1.01 0.82 42.62 58.16 1.43 1.65 117 0.96 0.77 43.95 57.47 1.23 1.46 181 1.05 0.9 43.28 55.12 1.31 1.43 245 0 0 0 11 1 1 54 0.94 0.94 57.7 42.48 1.71 1.95 118 1.09 0.67 43.53 57.73 1.1 1.73 182 1.07 0.88 42.54 54.31 1.35 1.51 246 0 0 0 11 1 1 55 0.98 0.89 41.68 56.59 1.29 1.24 119 0.99 0.75 42.93 57.61 1.11 1.45 183 1.1 0.87 42.8 54.56 1.4 1.62 247 0 0 0 11 1 1 56 0.98 0.95 57.47 42.79 1.29 1.49 120 1.05 0.85 58.12 44.04 1.29 1.76 184 1.01 0.78 43.31 55.07 1.46 1.6 248 0 0 0 11 1 1 57 1.06 0.84 42.57 57.21 1.47 1.65 121 0.96 1.04 44.97 57.54 1.31 1.18 185 0.97 0.73 43.98 55.76 1.18 1.36 249 0 0 0 11 1 1 58 1.06 0.92 42.76 57.77 1.64 1.58 122 1.05 0.85 44.6 56.91 1.05 1.26 186 1.08 0.8 42.37 54.21 1.04 1.22 250 0 0 0 11 1 1 59 0.99 0.86 42.78 57.59 1.6 1.61 123 1.01 0.69 43.87 56.41 1 1.38 187 1.08 0.78 42.61 54.38 0.97 1.14 251 0 0 0 11 1 1 60 1.03 0.73 43.66 58.44 1.38 1.76 124 0.99 0.73 43.14 56.19 1.05 1.3 188 1.03 0.72 42.83 54.43 0.91 1.11 252 0 0 0 11 1 1 61 1.05 0.82 43.61 58.63 1.34 1.54 125 1.01 0.74 56.94 43.81 0.97 1.49 189 1.01 0.71 43.01 54.43 0.92 1.12 253 0 0 0 11 1 1 62 0.99 0.89 57.7 43.35 1.44 1.91 126 1.02 0.74 56.23 44.13 0.99 1.56 190 1.02 0.78 43.1 54.44 0.91 1.13 254 0 0 0 11 1 1 63 0.96 0.66 43.83 57.61 1.22 1.7 127 0.98 1.06 43.86 55.48 1.25 1.05 191 1.03 0.81 43.19 54.46 0.92 1.14 255 0 0 0 11 1 1 64 1 0.61 43.19 57.55 1.07 1.62 128 1.05 0.94 44.25 55.71 1.12 1.14 192 1.05 0.82 43.29 54.48 0.94 1.17 256 0 0 0 11 1 1

[0063] Table 2 Figure 3 (b) Fitting curve parameters in each horizontal direction

[0064] Serial number p1 p2 p3 p4 p5 p6 Serial number p1 p2 p3 p4 p5 p6 Serial number p1 p2 p3 p4 p5 p6 Serial number p1 p2 p3 p4 p5 p6 1 1.74 1.38 0.4 13.5 0.38 0.35 65 0.97 0.68 62.44 42.22 2.12 2.17 129 0.98 0.99 58.37 41.7 2.26 1.88 193 1.01 0.74 55.88 40.32 1.01 1.23 2 6.39 6.39 15.5 29.5 0.26 0.26 66 0.94 0.88 61 40.98 1.92 1.56 130 0.9 0.65 58.2 42.05 1.78 2.23 194 1.01 0.75 55.89 40.33 1.01 1.21 3 6.39 6.39 15.5 29.5 0.26 0.26 67 0.92 0.89 41.33 61.76 2.08 2.57 131 0.92 0.66 58.5 43.02 1.55 1.93 195 1 0.74 55.92 40.33 1 1.21 4 6.39 6.39 15.5 29.5 0.26 0.26 68 0.91 0.9 60.57 39.76 2.44 2.21 132 0.94 0.68 58.59 43.36 1.45 1.77 196 1 0.73 55.95 40.33 0.99 1.21 5 6.39 6.39 15.5 29.5 0.26 0.26 69 0.98 0.84 60.75 39.92 1.73 1.87 133 0.94 0.69 58.63 43.53 1.42 1.72 197 1.01 0.74 55.96 40.33 1.01 1.21 6 0 0 0 0 0 0 70 0.98 0.9 61.73 41.08 1.65 1.59 134 0.94 0.71 58.65 43.57 1.43 1.67 198 1 0.74 56 40.33 1 1.21 7 6.39 6.39 5.5 15.5 0.26 0.26 71 0.99 0.94 61.76 40.17 2.32 2.15 135 0.94 0.7 58.64 43.57 1.42 1.7 199 1.01 0.74 56.07 40.41 1.01 1.22 8 6.39 6.39 6.5 16.5 0.26 0.26 72 0.93 0.68 61.3 39.83 1.87 2.45 136 0.94 0.7 58.63 43.57 1.42 1.69 200 1.02 0.75 56.14 40.45 1.01 1.22 9 0.99 0.56 28.43 18.71 1.46 2.27 73 0.98 0.79 61.02 40.11 1.88 2.1 137 0.94 0.71 58.6 43.56 1.44 1.7 201 1.02 0.76 56.18 40.54 1.04 1.24 10 1.02 0.67 28.42 18.48 1.32 1.85 74 0.96 0.91 40.37 61.5 1.94 2.35 138 0.92 0.71 58.61 43.56 1.45 1.69 202 1.02 0.76 56.21 40.68 1.09 1.31 11 1.03 0.73 28.58 17.66 1.42 1.95 75 0.98 0.92 61.46 40.11 2.18 2.16 139 0.93 0.77 58.35 43.5 1.6 1.71 203 1.03 0.71 56.23 40.87 1.06 1.4 12 1.01 0.76 29.04 17.53 1.59 2.06 76 0.92 0.81 61.94 40.63 2.07 2.16 140 1.04 0.89 58.65 44.07 1.85 1.89 204 1.03 0.68 56.25 41.07 1.08 1.46 13 0.91 0.8 29.69 17.47 1.92 2.12 77 0.92 1.04 39.74 61.19 2.33 2.41 141 1.09 0.9 57.94 43.59 1.93 2.01 205 1.04 0.67 56.29 41.25 1.1 1.48 14 1.03 1 30.73 17.42 2.25 2.21 78 0.98 0.74 60.58 39.33 2.28 2.73 142 1.01 0.77 57.35 43.02 1.81 1.99 206 1.05 0.67 56.33 41.44 1.13 1.49 15 0.96 0.68 32.39 17.25 1.69 2.39 79 1.02 0.65 61.9 41.49 1.55 2.23 143 1.04 0.66 56.8 42.48 1.41 1.89 207 1.09 0.69 56.49 41.66 1.15 1.51 16 0.96 0.63 33.31 17.26 1.56 2.38 80 0.98 0.81 62.18 41.9 1.99 2.05 144 1.02 0.6 56.41 41.9 1.13 1.61 208 1.05 0.67 56.63 41.81 1.17 1.53 17 0.93 0.88 34.46 17.29 2.25 2.32 81 0.97 0.72 60.87 40.67 1.92 2.33 145 1 0.69 57.23 42.39 1.04 1.28 209 1 0.69 56.78 41.94 1.21 1.47 18 1.01 0.93 17.34 36.04 2.25 2.57 82 0.95 0.67 60.81 40.93 1.47 1.93 146 1.01 0.75 57.16 42.2 1.02 1.18 210 0.98 0.71 56.9 41.99 1.3 1.5 19 0.98 0.9 37.6 17.5 2.02 2.12 83 0.98 0.79 61.42 41.79 1.39 1.53 147 1 0.74 57.1 41.98 1.01 1.18 211 0.96 0.75 57.1 42.09 1.43 1.51 20 0.98 0.93 38.89 17.99 1.87 1.84 84 0.96 0.91 40.89 61.04 1.83 2.2 148 1 0.72 57.03 41.8 1.03 1.24 212 0.95 0.81 56.48 41.36 1.63 1.48 21 0.97 0.99 19.1 40.37 2.26 2.41 85 1.02 1.03 61.06 40.41 2.45 2.16 149 1 0.71 57.88 42.64 1.08 1.36 213 1.04 0.92 57.09 41.91 1.8 1.57 22 0.95 0.93 42 21.06 2.41 2.28 86 0.97 0.97 40.74 61.4 1.89 2.15 150 1.02 0.72 57.69 42.55 1.11 1.4 214 1.1 0.97 57.7 42.52 1.76 1.59 23 0.98 0.82 22.17 43.09 1.65 2.18 87 1 0.96 40.51 61.23 1.63 2.01 151 1.07 0.79 57.5 42.48 1.14 1.39 215 1.02 0.9 57.12 41.98 1.62 1.52 24 0.98 0.77 23.24 44.41 1.48 2.13 88 0.91 1.05 40.88 61.6 2.03 2.02 152 1.07 0.77 57.36 42.47 1.13 1.43 216 1 0.87 57.5 42.46 1.44 1.45 25 1 0.8 45.99 25.35 2 2.39 89 0.96 0.81 62.07 42.15 1.73 1.85 153 1.03 0.76 58.21 43.44 1.17 1.45 217 0.99 0.86 58.82 43.68 1.29 1.36 26 0.97 0.78 47.45 27.31 1.68 1.91 90 0.97 0.94 41.36 61.52 1.57 1.91 154 1 0.75 58.03 43.29 1.23 1.52 218 1.02 0.8 59.07 43.86 1.23 1.47 27 1.02 0.91 48.22 28.14 1.76 1.79 91 0.93 1.01 40.24 60.68 1.92 2.05 155 0.98 0.78 57.75 43.08 1.39 1.6 219 1.06 0.82 59.26 43.99 1.2 1.48 28 1.07 0.97 49.34 29.23 2.03 2.07 92 1.02 0.84 62.16 42.02 2.09 2.32 156 1.02 0.91 57.29 42.88 1.65 1.69 220 1.06 0.78 59.45 44.13 1.16 1.49 29 0.92 0.98 31.54 51.76 1.91 1.94 93 0.95 0.87 42.91 63.17 1.49 1.93 157 1.06 1 57.09 43.63 1.75 1.7 221 1.01 0.73 58.66 43.32 1.1 1.47 30 0.99 0.91 32.76 53.06 1.48 1.81 94 1.03 0.89 41.8 62.55 1.53 2.04 158 0.96 0.72 56.14 42.98 1.35 1.71 222 1 0.68 57.85 42.35 1.01 1.44 31 1.07 0.87 54.03 34.07 1.99 2.26 95 1.03 0.89 61.83 41.04 2.14 2.18 159 0.99 0.72 55.92 41.67 1.26 1.5 223 1 0.71 57.98 42.4 1.02 1.42 32 1.01 0.87 55.04 35.79 2.05 2.22 96 1.02 0.83 61.88 41.51 1.98 2.18 160 1.01 0.86 56.84 42.04 1.21 1.22 224 0.99 0.75 58.12 42.45 1.06 1.42 33 0.98 0.84 37.11 56.44 1.41 1.85 97 0.98 1.11 42.71 63.01 1.64 1.68 161 1.02 0.82 56.75 41.53 1.2 1.35 225 0.97 0.91 58.43 42.61 1.31 1.44 34 0.97 1.09 38.16 57.8 1.64 1.62 98 1.03 0.65 62.3 42.12 1.6 2.3 162 1.09 0.8 56.59 41.24 1.19 1.47 226 1.06 0.89 43.27 59.73 1.66 2.14 35 1 0.96 39.51 59.22 2.17 2.4 99 0.99 0.75 61.6 41.94 1.98 2.38 163 1.04 0.71 56.39 41.1 1.1 1.49 227 1.02 0.97 60.66 44.14 1.96 1.94 36 0.93 0.82 41.12 61.37 2.02 2.55 100 0.94 0.95 41.14 61.08 1.82 2.09 164 1.01 0.65 57.19 42.04 1.03 1.5 228 0.94 0.78 60.22 43.87 1.66 1.9 37 0.96 0.91 41.08 61.68 1.51 1.86 101 0.99 1.03 40.79 61.33 1.62 1.82 165 1 0.62 58 42.96 0.98 1.46 229 0.96 0.72 60.61 44.44 1.38 1.77 38 0.98 0.74 62.77 42.42 1.65 2.03 102 1.01 0.74 61.5 41.38 1.89 2.32 166 1 0.65 57.86 42.76 1.02 1.45 230 0.99 0.73 61.02 45.03 1.12 1.51 39 0.91 0.89 42.59 61.88 1.5 1.75 103 0.95 0.88 42 60.92 1.56 2.05 167 1 0.7 57.69 42.48 1.16 1.55 231 1.08 0.83 60.4 44.51 1.13 1.41 40 0.98 0.78 41.25 61.36 1.37 2.01 104 1.04 0.99 41.77 61.29 1.51 1.81 168 0.99 0.71 57.52 42.26 1.34 1.73 232 1.03 0.79 60.66 44.91 1.12 1.42 41 1 0.92 39.72 60.51 1.54 1.94 105 1.05 0.93 61.07 41.41 1.63 1.65 169 0.98 0.73 58.24 43.06 1.55 1.95 233 1 0.8 59.88 44.22 1.16 1.4 42 0.95 0.77 62.22 41.3 2.28 2.57 106 0.98 0.76 60.93 41.52 1.6 1.92 170 1.05 0.87 57.63 42.87 1.97 2.17 234 0.99 0.88 60.22 44.63 1.23 1.36 43 0.96 1.09 43.14 63.59 1.84 1.84 107 1.01 0.83 41.43 61.12 1.78 2.45 171 0.94 0.78 56.03 42.86 1.95 2.15 235 1.04 0.75 45.14 62.64 1.45 2.16 44 0.97 0.9 62.68 42.17 1.73 1.7 108 0.97 0.93 41.58 61.95 1.79 1.99 172 0.98 0.54 54.9 42.7 1.19 2.13 236 0.96 0.78 63.06 44.75 1.29 1.62 45 0.97 0.94 41 61.89 2 2.22 109 0.97 0.69 60.74 40.9 1.88 2.46 173 1.03 0.54 55.67 42.75 1.11 1.97 237 1.06 0.68 62.4 44.42 1.14 1.77 46 1.02 0.96 61.5 40.14 2.2 2.16 110 0.95 0.73 60.45 41.74 1.95 2.36 174 1.09 0.74 55.5 41.85 1.11 1.39 238 1.08 0.68 62.58 44.99 1.09 1.72 47 1.02 0.92 63.01 41.73 1.76 1.73 111 1.03 0.89 42.67 62.27 1.94 2.62 175 1.07 0.88 55.4 41.14 1.14 1.22 239 1.07 0.72 62.6 45.53 1.08 1.6 48 0.94 0.78 63.61 42.83 2.05 2.25 112 0.92 0.92 62.55 40.93 2.35 2.14 176 1.07 0.84 55.38 40.51 1.17 1.33 240 1.1 0.8 60.51 43.89 1.12 1.56 49 1.12 0.93 62.24 41.6 2.13 2.32 113 0.97 0.67 61.52 39.62 2.36 3.11 177 1.06 0.81 57.36 41.99 1.15 1.37 241 0.96 0.87 59.03 43.49 1.36 1.56 50 0.93 0.73 61.39 40.83 1.92 2.2 114 1.04 0.65 61.24 40.8 2.29 3.21 178 1.05 0.87 56.33 40.65 1.14 1.26 242 1.03 0.88 44.11 57.99 1.7 2.08 51 1.01 0.72 62.49 42.25 1.62 2.15 115 1 1.01 61.96 42.62 2.1 1.8 179 1.03 0.92 56.25 40.46 1.15 1.19 243 0.97 0.95 45.49 55.73 1.93 2.09 52 1.03 0.85 62.33 42.47 2.14 2.35 116 1.02 0.73 61.98 43.1 1.63 2.08 180 1 0.84 55.9 40.34 1.09 1.19 244 1.07 0.75 55.49 47.71 1.13 1.63 53 0.95 0.95 62.53 42.46 1.92 1.8 117 0.96 0.49 61.73 44.47 1.31 2.4 181 1.01 0.83 55.74 40.32 1.09 1.2 245 0.93 1.69 55.54 69.5 1.34 0.26 54 0.86 1.03 61.94 41.31 2.46 1.91 118 0.95 0.66 60.19 43.56 1.37 1.88 182 1 0.81 55.73 40.32 1.07 1.22 246 0 0 0 11 1 1 55 1.06 0.88 40.29 61.76 2.04 2.75 119 0.96 0.92 59.78 43.06 1.69 1.65 183 1 0.81 55.73 40.32 1.07 1.22 247 0 0 0 11 1 1 56 0.97 0.9 63.62 41.81 1.96 1.94 120 1.03 0.86 43.52 60.9 1.59 2.11 184 0.99 0.81 55.74 40.32 1.08 1.22 248 0 0 0 11 1 1 57 1.01 0.82 61.83 40.74 1.9 2.17 121 0.95 0.97 60.98 43.26 1.81 1.61 185 1 0.81 55.77 40.32 1.08 1.22 249 0 0 0 11 1 1 58 1.08 0.84 62.07 41.65 2.04 2.35 122 0.94 0.71 60.63 43.1 1.38 1.71 186 1.01 0.79 55.77 40.32 1.05 1.22 250 0 0 0 11 1 1 59 0.88 0.7 60.34 40.04 2.17 2.53 123 0.98 0.62 60.01 42.96 1.17 1.79 187 1.01 0.79 55.77 40.32 1.05 1.22 251 0 0 0 11 1 1 60 0.95 0.78 61.99 41.89 2.06 2.29 124 1.06 0.72 59.34 42.84 1.11 1.56 188 1 0.78 55.81 40.32 1.04 1.22 252 0 0 0 11 1 1 61 1.01 0.87 41.6 62.47 1.57 2.53 125 1.01 0.79 58.76 42.55 1.12 1.38 189 1 0.79 55.81 40.32 1.05 1.22 253 0 0 0 11 1 1 62 0.97 0.85 61.86 40.64 1.79 1.56 126 0.96 0.8 58.15 42.19 1.33 1.48 190 1 0.79 55.83 40.32 1.06 1.22 254 0 0 0 0 0 0 63 0.97 0.81 61.59 40.43 1.81 1.68 127 0.89 0.9 58.69 42.69 1.75 1.55 191 1 0.78 55.83 40.33 1.04 1.22 255 0 0 0 0 0 0 64 0.98 0.78 60.5 39.22 2.11 1.91 128 1.03 0.94 41.1 57.39 1.62 2.1 192 1.01 0.77 55.85 40.33 1.02 1.22 256 0 0 0 0 0 0

[0065] Step 4: According to the above process, the fitting Gaussian curve of each horizontal direction of the image is obtained. The distance between the two peaks in the Gaussian curve can be regarded as the width of the image in the horizontal direction, and the edge position and the horizontal center point position of the scratch in the image in each horizontal direction are calculated. The Gaussian curve fitting in the horizontal direction is shown as follows: Figure 4 As shown in Figure 2, p1 = 1.05, p2 = 0.76, p3 = 35.13, p4 = 47.74, p5 = 1.45, p6 = 1.68; the detected scratch area is shown in Figure 2. Figure 5 shown.

[0066] Instead of using the background texture suppression and geometric shape filtering in the above steps, the detection results of the Otsu algorithm and the triangular threshold algorithm are used, such as Figure 6 and Figure 7 As shown, the detection area includes point-shaped or cluster-shaped misdetected areas in the image background.

[0067] Step 5: Since there may be burrs on the edge transition of each scratch sub-area in the horizontal direction, it is necessary to correct the edge position of the sub-area to make the edge transition of the upper and lower sub-areas in the image smoother; wherein the scratch edge position of the detected scratch area in the horizontal direction is corrected, and the calculation formula is:

[0068]

[0069] In formula (2), x i is the edge position of the i-th row of the image, n is the total number of scratch sub-areas in the horizontal direction of the scratch detection area, N is the number parameter of adjacent correction positions, the edge positions on both sides of the n-2N sub-areas are re-corrected, and the smoothing range of the current sub-area correction is modified by changing the size of N. In this embodiment, the preset value N is 3.

[0070] The image is then processed by morphological opening to calculate the scratch length and area: the line connecting the center points of all sub-regions (horizontal center points) is taken as the scratch length, and the scratch area is the sum of the corrected areas of each sub-region.

[0071] Step 6: Calculate the real scratch width by the scratch area direction: In order to obtain the real width information of the scratch in the image, rather than the scratch length in the horizontal direction, such as Figure 8 As shown, A1, A2, ..., A i and B1, B2, …, B i are the scratch boundary points of each adjacent sub-region, O1, O2, ..., O i are the center positions of the scratches in each sub-area, and the polyline they form is the scratch path; i The actual width of the scratch at The line segments are perpendicular to A i The intersection point M where multiple segments intersect i and B i The intersection point N where the polylines intersect i The distance between.

[0072] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.

Claims

1. A method for detecting scratches on a steel surface based on machine vision, characterized in that: The steps include: S1, obtaining steel surface images through a camera; S2, preprocessing the steel surface image obtained in step S1 to obtain a scratch structure area; S3. Use Gaussian function to fit the grayscale gradient data in the horizontal direction of the image: The horizontal gradient of the image is used to describe the change law of the grayscale value in the horizontal direction of the image. The horizontal gradient of the image is calculated using the first-order central difference. The calculation formula is as follows: In formula (1), δf(x,y k ) is the grayscale gradient value of the kth column in the horizontal direction, f(x,y k+1 ) and f(x,y k-1 ) are respectively the k+1th column and the k-1th column in the same horizontal direction; The position information of the scratch is determined by the fitted Gaussian curve; S4, judging the horizontal edge position and the horizontal center point position of the scratch by the fitted Gaussian curve; S5. Correct the scratch edge position in the horizontal direction of the detected scratch area. The calculation formula is: In formula (2), x i is the edge position of the i-th row of the image, n is the total number of scratch sub-regions in the horizontal direction of the scratch detection area, N is the number parameter of adjacent correction positions, the edge positions on both sides of the n-2N sub-regions are re-corrected, and the smoothing range of the current sub-region correction is modified by modifying the size of N; Then the image is processed by morphological opening operation to calculate the scratch length and area; S6. Calculate the actual scratch width based on the direction of the scratch area.

2. The method for detecting scratches on a steel surface based on machine vision according to claim 1, characterized in that: In the step S2, the steel surface image is preprocessed, specifically: the image is grayed, the background texture area in the image is suppressed using the relative total variation algorithm, and the scratch structure area in the image is enhanced.

3. The method for detecting scratches on a steel surface based on machine vision according to claim 2, characterized in that: In the enhanced image scratch structure area, the image is segmented by the adaptive threshold segmentation method, and the non-scratch connected areas initially segmented in the image are filtered by a method based on geometric morphological features. The connected areas that do not meet the constraints are regarded as non-scratch connected areas, and the grayscale value in the area before segmentation is replaced by the average grayscale value of the pixels in the non-connected area.

4. The method for detecting scratches on a steel surface based on machine vision according to claim 3, characterized in that: The constraint range of the geometric features is specifically: Among them, S is the area of ​​the connected region, R L is the aspect ratio of the connected region, R S is the area ratio of the connected region, C is the circularity of the connected region; The gray value processing calculation formula of the non-scratch connected area is: In formula (3), g(x, y) is the gray value of the pixel at position (x, y), p is the pixel in region R, and N(p) represents the number of p.

5. The method for detecting scratches on a steel surface based on machine vision according to claim 1, characterized in that: The step S3 further includes: assuming that the distribution of the horizontal gradient near the scratch edge in the image is a normal distribution, and the horizontal gradient at the scratch position is represented as a linear superposition of two Gaussian functions, and the calculation formula of the Gaussian function is: In formula (4), p1 and p2 are the peak values ​​of the horizontal gradients on both sides of the scratch, p3 and p4 are the positions of the two peak values, and p5 and p6 are the standard deviations of the two Gaussian curves.

6. The method for detecting scratches on a steel surface based on machine vision according to claim 1, characterized in that: The step S6 is specifically as follows: by calculating the line connecting the center points of adjacent sub-areas and making the normal of the line, the intersection points of the lines connecting the left and right sides of the adjacent sub-areas and the normal are calculated respectively, and the distance between the two intersection points is recorded as the actual width of the scratch in the current sub-area.

Citation Information

Patent Citations

  • A method for detecting scratches on metal parts based on image enhancement

    CN115359044B

  • A computer vision-based method for detecting milling cutter scratches

    CN115690105B

  • Computer host shell scratch detection method based on image features

    CN117197138B

  • Rapid strip steel scratch defect detection method based on image recognition

    CN113628189A

  • Channel scratch depth and width measuring method based on speckle domain Gaussian distribution fitting

    CN115628692A