A real-time detection system for defects of automobile steel wire
By combining image acquisition and feature analysis modules, the weighted gradient direction entropy and texture anisotropy suppression factor are calculated. The dark field gradient flux aggregation index is used to solve the false detection problem caused by interference from high-brightness reflective bands, and the accurate identification and stable detection of defects on the surface of automotive steel wires are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WUHAN MINGYU METAL PARTS CO LTD
- Filing Date
- 2026-03-20
- Publication Date
- 2026-06-26
Smart Images

Figure CN121904038B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology. More specifically, this invention relates to a real-time detection system for defects in automotive steel wires. Background Technology
[0002] The steel wires, springs, and spring frames of automotive seat frames are core components ensuring the comfort and safety of vehicle passengers. During the drawing, bending, and welding processes of the steel wires, defects such as cracks, rust, and scratches often appear on the surface due to the quality of raw materials or processing techniques. If these defects are not detected in time, they will directly affect the strength and durability of the seat frame, and may even lead to breakage and failure during use. Therefore, establishing an efficient and accurate steel wire surface quality inspection mechanism is crucial for meeting quality management system requirements and ensuring driving safety.
[0003] In related technologies, automated inspection methods based on machine vision are commonly used to inspect the surface of steel wire. These methods mainly acquire grayscale images of the steel wire surface using industrial cameras, and then use grayscale thresholding algorithms or conventional edge detection operators to extract high-contrast regions from the image to identify potential defect locations.
[0004] However, related technologies have significant limitations when processing cylindrical metal surfaces with highly reflective properties. Under illumination, the steel wires of automotive seats produce axially distributed, highly reflective bands, and the inherent drawing process textures on their surfaces also exhibit abrupt gradient changes in images. Existing detection methods often struggle to effectively distinguish these normal process marks and reflective bands from actual physical defects. This leads to systems easily misclassifying reflective bands as defects or missing minute cracks due to excessive suppression of texture interference, resulting in a high false detection rate and making it difficult to meet the stringent requirements of modern production lines for detection stability and accuracy. Summary of the Invention
[0005] To address the technical problems of high false detection rate and poor stability in defect detection caused by high-brightness reflective bands on the steel wire surface and interference from drawing process textures in the prior art, this invention provides a real-time defect detection system for automotive steel wires. The system includes the following modules: an image acquisition module, which segments the original image to obtain a binary mask; performs a bitwise AND operation between the binary mask and the grayscale image of the original image to extract the effective region, resulting in a foreground grayscale image; a feature analysis module, which acquires the gradient magnitude and gradient direction angle of the foreground grayscale image; calculates the weighted gradient direction entropy based on the histogram distribution of the gradient direction angle within the sliding window of the pixels in the foreground grayscale image and the sum of the gradient magnitudes; and acquires the structural tension of the pixels. The structure tensor matrix of each pixel is decomposed into principal and secondary eigenvalues. The texture anisotropy suppression factor is calculated by combining the weighted gradient direction entropy with the eigenvalues. The orientation alignment is constructed by the cosine of the difference between the gradient direction angle of the displacement vector pointing to a neighboring pixel within its sliding window and the gradient direction angle of that neighboring pixel. The dark field gradient flux aggregation index is calculated by combining the grayscale values of the pixels within the sliding window. The defect detection module obtains the defect response value based on the weighted gradient direction entropy, texture anisotropy suppression factor, and dark field gradient flux aggregation index to construct a defect response map. Finally, the defect response map is used to determine the steel wire defect.
[0006] This invention focuses on the steel wire body region. A gradient field is constructed using a feature analysis module, and a weighted gradient direction entropy is calculated. Utilizing the difference between the disordered texture direction of real defects and the consistent texture direction of reflective strips, the interference of high-brightness reflective strips on detection is effectively suppressed. By calculating a texture anisotropy suppression factor dynamically modulated by entropy values, the significant anisotropic characteristics of normal wire drawing process textures and the isotropic characteristics of defects are utilized to accurately eliminate the influence of normal process textures while retaining the characteristics of minor defects. By calculating the dark field gradient flux aggregation index, the feature of a dark center and surrounding gradients converging inwards is captured, further confirming the authenticity of concave defects. Finally, a defect judgment module fuses multi-dimensional features for steel wire defect judgment, achieving accurate identification of surface defects on automotive steel wires. This solves the problem of traditional methods being unable to distinguish between normal process traces and real defects, reducing the false detection rate.
[0007] Preferably, the step of segmenting the original image to obtain a binary mask includes: segmenting the original image using the Otsu algorithm to obtain a binary mask.
[0008] Preferably, obtaining the gradient magnitude and gradient direction angle of the foreground grayscale image includes: obtaining the gradient magnitude and gradient direction angle of the foreground grayscale image through the Sobel operator.
[0009] Preferably, the weighted gradient direction entropy satisfies the following relationship: In the formula, Image coordinates The weighted gradient direction entropy of the pixel. For The central sliding window area, For the gradient magnitude field, the first Line 1 Gradient magnitude of column pixels, This represents the maximum amplitude in the gradient magnitude field. Let be the side length of the sliding window. This represents the total number of intervals in the gradient direction angle histogram. for The inner gradient direction falls into the first Frequency in each angle interval To prevent division by zero of constants.
[0010] This invention uses weighted gradient direction entropy to correct the degree of texture disorder by utilizing the average gradient energy intensity of local regions. When a local region simultaneously possesses both texture disorder and strong contrast, its entropy value is amplified, thereby effectively enhancing the signal response of real defects. At the same time, by utilizing the unidirectional characteristic of reflective bands, its entropy value is kept at a low level, thus accurately distinguishing defects from reflective areas even under strong light interference.
[0011] Preferably, the step of calculating the texture anisotropy suppression factor by combining the weighted gradient direction entropy and eigenvalues includes: using the larger of the two eigenvalues as the principal eigenvalue and the smaller of the two eigenvalues as the secondary eigenvalue, and obtaining the texture anisotropy suppression factor of the pixel based on the weighted gradient direction entropy of the pixel and the difference between the principal eigenvalue and the secondary eigenvalue.
[0012] Preferably, the texture anisotropy suppression factor satisfies the following relationship: In the formula, Image coordinates Texture anisotropy suppression factor at each pixel, Image coordinates The weighted gradient direction entropy of the pixel. Image coordinates The principal eigenvalues of the structure tensor matrix of the pixel at that location. Image coordinates The second eigenvalues of the pixel structure tensor matrix. These are the preset sensitivity control parameters. To prevent division by zero constants, It is an exponential function with the natural constant as the base.
[0013] This invention measures the degree of anisotropy of local texture by the difference in structural tensor eigenvalues and dynamically adjusts the suppression sensitivity by weighted gradient directional entropy. When the texture direction disorder is high, the suppression intensity for anisotropic textures is automatically reduced to prevent false suppression of tiny, messy scratches; while when the texture direction consistency is strong, a high suppression intensity is maintained. This allows for the targeted elimination of interference from normal wire drawing process textures with specific extension directions on the detection results, improving adaptability to complex texture backgrounds.
[0014] Preferably, the dark field gradient flux aggregation exponent satisfies the following relationship: In the formula, Image coordinates Dark field gradient flux aggregation index at a given pixel. Coordinates in the foreground grayscale image The grayscale value of the pixel at that location. For The central sliding window area, This is the preset dark field enhancement factor. for The internal coordinates are The gradient magnitude of the pixel, for The internal coordinates are pixel to center pixel Euclidean distance, for The internal coordinates are The degree of orientation alignment of the pixels.
[0015] This invention achieves the effect of filtering out gradients pointing towards the center by accumulating only the gradient flux that diverges radially outward and filtering out gradients pointing towards the center by using the cosine value of the difference between the gradient direction and the displacement direction and performing non-negative truncation. It describes the characteristic that the gradient vector diverges radially outward due to the low gray level at the center of the concave structure and the high gray level around the periphery. It ensures that a response is generated only when the brightness of the surrounding pixels is higher than that of the central pixel and the gradient direction is consistent with the centrifugal displacement direction, thereby effectively eliminating false edge interference caused by flat surfaces or convex structures.
[0016] Preferably, the degree of directional alignment satisfies the following relationship: In the formula, for The internal coordinates are The degree of orientation alignment of the pixels. For The central sliding window area, for The internal coordinates are The gradient direction and angle of the pixel. for Inner center pixel Pointing coordinates are The angle of the displacement vector of the pixel. This is the function for finding the maximum value.
[0017] Preferably, the defect response value satisfies the following relationship: In the formula, For the defect response diagram, the first Line 1 Defect response values of column pixels, Image coordinates The weighted gradient direction entropy of the pixel. Image coordinates Texture anisotropy suppression factor at each pixel, Image coordinates Dark field gradient flux aggregation index at a given pixel.
[0018] This invention obtains the defect response value by using weighted gradient directional entropy, texture anisotropy suppression factor, and dark field gradient flux aggregation index. It utilizes the physical conditions that a defect must simultaneously satisfy texture disorder, no specific extension direction, and microscopic concavity. As long as a pixel has any non-defect feature such as the orderliness of reflective bands or the directionality of brush marks, its response value is suppressed, thereby eliminating complex interference terms and improving the anti-interference ability and judgment confidence of the detection system.
[0019] Preferably, the step of determining the steel wire defect based on the defect response map includes: if the total number of pixels with values greater than the alarm threshold in the defect response map exceeds the area threshold, the current steel wire is determined to be abnormal.
[0020] The beneficial effects of this invention are as follows: This invention calculates the distribution entropy of the gradient direction angle within a local sliding window. It utilizes the physical phenomenon that the gradient direction of the high-brightness reflective band on the steel wire surface is highly consistent, while the gradient direction of cracked or corroded areas is randomly distributed. Through weighted calculation, it directly reduces the signal response of the reflective area, thus solving the problem of detecting reflective interference on cylindrical metal surfaces without changing the lighting scheme. Simultaneously, this invention utilizes the eigenvalue differences of the structural tensor to distinguish between normal wire drawing process textures extending along the axial direction and dotted or irregular defects. Combined with dynamic adjustment of the suppression intensity based on entropy values, it can automatically filter out normal processing marks while retaining chaotic scratch features, avoiding false alarms caused by process textures. This invention also utilizes the geometric feature that the center of a real pit or crack defect has a lower grayscale value and the surrounding gradient vectors naturally converge towards the center. By calculating the deviation between the gradient vector and the displacement vector, it distinguishes real three-dimensional concave defects from mere surface stains or watermarks, improving the ability to identify real physical damage. Finally, by using masking operations to remove the conveyor belt background during the image acquisition stage and uploading only abnormal images containing defects during the local judgment stage, this invention reduces the calculation and transmission of invalid background areas and normal samples, thereby achieving real-time response and shutdown control of high-speed production lines with limited hardware resources. Attached Figure Description
[0021] Figure 1 This is a schematic diagram illustrating a system block diagram of a real-time detection system for automotive steel wire defects according to the present invention;
[0022] Figure 2 This is a schematic diagram illustrating the system block diagram of the feature analysis module;
[0023] Figure 3 This is a schematic original image showing the surface of the steel wire in this invention;
[0024] Figure 4 This is a schematic diagram illustrating the weighted gradient direction entropy distribution in this invention;
[0025] Figure 5 This is a schematic diagram illustrating the defect response in this invention. Detailed Implementation
[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0028] This invention provides a real-time detection system for defects in automotive steel wires. For example... Figure 1 As shown, a real-time detection system for automotive steel wire defects includes an image acquisition module 100, a feature analysis module 200, and a defect determination module 300, which are described in detail below.
[0029] Image acquisition module 100 is used to acquire a foreground grayscale image of the surface of the car steel wire.
[0030] It should be noted that the production environment of automotive steel wire is complex. The raw field of view captured by the line scan camera typically contains a large amount of conveyor belt background, mechanical fixtures, and ambient light noise. This causes subsequent gradient and entropy calculations across the entire image to consume edge computing resources, and high-frequency textures in the background are prone to generating false detection signals. Therefore, this invention uses mask extraction and bitwise operations to extract the steel wire body region, eliminating background interference and thus reducing the data processing workload of subsequent algorithms.
[0031] Specifically, at the edge computing node of the automotive steel wire feed inlet, the original image of the steel wire surface is acquired by a linear scan camera. The original image is then subjected to Otsu adaptive thresholding to obtain a binary mask containing only the steel wire region. A bitwise AND operation is performed between the grayscale image of the original image and the binary mask to extract the effective area of the steel wire surface. The effective area is then converted into single-channel grayscale data to obtain the foreground grayscale image.
[0032] Feature analysis module 200 is used to calculate and extract multidimensional physical features of the steel wire surface, such as... Figure 2 As shown, the feature analysis module 200 includes a gradient information extraction submodule 201, a texture clutter analysis submodule 202, a texture suppression submodule 203, and a depression recognition submodule 204.
[0033] The gradient information extraction submodule 201 is used to construct the gradient magnitude field and gradient direction field based on the Sobel operator.
[0034] It should be noted that, typically, defects such as cracks and scratches on the surface of automotive steel wires appear as drastic abrupt changes in local grayscale values in images. However, simple grayscale values are easily affected by fluctuations in workshop lighting, making direct grayscale-based detection methods difficult to adapt to dynamically changing production environments. Therefore, this invention calculates the gradient information of the image, capturing the rate and direction of grayscale changes, and constructs a gradient amplitude field and gradient direction field that reflect the image's texture structure. This provides structured feature data that is insensitive to changes in lighting for subsequent entropy flow analysis.
[0035] Specifically, a Sobel-based convolution operation is performed on the foreground grayscale image to obtain the horizontal and vertical gradient components. Based on the horizontal and vertical gradient components, the gradient magnitude of each pixel is calculated to construct a gradient magnitude field. Inverse trigonometric function operations are performed on the horizontal and vertical gradient components to calculate the gradient vector angle of each pixel and construct a gradient direction field.
[0036] The texture clutter analysis submodule 202 is used to calculate the weighted gradient direction entropy in the neighborhood of a pixel.
[0037] It should be noted that automotive steel wires have a cylindrical metal surface, which inevitably produces bright reflective bands distributed along the axial direction under light illumination. These reflective bands are perpendicular to the wire axis, resulting in a high degree of consistency in the gradient direction within them. This often leads traditional algorithms to misidentify these bright reflective bands as defects. In contrast, real cracks or dents, due to the irregularity of their microstructure, cause light to scatter in all directions, resulting in a chaotic distribution of local gradient directions. Therefore, this invention constructs a weighted gradient direction entropy by calculating the entropy value of the gradient direction within a local region and combining it with a weighted average of the gradient magnitude.
[0038] Specifically, taking any pixel in the foreground grayscale image as the center, a segment is cut out in the gradient direction field. A sliding window of a certain size is used to count the gradient direction angles of all pixels within the sliding window, constructing a gradient direction angle histogram. The sum of gradient magnitudes at the corresponding positions within the sliding window in the gradient magnitude field is obtained. Based on the probability distribution of the gradient direction angle histogram and the sum of gradient magnitudes, the weighted gradient direction entropy of the center pixel is calculated. The value is 5, and the implementers can adjust it according to the actual situation. Size.
[0039] Specifically, the weighted gradient directional entropy satisfies the following relationship:
[0040] ;
[0041] In the formula, Image coordinates The weighted gradient direction entropy of the pixel. For The central sliding window area, For the gradient magnitude field, the first Line number Gradient magnitude of column pixels, This represents the maximum amplitude in the gradient magnitude field. Let be the side length of the sliding window. In this embodiment, the total number of intervals in the gradient direction angle histogram is [number]. , for The inner gradient direction falls into the first Frequency in each angle interval To prevent division by zero constants, .
[0042] It should be noted that, This represents the degree of disorder in the gradient direction within a local area. The larger the value, the more chaotic the texture direction in the local area, and the more likely it is to correspond to cracks or pits with severe light scattering. The smaller the value, the more uniform the texture direction, and the more likely it is to correspond to normal reflective bands or smooth surfaces. This represents the average gradient energy intensity of the local region. The larger the value, the more intense the gray-level contrast in the local region. Therefore, the gradient energy term is used to correct the degree of disorder upwards. When a local region simultaneously possesses both directional disorder and strong contrast, its contribution to the degree of disorder is non-linearly amplified, thereby enhancing the true defect signal and suppressing low-contrast noise.
[0043] For example, Figure 3 This is the original image of the surface of the steel wire in this invention. Figure 4 This is a weighted gradient direction entropy distribution map in this invention. As can be seen from the map, the defect area has a high entropy value due to its messy texture, while the bright reflective band has a low entropy value due to its highly consistent gradient direction. This achieves the goal of enhancing the real defect signal and suppressing low contrast noise.
[0044] Texture suppression submodule 203 is used to calculate texture anisotropy suppression factor.
[0045] It should be noted that, typically, during the drawing process, steel wires leave fine, axially distributed brush marks on their surface. These marks are normal process traces. However, from a microscopic perspective, these brush marks also exhibit high gradient amplitudes, easily interfering with the detection of point corrosion or transverse cracks. Therefore, this invention utilizes the geometric difference between the strong directional consistency of brush marks and the directional uniformity of point defects. By analyzing the eigenvalues of the structural tensor, an anisotropy suppression factor is calculated to suppress the signal of normal textures with strong directionality.
[0046] It should be noted that, under normal circumstances, the drawing process of steel wire leaves fine, axially distributed brush marks on its surface. These marks are normal process traces and have a consistent direction. Although the eigenvalue differences of the structural tensor can distinguish between anisotropic marks and isotropic defects, under certain complex conditions, even tiny scratches may exhibit a certain directionality and be falsely suppressed. Since the weighted gradient directional entropy already represents the degree of disorder in a local area, this invention dynamically modulates the anisotropic suppression intensity using weighted gradient directional entropy: when the entropy value is high, the suppression sensitivity to marks is reduced to preserve potential defect features; when the entropy value is low, normal suppression intensity is maintained, thereby eliminating processing marks while preventing the missed detection of tiny defects.
[0047] Specifically, the gradient magnitude field and weighted gradient direction entropy are obtained. For each pixel, its structure tensor matrix is calculated. The structure tensor matrix is decomposed into eigenvalues to obtain two eigenvalues. The larger eigenvalue is taken as the principal eigenvalue and the smaller eigenvalue as the secondary eigenvalue. Combined with the weighted gradient direction entropy of the pixel, the texture anisotropy suppression factor of the pixel is calculated.
[0048] Specifically, the texture anisotropy suppression factor satisfies the following relationship:
[0049] ;
[0050] In the formula, Image coordinates Texture anisotropy suppression factor at each pixel, Image coordinates The weighted gradient direction entropy of the pixel. Image coordinates The principal eigenvalues of the structure tensor matrix of the pixel at that location. Image coordinates The second eigenvalues of the pixel structure tensor matrix. These are the preset sensitivity control parameters. To prevent division by zero constants, In this embodiment, it is an exponential function with the natural constant as the base. , The implementers can determine the implementation based on the actual situation. and .
[0051] in, This represents the degree of anisotropy of the local texture. The larger the value, the more extensible the local texture is in a specific direction, and the more likely it is to correspond to normal brush marks. In this case, the texture anisotropy suppression factor... The closer the value is to 0, the more it suppresses normal texture response; the smaller the value, the more uniform the local texture distribution in all directions, and the more likely it corresponds to point-like corrosion or irregular pits. In this case, the texture anisotropy suppression factor... The closer it is to 1, the better it preserves the defect characteristics at that location; weighted gradient directional entropy The larger the value, the more chaotic the texture of the area where the pixel is located, and the more likely it is to be in a defect area. In this case, regardless of the degree of anisotropy of the area to which the pixel belongs, it should not be regarded as a normal brushed texture. As The sensitivity coefficient makes A larger value indicates a higher texture anisotropy suppression factor at the defect location pixels, making... The smaller the size, the less the impact of the texture of the normal process on the detection of defects in the steel wire.
[0052] The indentation recognition submodule 204 is used to calculate the dark field gradient flux aggregation index.
[0053] It should be noted that, because defects such as cracks and pits on the surface of steel wire physically manifest as three-dimensional microscopic depressions, light is scattered and absorbed at the edges of the depressions, causing the defect center to typically appear dark, and the surrounding gradient vectors exhibit a converging topological feature pointing towards the defect center. Normal reflective bands or surface stains, on the other hand, typically exhibit divergent or translated gradient characteristics. Therefore, this invention calculates the flux intensity of gradient vectors converging towards the center point within a local region and combines this with grayscale inversion weighting to construct a dark-field gradient flux aggregation index, further confirming the authenticity of the defect from a topological geometric perspective.
[0054] Specifically, based on the foreground grayscale image, gradient magnitude field, and gradient direction field, within the neighborhood of each pixel, the displacement vector from the center pixel to the neighboring pixels is calculated. The gradient direction angle is obtained by performing an inverse trigonometric function operation on the displacement vector. Combined with the gradient direction angles of the neighboring pixels in the gradient direction field, the directional alignment degree is constructed based on the cosine value of the difference between the gradient direction angle and the displacement direction angle. Combined with the grayscale value of the center pixel, the dark field gradient flux aggregation index of that pixel is calculated.
[0055] Specifically, the dark field gradient flux aggregation exponent satisfies the following relationship:
[0056] ;
[0057] ;
[0058] In the formula, Image coordinates Dark field gradient flux aggregation index at a given pixel. Coordinates in the foreground grayscale image The grayscale value of the pixel at that location. For The central sliding window area, In this embodiment, the preset dark field enhancement coefficient is used. , for The internal coordinates are The gradient magnitude of the pixel, for The internal coordinates are pixel to center pixel Euclidean distance, for The internal coordinates are The gradient direction and angle of the pixel. for Inner center pixel Pointing coordinates are The angle of the displacement vector of the pixel. for The internal coordinates are The degree of orientation alignment of the pixels. This is the function for finding the maximum value.
[0059] in, This represents the degree of alignment between the neighborhood gradient direction and the centrifugal direction. When this value is positive, it indicates that the gradient vector points to the center, which means that the surrounding brightness is higher than the center, consistent with the characteristics of a concave dark spot. It serves to accumulate only the centripetal gradient flux and filter out the centrifugal gradient. The distance-inverse weighting term makes edge points closer to the center have a larger weight, while interference points farther away have a smaller weight, thus enhancing the ability to capture local micro-points. The dark field weight represents the center point; a larger value indicates a lower gray level at the center point, thus correcting the aggregation index upwards. The dark field gradient flux aggregation index is designed to output a high value only when a local region simultaneously satisfies the conditions of a dark center and surrounding gradients collapsing towards the center.
[0060] The defect determination module 300 is used to generate a defect response map and perform edge determination.
[0061] It should be noted that automotive steel wire production lines operate at extremely high speeds, and the computing power and storage space of edge computing nodes are limited. Uploading all acquired images, regardless of quality, to the cloud would not only strain bandwidth and waste storage, but also cause network transmission delays that would prevent timely issuance of stop commands, resulting in continuous defective products. Therefore, the defect detection module performs the final defect determination directly at the edge, triggering alarms and data uploads only when an anomaly is detected, achieving low-latency real-time response. Thus, the defect detection module uses the dark field gradient flux aggregation index, texture anisotropy suppression factor, and weighted gradient direction entropy for defect determination.
[0062] Specifically, each pixel coordinate in the image is traversed, and the defect response value at that coordinate is obtained based on the weighted gradient direction entropy, texture anisotropy suppression factor, and dark field gradient flux aggregation index. A defect response map is constructed, and the defect response map is traversed. The value of each pixel is compared with a preset alarm threshold, and the pixel with a value greater than the preset alarm threshold is the defect pixel.
[0063] Furthermore, if the total number of defective pixels exceeds the preset area threshold, the edge computing node immediately sends a stop signal to the PLC controller and only marks the foreground grayscale image of that frame as an abnormal sample to be uploaded to the cloud server; if the total number of defective pixels is less than or equal to the area threshold, the edge computing node determines that the current wire is qualified and discards the image data of that frame to release memory space.
[0064] Specifically, the defect response value satisfies the following relationship:
[0065] ;
[0066] In the formula, For the defect response diagram, the first... Line number Defect response values of column pixels, Image coordinates The weighted gradient direction entropy of the pixel. Image coordinates Texture anisotropy suppression factor at each pixel, Image coordinates Dark field gradient flux aggregation index at a given pixel.
[0067] in, The value corresponds to the degree of disorder in the local texture direction; the reflective area has a smaller value because the light direction is unidirectional. The size corresponds to the degree of isotropy of the local structure. Due to the significant extension direction of the wire drawing process texture, this value tends to be close to 0. The magnitude of the defect response value corresponds to the degree of local micro-geometric concavity. Flat surfaces have a smaller value due to the lack of centripetal gradient flux. Therefore, the defect response value will only be larger when a pixel simultaneously exhibits disordered gradient directions, no specific extension direction, and micro-concavity. If the pixel location has any non-defect feature, such as the orderliness of reflective bands leading to low weighted gradient direction entropy, or the directionality of brush marks leading to low texture anisotropy suppression factor, the defect response value will approach 0, thereby suppressing the signal response at that location.
[0068] For example, Figure 5 The defect response map in this invention shows that, after considering the weighted gradient direction entropy, texture anisotropy suppression factor, and dark field gradient flux aggregation index, only the real defect area retains a high response value. Therefore, accurate steel wire defect detection can be achieved through the defect response value.
Claims
1. A real-time detection system for automotive steel wire defects, characterized in that, include: The image acquisition module segments the original image of the car wire to obtain a binary mask. The binary mask and the grayscale image of the original image are then bitwise ANDed to extract the effective area of the car wire body to obtain the foreground grayscale image. The feature analysis module obtains the gradient magnitude and gradient direction angle of the foreground grayscale image. For each pixel, based on the histogram distribution of the gradient direction angle of pixels within its sliding window, the gradient direction entropy is calculated. This entropy is then weighted by combining the sum of the gradient magnitudes of all pixels within the sliding window to obtain the weighted gradient direction entropy. The module also obtains the structure tensor matrix of the pixel, performs eigenvalue decomposition on it to obtain principal and secondary eigenvalues, and calculates the texture anisotropy suppression factor by combining the weighted gradient direction entropy with the principal and secondary eigenvalues, satisfying the following relationship: ; In the formula, Image coordinates Texture anisotropy suppression factor at each pixel Image coordinates The weighted gradient direction entropy of the pixel. Image coordinates The principal eigenvalues of the structure tensor matrix of the pixel at that location. Image coordinates The second eigenvalues of the pixel structure tensor matrix. These are the preset sensitivity control parameters. To prevent division by zero constants, It is an exponential function with the natural constant as its base; The orientation alignment is constructed by the cosine of the difference between the gradient direction angle of the displacement vector of a pixel pointing to its neighboring pixels within the sliding window and the gradient direction angle of the neighboring pixel, and the dark field gradient flux aggregation index is calculated by combining the gray values of the pixels within the sliding window. The defect determination module calculates the defect response value and constructs a defect response map by multiplying the weighted gradient direction entropy, texture anisotropy suppression factor and dark field gradient flux aggregation index. Defects in the steel wire are determined based on the defect response diagram.
2. The real-time detection system for automotive steel wire defects according to claim 1, characterized in that, The process of segmenting the original image to obtain a binary mask includes: segmenting the original image using the Otsu algorithm to obtain a binary mask.
3. The real-time detection system for automotive steel wire defects according to claim 1, characterized in that, The step of obtaining the gradient magnitude and gradient direction angle of the foreground grayscale image includes: obtaining the gradient magnitude and gradient direction angle of the foreground grayscale image through the Sobel operator.
4. The real-time detection system for automotive steel wire defects according to claim 1, characterized in that, The weighted gradient directional entropy satisfies the following relationship: ; In the formula, Image coordinates The weighted gradient direction entropy of the pixel. For The central sliding window area, For the gradient magnitude field, the first Line number Gradient magnitude of column pixels, This represents the maximum amplitude in the gradient magnitude field. Let be the side length of the sliding window. This represents the total number of intervals in the gradient direction angle histogram. for The inner gradient direction falls into the first Frequency in each angle interval To prevent division by zero of constants.
5. The real-time detection system for automotive steel wire defects according to claim 1, characterized in that, The step of calculating the texture anisotropy suppression factor by combining the weighted gradient direction entropy and eigenvalues includes: using the larger of the two eigenvalues as the principal eigenvalue and the smaller of the two eigenvalues as the secondary eigenvalue, and obtaining the texture anisotropy suppression factor of the pixel based on the weighted gradient direction entropy of the pixel and the difference between the principal eigenvalue and the secondary eigenvalue.
6. The real-time detection system for automotive steel wire defects according to claim 1, characterized in that, The dark field gradient flux aggregation exponent satisfies the following relationship: ; In the formula, Image coordinates Dark field gradient flux aggregation index at a given pixel. Coordinates in the foreground grayscale image The grayscale value of the pixel at that location. For The central sliding window area, This is the preset dark field enhancement factor. for The internal coordinates are The gradient magnitude of the pixel, for The internal coordinates are pixel to center pixel Euclidean distance, for The internal coordinates are The degree of orientation alignment of the pixels.
7. The real-time detection system for automotive steel wire defects according to claim 6, characterized in that, The degree of directional alignment satisfies the following relationship: ; In the formula, for The internal coordinates are The degree of orientation alignment of the pixels. For The central sliding window area, for The internal coordinates are The gradient direction and angle of the pixel. for Inner center pixel Pointing coordinates are The angle of the displacement vector of the pixel. This is the function for finding the maximum value.
8. The real-time detection system for automotive steel wire defects according to claim 1, characterized in that, The defect response value satisfies the following relationship: ; In the formula, For the defect response diagram, the first... Line number Defect response values of column pixels, Image coordinates The weighted gradient direction entropy of the pixel. Image coordinates Texture anisotropy suppression factor at each pixel, Image coordinates Dark field gradient flux aggregation index at a given pixel.
9. The real-time detection system for automotive steel wire defects according to claim 1, characterized in that, The method of determining steel wire defects based on the defect response map includes: if the total number of pixels with values greater than the alarm threshold in the defect response map exceeds the area threshold, the current steel wire is determined to be abnormal.