Automobile part stamping forming defect detection method based on machine vision
By generating the edge reflectivity index and extracting edge repetition features, and combining convolutional attention networks and multidimensional dynamic response domains, the problem of misjudging cracks by edge reflectivity in existing technologies is solved, and high-precision detection of stamping defects in automotive parts is achieved.
Patent Information
- Application Number
- CN202511634745.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-10
- Publication Date
- 2025-12-16
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing machine vision-based technologies for detecting defects in stamping of automotive parts cannot accurately distinguish between image ghosting caused by edge reflections and actual crack defects, resulting in high false alarm rates and low detection efficiency.
By calculating the brightness gradient and structural orientation differences in the corner regions, a corner reflectivity index is generated. The directional consistency and structural repetition features of the edge line segments are extracted. The crack confidence score is then combined with a convolutional attention network and a multidimensional dynamic response domain to achieve accurate identification of real crack defects in the image.
It effectively reduces the false alarm rate caused by image ghosting, improves the accuracy and stability of detection, enhances the system's robustness to dynamic lighting and deformation interference, and provides highly reliable and high-precision intelligent visual detection.
Smart Images

Figure CN121147210A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of automobile parts stamping forming, and particularly relates to an automobile parts stamping forming defect detection method based on machine vision. BACKGROUND
[0002] The automobile parts stamping forming defect detection based on machine vision refers to using an image sensor and a computer image processing technology to perform high-precision, non-contact automatic detection on the surface of the automobile parts after stamping forming, so as to identify defects such as cracks, pits, wrinkles, burrs, perforations and the like. Through arranging an industrial camera on a stamping production line, the image of the formed parts is collected, and the collected image data is then transmitted to an image processing system. In the system, the image is preprocessed, feature extraction and defect identification are performed through a preset image processing algorithm or a target detection model based on deep learning (such as CNN, YOLO, Mask R-CNN and the like), and the corresponding defect type, defect position and severity and the like are output according to the judgment of the model. The whole detection process usually includes light source control (for suppressing reflection and highlighting defects), image collection (obtaining high-resolution images through multi-angle industrial cameras), image preprocessing (including denoising, enhancement, alignment and the like), defect feature extraction and classification (using traditional image processing or AI algorithm), detection result judgment and feedback (outputting the judgment result and connecting the rejection device), and finally realizing full-automatic online detection of the stamping quality of the parts. Compared with the traditional manual visual inspection method, the detection method based on machine vision not only greatly improves the detection efficiency and accuracy, but also has high consistency and traceability, and can effectively meet the high standard requirements of modern automobile manufacturing on quality control.
[0003] The prior art has the following disadvantages: In the process of realizing the automobile parts stamping forming defect detection based on machine vision, when the edges and corners of the stamping part form multiple inclined surfaces due to structural bending, the light will be reflected multiple times between these multi-angle surfaces, thereby producing a strip-shaped bright edge ghost in the image. This image ghost formed by the edge light reflection is highly similar to the real crack defect in terms of gray scale change, direction distribution and edge continuity, especially in the case of high light intensity or large incident angle, the phenomenon is more obvious. Since the ghost edge has the same linear gray scale mutation characteristics as the crack, the existing automobile parts stamping forming defect detection technology based on machine vision cannot accurately judge whether there is a real crack defect in the image according to the edge repetition characteristics under the condition of image ghost caused by light reflection, thereby causing the system to misidentify the non-physical ghost caused by light reflection as a crack defect. This problem will directly cause a high false positive rate of the detection result, not only interfering with the accuracy of defect identification, but also causing false rejection and repeated inspection of normal parts, thereby reducing the detection efficiency and affecting the stability and reliability of the whole stamping quality detection process.
[0004] The above information disclosed in the BACKGROUND section merely to enhance the understanding of the background of the present disclosure, and therefore it can include information that does not constitute prior art known to those of ordinary skill in the art. SUMMARY
[0005] The object of the present application is to provide a machine vision-based automobile parts stamping forming defect detection method to solve the problems in the background.
[0006] In order to achieve the above-mentioned object, the present application provides the following technical scheme: a machine vision-based automobile parts stamping forming defect detection method, specifically comprising the following steps: S1, generating an edge corner light reflection index by calculating the brightness gradient distribution and structural direction difference of the edge corner region in the automobile parts stamping forming image, and determining the region containing image ghost caused by edge corner light reflection in the image according to the edge corner light reflection index, for identifying whether the image ghost caused by edge corner light reflection occurs or not; S2, extracting edge line segments in the region containing image ghost caused by edge corner light reflection in the image, and generating an edge repetition feature vector based on the direction consistency and structural repetition degree of the edge line segments, for determining the edge repetition feature under the image ghost caused by edge corner light reflection; S3, inputting the edge repetition feature vector into a convolution attention network structure, combining the structural continuity in the image context region to generate a crack credibility score map, for judging whether there is a real crack defect in the image according to the edge repetition feature under the image ghost caused by edge corner light reflection; S4, fusing the crack credibility score map with the brightness disturbance amplitude and direction fluctuation rate of the original edge region of the image to construct a crack credibility fusion surface; S5, extracting the joint distribution of credibility value and edge repetition value based on the crack credibility fusion surface, constructing a multi-dimensional dynamic response domain in the feature space, and performing credibility classification judgment and classification processing on the edge region with crack credibility score in the image according to the dynamic response domain.
[0007] Preferably, S1 specifically comprises the following steps: S101, extracting the edge corner region in the automobile parts stamping forming image, calculating the brightness difference value between each pixel point and its adjacent pixel point in the edge corner region to obtain the brightness gradient distribution, and generating an edge direction vector set according to the gradient change direction to form a structural direction difference feature map; S102, performing weighted fusion processing on the brightness gradient distribution and the structural direction difference feature map, quantizing the fusion result to an edge corner light reflection index according to a preset mapping function, for representing the possibility of multiple light reflection in the edge corner region, to generate an edge corner light reflection index distribution map of the whole image; S103, perform connected domain detection on the edge-corner light reflection index distribution map, determine a pixel set in which the edge-corner light reflection index is continuously higher than a preset threshold, and label the pixel set area as an area in the image containing an edge-corner light reflection generated image ghost for identifying whether the edge-corner light reflection generated image ghost occurs.
[0008] Preferably, S102 specifically comprises the following steps: Each pixel gradient value in the brightness gradient distribution is one-to-one mapped with a direction angle difference value at a corresponding position in the structural direction difference feature map, and a weight factor matrix is constructed based on a linear combination function for regulating the participation proportion of gradient information and direction information in the fusion processing; The brightness gradient distribution and the structural direction difference feature map are weighted and fused by using the weight factor matrix to obtain a multi-source information response value of each pixel point in the fused image, and the multi-source information response value of each pixel point is mapped to a standardized interval as a fusion response output of the edge-corner area; The fusion response output is nonlinearly quantized according to a preset mapping function to generate an edge-corner light reflection index image, and an edge-corner light reflection index distribution map is established in the entire image range for representing the possibility of multiple light reflection in the edge-corner area.
[0009] Preferably, S2 specifically comprises the following steps: In the area in the image containing an edge-corner light reflection generated image ghost, a high-pass edge filtering algorithm is used to detect a brightness gradient mutation area, an edge point set consistent with the edge-corner structural direction is selected through a gradient threshold, and a pixel connected tracking algorithm is used to connect the continuous edge points to form an edge line segment; A direction vector distribution is calculated for the edge line segment, a direction consistency matrix is constructed by using the cosine similarity between the direction vectors, and a structural repetition value is obtained by using autocorrelation analysis operation in combination with the spacing law of the edge line segment in space arrangement, for describing the repeated distribution characteristics of the edge line segment in the edge-corner area; The direction consistency matrix and the structural repetition value are fused to generate an edge repetition feature vector, and the edge repetition feature under the edge-corner light reflection generated image ghost is determined in the feature vector space through clustering calculation, for supporting the subsequent judgment process of the real crack defect.
[0010] Preferably, S3 specifically comprises the following steps: S301, embed the edge repetition feature vector into a two-dimensional spatial feature map and input it into a convolution attention network structure, perform multi-scale convolution operation in the network to extract the spatial correlation of the edge repetition feature, and strengthen the response difference of the edge repetition feature at different scales through a channel attention mechanism; S302, encode the structure coherence feature in the image context region as an auxiliary context feature map, and fuse the intermediate feature map of the convolution attention network structure, so that the edge repetition feature of the crack candidate region maintains coherence with its context structure, and a crack credibility score map is generated based on multiple feature maps; S303, extract high-confidence regions and low-confidence regions in the crack credibility score map, and construct an edge structure difference function according to the spatial position and confidence distribution trend of the edge repetition feature under the image ghosting condition caused by the edge reflection, and use the edge structure difference function to determine whether there is a real crack defect in the image and label the result.
[0011] Preferably, S303 is specifically: Set a confidence distribution threshold range in the crack credibility score map, identify and extract the high-confidence region and the low-confidence region with continuous distribution, and draw the boundary profile through the region growing algorithm, while recording the spatial position and response intensity of each region in the image; Map the edge repetition feature under the image ghosting condition caused by the edge reflection to the confidence region in the image coordinate space, analyze the spatial coincidence and boundary distribution mode between it and the high-confidence region, extract the confidence distribution trend and edge distribution deviation, and construct an edge structure difference function accordingly; Calculate the matching score of each confidence region corresponding to each edge repetition feature in the edge structure difference function, and when the matching score exceeds the crack structure consistency threshold, it is determined that there is a real crack defect in the image; if the matching score is continuously lower than the crack structure consistency threshold, it is determined as a non-crack region caused by edge reflection, and the label result of the real crack defect is output in the image in the form of coordinates.
[0012] Preferably, S4 is specifically: Perform brightness change sampling on the continuous frame images in the original edge region of the image, construct a brightness disturbance amplitude map according to the brightness value fluctuation amplitude of each pixel point in the time dimension, and generate a direction fluctuation rate map by calculating the main direction change rate of adjacent pixels in different frames, which is used to represent the dynamic instability characteristics of the edge region in local brightness and direction; Perform pixel-level alignment processing on the crack credibility score map, the brightness disturbance amplitude map and the direction fluctuation rate map, fuse the crack credibility score map, the brightness disturbance amplitude map and the direction fluctuation rate map after pixel-level alignment processing into a joint response matrix by using channel splicing, and perform multi-dimensional weighted fusion operation on the joint response matrix according to the spatial response consistency function, and output the fusion confidence response map of the edge region; A crack confidence fusion surface is constructed in the fusion confidence response map with the fusion value as the height dimension, and a continuous confidence space is formed by using the gradient trend change of the surface in the edge region and the fusion value distribution mode, which is used to express the spatial distribution structure of the edge region crack existence probability in the image.
[0013] Preferably, S5 is specifically: The crack confidence value of each edge pixel position is extracted in the crack confidence fusion surface, and the edge repetition value of the corresponding position in the edge repetition feature vector is synchronously extracted, the crack confidence value and the edge repetition value form a joint feature group, the joint distribution structure for quantifying the edge region crack response characteristics is generated by constructing a two-dimensional feature statistical graph to analyze the joint distribution density; The joint distribution structure is projected into the feature space, and a multi-dimensional coordinate system is constructed with the crack confidence value, the edge repetition value and the spatial distribution gradient, a multi-dimensional dynamic response domain is constructed by using the kernel density aggregation operation, the region with high response aggregation trend in the feature space is identified, and the different crack response modes are distinguished and expressed in space; According to the boundary shape and aggregation characteristics of each response cluster in the multi-dimensional dynamic response domain, a confidence grading criterion is set, the joint features of the crack confidence scoring region in the image are mapped to the dynamic response domain, the high confidence, medium confidence and low confidence levels are divided through the feature attribution relationship, and the classification processing is performed according to the crack risk level corresponding to each level, the classification label of each edge region is output, and a classification result map is established, which is used to drive the subsequent crack judgment process and detection output.
[0014] In the above technical solution, the technical effects and advantages provided by the present application are: 1、The present application effectively realizes the accurate distinction between the image ghost caused by the edge corner reflection and the real crack defect in the stamping forming image of the automobile parts by constructing a multi-level processing link generated by the edge corner reflection index, edge repetition feature extraction, convolution attention network analysis, brightness disturbance and direction fluctuation fusion, and dynamic response domain classification. Based on the low-level features such as brightness gradient and structural direction difference, combined with the context modeling ability and confidence scoring mechanism of the deep neural network structure, the system can stably identify the image scene with strong false ghost interference, and further complete the confidence grading and risk classification through the crack confidence fusion surface and the multi-dimensional dynamic response domain, thereby effectively reducing the false positive rate caused by the image ghost.
[0015] 2、The application can capture the subtle difference between the ghost region and the real crack in the spatial mode by introducing the edge repetition feature and the structure coherence coding, and realize the hierarchical expression of crack determination through the classification mechanism in the multi-dimensional feature space, thereby improving the accuracy and stability of detection. In addition, the mechanism of fusing the confidence map with the original brightness disturbance and direction fluctuation information improves the robustness of the system to dynamic light and deformation interference, providing high-reliability and high-precision intelligent visual detection support for the stamping quality detection process. BRIEF DESCRIPTION OF DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments described in the present application, and other drawings can also be obtained by those skilled in the art based on these drawings.
[0017] Figure 1 The flowchart of the automobile part stamping forming defect detection method based on machine vision of the present application. DETAILED DESCRIPTION
[0018] Example implementations will now be described more fully with reference to the accompanying drawings. Example implementations may, however, be implemented in many different forms and should not be construed as limited to the examples set forth herein; rather, these example implementations are provided so that this disclosure will be thorough and complete, and will fully convey the scope of example implementations to those skilled in the art.
[0019] The present application provides a machine vision-based automobile part stamping forming defect detection method as shown in Figure 1 The method specifically comprises the following steps: S1, generating an edge corner reflection index by calculating the brightness gradient distribution and structure direction difference of the edge corner region in the automobile part stamping forming image, and determining the region containing image ghost caused by edge corner reflection in the image according to the edge corner reflection index, for identifying whether the image ghost caused by edge corner reflection occurs or not; In this embodiment, S1 specifically comprises the following steps: S101, extracting the edge corner region in the automobile part stamping forming image, calculating the brightness difference value between each pixel point and its adjacent pixel in the edge corner region to obtain the brightness gradient distribution, and generating an edge direction vector set according to the gradient change direction to form a structure direction difference feature map; In the stamping forming image of automobile parts, the corner area can be extracted by first positioning the entire part contour based on a shape template or edge features, and then identifying the corner position area with high curvature change on the contour boundary using geometric corner detection or structural corner positioning algorithm. After positioning, the adjacent pixel gray value difference is scanned pixel by pixel in the corner area to form a brightness change map. Through the gradient amplitude mapping calculated from these brightness difference values, the degree of reflection and the image intensity mutation area can be intuitively reflected. Then, according to the gradient direction change trend, the gradient direction vector of each pixel point is constructed and aggregated into a direction field, which is used to describe the trend of the edge structure. The direction field often appears obvious non-uniform distribution in the corner area, reflecting the possible existence of structural bending, polygonal surface or reflection interference area, providing directional level semantic information for subsequent judgment. The whole processing process decouples the original intensity information and direction information through staged image analysis, and then builds a precise underlying data basis for generating the corner reflection index.
[0020] The corner area refers to the position of the stamping part image where the structure bends or the topography changes, usually with complex geometric configuration and light reflection characteristics. The brightness gradient distribution refers to the set of brightness differences between each pixel and its adjacent pixels in the image, which is used to reflect the most intense area of light intensity change in the image; this feature is extremely sensitive to high reflection areas, especially in metal parts, which is easy to form edge stripes. The structural direction difference refers to the overall inconsistency of the pixel gradient direction in the local area. If the direction vectors deviate from each other by a large angle, it indicates that the structure texture has a mutation or interference. The edge direction vector set is a combination of each pixel gradient direction vector, which provides the spatial distribution of the image texture structure. After aggregating these direction vectors, a feature map can be formed, and the high-dimensional information can reveal the complexity of the structure in the corner area and the possible ghost position, providing directional judgment support for subsequent fusion calculation of the corner reflection index. This process integrates image gray information and structural texture information, and essentially builds a two-dimensional local intensity and morphology perception model.
[0021] S102, the brightness gradient distribution and the structural direction difference feature map are weighted and fused, the fusion result is quantized into a corner reflection index according to a preset mapping function, the corner reflection index is used to represent the possibility of multiple light reflection in the corner area, and a corner reflection index distribution map of the whole image is generated; S103, the corner reflection index distribution map is subjected to connected component detection, a pixel set whose corner reflection index is continuously higher than a preset threshold is determined, and the pixel set area is marked as an area containing a corner reflection generated image ghost in the image, which is used to identify whether a corner reflection generated image ghost occurs.
[0022] After the construction of the corner reflection index distribution map, in order to further extract the area that may exist image ghost interference, the method of connected domain detection is needed to identify the target area. First, traverse all the pixel points in the whole corner reflection index distribution map, filter out the pixel points whose index values are higher than the set threshold, and mark these pixels as candidate points. Then, the four-neighbor or eight-neighbor pixel clustering strategy is used to analyze the connectivity of these candidate points, identify all the adjacent pixel blocks that meet the conditions, and form independent connected regions. Each connected region is regarded as a significant corner reflection area, and its boundary coordinates are used to frame the spatial range of the area. In this way, the interference area caused by multiple reflections of the corner structure and forming image ghost can be clearly marked in the image, which can be used for subsequent false recognition suppression mechanism. This method not only improves the accuracy of reflection interference detection, but also effectively avoids the deviation caused by local abnormal points to the overall judgment.
[0023] The continuous high corner reflection index above the preset threshold is the key basis for identifying the ghost area, and the setting strategy of the preset threshold is crucial. The threshold is usually obtained by historical data sample analysis and image statistical feature training, to ensure that it can cover typical corner ghost areas and will not misinclude ordinary structure change areas. The threshold selection should be within the range of response standardization, with certain sensitivity and fault tolerance. In actual implementation, the Otsu adaptive threshold method or K-means clustering method can be combined to automatically determine the appropriate boundary value, and dynamically adjust the image under different brightness backgrounds. Once the threshold is set, the system can quickly filter out all continuous pixel regions above the threshold, thereby establishing a recognition mechanism with double constraints of spatial continuity and reflection intensity on the corner reflection index distribution map, effectively enhancing the regional expression ability of multiple light reflection phenomena.
[0024] In this embodiment, S102 is specifically: Each pixel gradient value in the brightness gradient distribution is one-to-one mapped with the direction angle difference value at the corresponding position in the structure direction difference feature map, and a weight factor matrix is constructed based on a linear combination function, which is used to regulate the participation proportion of gradient information and direction information in the fusion process; In this process, first of all, the brightness gradient distribution map and the structural direction difference feature map need to be aligned at the pixel level in the image space. Each pixel position has two core attributes: one is the brightness gradient value, which represents the intensity of the gray level change between the pixel and its adjacent pixels, and the other is the direction angle difference value, which represents the degree of angular deviation between the pixel and the adjacent direction vector in the local structure. Mapping these two attributes one-to-one means establishing an explicit correspondence between the brightness change intensity and the direction structure difference at the same spatial position. In order to reasonably allocate the contribution proportion of these two types of information in the fusion process, a linear combination function is introduced to construct a weight factor matrix. The linear combination function is a function structure that combines two input signals into an output value according to the set proportion under the control of fixed parameters. The specific method is to assign a fusion weight to each pair of pixel attributes, and the weight factor value is limited in the range of the pre-defined control strategy, for example, set the gradient response in the area with high brightness gradient but small direction difference to be retained first, and emphasize the structure information expression in the area with dramatic direction change but flat brightness. Through this two-dimensional weight factor matrix generated based on the linear combination function, the optical features and structural features of different regions in the whole image can be adaptively weighted, so as to improve the recognition accuracy and robustness of the subsequent fusion results to the edge light reflection area. The essence of this process is to build a response control mechanism, so that the information fusion is not only based on numerical superposition, but also has the ability of spatial semantic understanding.
[0025] The brightness gradient distribution and the structural direction difference feature map are weighted and fused by using the weight factor matrix to obtain the multi-source information response value of each pixel point in the fused image, and the multi-source information response value of each pixel point is mapped to a standardized interval as the fusion response output of the edge corner area; To realize the weighted fusion of the two feature maps, it is necessary to ensure that the two images are consistent in size and pixel position. Each pixel point will have two original values: one represents the intensity of the brightness change, and the other represents the degree of directional structure difference. The weight factor matrix is a two-dimensional matrix of the same size as the original image generated in the image space, where each element represents the weighting proportion of the two types of input information in the fusion process. This matrix can be constructed by a linear combination function, and the weights can be set adaptively according to the relative relationship between the brightness gradient and the directional difference. For example, if the brightness of a certain pixel suddenly changes strongly but the directional difference is small, the pixel will tend to retain the brightness information in the fusion; on the contrary, if the directional change is intense and the brightness is stable, more emphasis will be placed on the structural information expression. In the fusion operation, each pixel point is weighted and summed by the weight factor to obtain a multi-source information response value. This response value integrates the dual perception ability of intensity and structure, so it can more accurately depict the image abnormal features of the edge and corner regions. Then, the multi-source response values of all pixel points are mapped to a standardized numerical interval, such as the range of zero to one, to improve the contrast between different regions and the stability of subsequent processing of the algorithm. For example, if the brightness gradient of a certain pixel is high and the directional difference is moderate, the corresponding weight factor matrix is 70% for brightness and 30% for direction. The fusion response obtained by weighted calculation can reflect the potential ghosting risk in this region, so it is marked as an edge and corner region of interest in the final output. This fusion strategy not only avoids information loss, but also improves the accuracy and region sensitivity of feature discrimination.
[0026] The fusion response output is nonlinearly quantized according to a preset mapping function to generate an edge and corner reflection index image, and an edge and corner reflection index distribution map is established in the entire image range to represent the possibility of multiple light reflections in the edge and corner regions.
[0027] After the fusion response output is completed, in order to more effectively distinguish whether there is a potential risk of multiple light reflection in the edge corner area, a nonlinear quantization process needs to be introduced to generate an edge corner light reflection index image. The process first performs nonlinear transformation on the fusion response value of each pixel point based on a preset mapping function. The preset mapping function can use a Sigmoid function or an exponential enhancement function, the purpose of which is to compress the medium and low response value area and enhance the high response value area, so that the high light reflection probability area is significantly highlighted in the image. When implemented, the normalized fusion response is taken as input, and an edge corner light reflection index value is generated through table lookup or function calculation. The index value corresponds to the position of each pixel in the image, thereby forming an edge corner light reflection index image. Through this transformation, the pixels of the high-probability ghosting area will be concentrated in the high-value interval, while the low-probability area will be compressed to the low-value interval, improving the visual separation degree and algorithm recognition ability of the image. Further, all pixels of the edge corner light reflection index are organized into a two-dimensional spatial structure in the entire image range to form an edge corner light reflection index distribution map, which is used to comprehensively express the light reflection distribution pattern of the edge corner area in the entire part image. For example, if the fusion response of a certain edge corner pixel is medium and high value, after exponential enhancement mapping, its edge corner light reflection index will be amplified to near the upper limit value, and this pixel will be represented as a high-light identifier in the final distribution map, representing that it is in a region where multiple light reflections may occur, which is beneficial to subsequent interference feature removal and false detection avoidance. This nonlinear quantization and whole image distribution expression strategy jointly construct a high-sensitivity and high-resolution perception mechanism for edge corner light reflection problems.
[0028] S2, extracting an edge line segment in the area in the image where the edge corner light reflection generates image ghosting, and generating an edge repetition feature vector based on the direction consistency and structure repetition degree of the edge line segment, to determine the edge repetition feature in the case of edge corner light reflection generating image ghosting; In this embodiment, S2 is specifically: In the area in the image where the edge corner light reflection generates image ghosting, a high-pass edge filtering algorithm is used to detect the brightness gradient mutation area, the edge point set consistent with the edge corner structure direction is selected through a gradient threshold, and a pixel connected tracking algorithm is used to connect the continuous edge points to form an edge line segment. In the area of the image containing corner reflection producing image ghost, in order to accurately extract the edge line segment with physical feature correlation, first, the high-pass edge filtering algorithm is used to enhance the high-frequency components in the image, highlight the area with sharp gray change, so as to identify the edge structure that may exist crack or reflection ghost. Then, the gradient amplitude of each pixel point is calculated and compared with the set gradient threshold, only those gradient amplitude exceeding the threshold and gradient direction approximately consistent with the theoretical direction of the corner structure are reserved, and this screening process can effectively remove the false edge information with abnormal direction. After screening, the pixel connected tracking algorithm is used to connect these edge points, and the points meeting certain conditions in adjacency relationship are connected to form continuous line segments, so as to construct the edge line segment set of the corner area. The method can help to improve the accuracy and stability of edge detection through multi-level screening and tracking mechanism, and establish an accurate structure basis for subsequent feature extraction.
[0029] The high-pass edge filtering algorithm is an image processing technology for enhancing high-frequency information in the image, which is usually realized by Laplace operator, Sobel filter or Canny operator front-end processing module. Its function is to highlight the edge structure with sharp brightness change in the image, and to suppress the low-frequency background area. The gradient threshold is a parameter for distinguishing strong edge and weak edge, which is usually set by analyzing the gradient histogram of the image, so that only the strong enough edge is reserved for subsequent analysis. The pixel connected tracking algorithm is an algorithm for constructing path based on the spatial position relationship of pixels in the image, which usually uses 8-neighborhood or 4-neighborhood model to judge whether the adjacent pixels belong to the same edge line segment, and uses depth-first or breadth-first search strategy to efficiently splice the edge points into line segments. The cooperative application of the three technologies can realize the extraction of edge line segment with accurate structure and good continuity from complex corner image, and provide reliable input for high-confidence defect recognition.
[0030] The direction vector distribution of the edge line segment is calculated, the direction consistency matrix is constructed by using the cosine similarity between the direction vectors, and the structure repetition value is obtained by using autocorrelation analysis operation combined with the spacing rule of the edge line segment in space arrangement, which is used to describe the repeated distribution characteristics of the edge line segment in the corner area. After the extraction of edge segments, to determine whether the edge segments present the repeated arrangement feature caused by the edge corner reflection, first, the direction vector of each edge segment is extracted, that is, the direction angle is calculated according to the coordinates of the two end points of the segment. The cosine similarity of the direction vectors of all edge segments is calculated two by two to obtain a set of direction similarity scores, thereby constructing a direction consistency matrix to reflect the direction distribution relationship between the edge segments in the region. Then, the arrangement spacing of the edge segments in the image space is analyzed, the distance function between the positions of the segments is calculated, and these distance sequences are input into the autocorrelation analysis operation to observe whether there is a periodic and repeated arrangement pattern. If some edge segments with consistent direction and regular spacing present periodic repetition, it can be determined that the region has a structural repetition phenomenon, and a structural repetition value is generated and used as a quantitative description for the construction of the subsequent edge repetition feature vector. This process helps to analyze the structural differences between visual illusions and actual cracks in the image from the morphological perspective.
[0031] The direction vector distribution is a set of unit vectors calculated from the coordinates of the head and tail of the edge segment, which is used to describe the direction of the edge. The cosine similarity is a standard for measuring the closeness of the included angle between two vectors. When the similarity of two direction vectors is close to 1, it means that the directions are highly consistent. The direction consistency matrix is a similarity table formed by comparing the directions of all edge segments two by two, which is used to identify the direction aggregation characteristics in the segment group. The structural repetition value comes from the autocorrelation analysis operation. This analysis is a signal processing method that maps the spatial position of the edge segment into a discrete sequence and convolves it with its delayed version. If the result appears a peak value at a certain delay value, it means that the segments have a spatial repetition feature. This analysis can effectively identify the periodic edge arrangement caused by the reflection ghost, providing data support for distinguishing real cracks from false structures.
[0032] The direction consistency matrix and the structural repetition value are fused to generate the edge repetition feature vector, and the edge repetition feature under the image ghost caused by the edge corner reflection is determined in the feature vector space through clustering calculation, which is used to support the subsequent judgment process of real crack defects.
[0033] To further identify the edge repeat features caused by the corner reflection in the image, firstly, each direction similarity value in the direction consistency matrix is fused with the corresponding structure repetition value item by item, which can be completed by constructing a multi-dimensional feature vector form. Each edge line segment is represented as a two-component vector containing the direction consistency score and the structure repetition score. Then, the feature vectors of all edge line segments are input into the feature space, and the density peak clustering algorithm is used to analyze the distribution. This clustering method can divide those line segments that are highly concentrated in both direction similarity and structure repetition into the same class based on the relative distance and density distribution relationship between features, forming edge repeat feature clusters. These aggregated areas usually correspond to the repeated ghost structures caused by corner reflection, which are different from the disordered distribution of natural crack edges. In this way, the edge artifacts caused by light can be automatically screened out from the complex image, effectively supporting the further judgment of real crack defects.
[0034] Feature fusion refers to the process of integrating two or more source feature values into a single feature vector according to a logical relationship. In this case, the objects of fusion are direction consistency and structure repetition, which are used to comprehensively reflect the similarity and periodicity of edge line segments. The feature vector space is a mathematical space composed of multiple feature dimensions, and each edge line segment occupies a position in this space. Clustering is an unsupervised learning technique that aims to group data objects according to feature similarity. Density peak clustering is a clustering strategy based on local density and distance center, which is suitable for discovering complex shape and large density variation feature distribution. This method can effectively identify the repeated edge aggregation area caused by corner reflection in the image and separate it from natural texture or defect edges, improving the robustness and accuracy of crack identification.
[0035] S3, input the edge repeat feature vector into the convolution attention network structure, combine the structure continuity in the image context area to generate a crack credibility score map, which is used to determine whether there is a real crack defect in the image according to the edge repeat features caused by the corner reflection in the image ghost situation; In this embodiment, S3 specifically includes the following steps: S301, embed the edge repeat feature vector into a two-dimensional space feature map and input it into the convolution attention network structure. Perform multi-scale convolution operation in the network to extract the spatial correlation of the edge repeat features, and strengthen the response difference of the edge repeat features at different scales through the channel attention mechanism; The edge repetition feature vector is one-dimensional in the initial stage of construction. To extract its local continuity in the image space, the feature vector needs to be remapped to a two-dimensional space feature map aligned with the original image space. This mapping can be completed by reversing the index of the edge line segment coordinates and embedding the vector value in the corresponding position. Then the two-dimensional space feature map is introduced as input into the convolution attention network structure. In the network, the spatial scale variation trend of the edge repetition feature in the image is extracted in parallel through different size convolution kernels, and the local continuity and global structure difference are preserved. Multi-scale convolution operation allows the model to perceive long edge structures and short distance details, so that the network can identify the distribution law of the ghost feature from different spatial resolutions. To further enhance the response performance of the key area, the channel attention mechanism is introduced to dynamically adjust the weight distribution between channels, so that the network gives higher response value to the high repetition feature area. This processing method helps to distinguish the real crack edge from the structure repetition caused by reflection, and improves the discriminant ability of the subsequent crack confidence score map.
[0036] The two-dimensional space feature map is a feature expression form consistent with the image space coordinates, which is used to maintain the layout distribution of the edge repetition feature in the original space of the image, and helps the subsequent model to perceive the structural relationship between the feature and the context. The convolution attention network structure is a deep learning architecture that combines the local perception ability of the convolution neural network and the feature enhancement ability of the attention mechanism, which can effectively learn the local edge feature and the global repetition pattern. Multi-scale convolution operation extracts feature map information in parallel through convolution kernels of different receptive field sizes, so that the network can identify both the edge features of small crack line segments and the large-scale repeated edge structures in the corner area. The channel attention mechanism is a mechanism based on global average pooling and weight redistribution, which is used to measure and enhance the feature dimensions with stronger discriminant ability in multiple channels, so that the network automatically focuses on those feature responses that have significant contribution in distinguishing reflection ghost and real cracks, thereby improving the understanding ability of the model for complex defect scenes.
[0037] S302, encode the structure continuity feature in the image context area as an auxiliary context feature map, and fuse it with the intermediate feature map of the convolution attention network structure, so that the edge repetition feature of the crack candidate area and its context structure remain continuous, and generate a crack confidence score map based on multiple layers of feature maps; To maintain the contextual consistency of edge repetition features with the overall structure of the image, structural coherence features need to be extracted from the original image. This process can be achieved by extracting indicators such as gradient direction continuity, region shape consistency, and texture distribution smoothness to construct a context structure description. The extracted structural coherence features are converted into auxiliary context feature maps after convolutional coding. The feature maps are aligned with the intermediate feature maps of the convolutional attention network structure in the feature dimension and then fused, with the fusion method being channel splicing or weighted summation, so that the edge repetition features not only contain their own edge spatial information but also carry the context structure characteristics of the region they are in. Based on the fusion, multi-scale convolution and attention guidance operations are continued to refine the feature expression layer by layer, and finally a crack confidence score map is constructed on the multi-layer feature map. The score map is used to distinguish between real cracks and edge repetition structures formed by corner reflection ghosting, ensuring that the crack candidate region maintains high coherence with its background structure in spatial continuity, thereby improving the credibility of subsequent judgment.
[0038] The auxiliary context feature map is a feature map constructed by encoding the structural continuity and shape consistency information in the image, which is used to reflect the structural adaptability of edge repetition features in their local environment. This feature map helps to identify which edge structures are natural extensions of physical form and which may be caused by light interference. The intermediate feature map of the convolutional attention network structure refers to the intermediate expression results produced by the network during the processing of multiple convolutional layers or attention units. These feature maps have more rich spatial textures, edge directions, and context relationships in information expression, making them suitable for fusion processing with external structural information. The crack candidate region refers to the image region identified as having potential crack risk in the early network stage, which contains edge repetition features but has not been verified by structural discrimination. The multi-layer feature map is a collection of feature expressions generated by stacking multiple layers of convolution and attention mechanisms. Different levels focus on different spatial scales and semantic levels, and the fusion of these layers can achieve joint representation from edge details to global structure, enhancing the stability and discriminability of the crack confidence score map.
[0039] S303、In the crack confidence score map, extract high-confidence regions and low-confidence regions, and construct an edge structure difference function based on the spatial position and confidence distribution trend of edge repetition features under the condition of image ghosting caused by corner reflection. Use the edge structure difference function to determine whether there is a real crack defect in the image and label the result.
[0040] In the crack confidence score map, high confidence areas and low confidence areas are extracted, and an edge structure difference function is constructed according to the spatial position and confidence distribution trend of the edge repetition features under the image ghosting caused by corner reflection. The core purpose is to solve the problem that the image ghosting caused by corner reflection is highly mimetic to the real crack in visual features. Traditional image crack recognition methods are prone to misjudgment when facing continuous and obvious gray scale mutation interference ghosting, especially in complex lighting conditions, and the system is difficult to directly distinguish physical cracks from optical artifacts at the visual representation level. By constructing the edge structure difference function, the region confidence in the crack confidence score map is spatially matched and the distribution pattern is analyzed, which can accurately measure the coordination between the edge structure and the context area. This process not only considers the arrangement rule of the edge in space, but also introduces the response trend of the context, so as to capture the structural coherence destruction phenomenon usually accompanied by the crack area, and improve the recognition ability of the real crack. Finally, using this difference function for classification and judgment can effectively exclude the interference strip caused by multiple reflections, realize high robustness and high precision of the defect detection result, and ensure that the system still has stable recognition performance in extreme environments.
[0041] In this embodiment, S303 is specifically: In the crack confidence score map, a confidence distribution threshold range is set, and continuous high confidence areas and low confidence areas are identified and extracted. The region growing algorithm is used to delineate the boundary contour, and the spatial position and response intensity of each region in the image are recorded; In the crack confidence score map, a confidence distribution threshold range is set, which aims to quantitatively partition the crack confidence responses of different degrees in the image. The response values in the score map can be statistically modeled using methods such as percentile method, K-means clustering or Gaussian fitting, so as to set the upper and lower limit values. The area below the lower threshold is considered as a low confidence area, and the area above the upper threshold is considered as a high confidence area, and the intermediate range is an uncertain area. Then, the region growing algorithm is performed on the high confidence area and the low confidence area respectively. The algorithm starts from the pixel seed point with extremely high or low response value, and gradually expands by investigating the similarity of the neighborhood pixels in brightness, texture and score value, so as to form a connected region boundary. After the region growing is completed, the spatial position, contour shape and response intensity distribution of each region in the image are recorded, which will be used for subsequent construction of the edge structure difference function. The confidence distribution threshold range is used to separate the potential real crack area and the background noise area, and the clear division of the high confidence area and the low confidence area helps to improve the stability and reliability of the subsequent recognition. The region growing algorithm realizes the complete extraction of the crack morphology by judging the similarity between pixels, avoiding the problem of edge breakage in traditional threshold segmentation. This process ensures the coherence of the regions at different confidence levels in spatial expression, and provides clear data support for subsequent judgment of real crack defects.
[0042] mapping the edge repeat feature in the image coordinate space to the confidence region in the case of ghosting caused by edge-corner reflection, analyzing the spatial coincidence and boundary distribution pattern between the edge repeat feature and the high-confidence region, extracting the confidence distribution trend and edge distribution deviation, and constructing an edge structure difference function based on the same; In the process of mapping the edge repeat feature in the image coordinate space to the confidence region in the case of ghosting caused by edge-corner reflection, the edge line segment corresponding to the edge repeat feature vector needs to be first positioned in the original image coordinate system, and it needs to be spatially aligned with the high-confidence region extracted from the crack confidence score map. Two-dimensional geometric projection or displacement vector field is used to realize the feature alignment. Subsequently, by calculating the coincidence degree between the edge repeat feature and the high-confidence region, the spatial coincidence relationship between them in area, boundary direction and response center is obtained. Further, whether the edge repeat feature crosses the boundary of multiple confidence levels in the linear direction is counted, so as to analyze the stability and consistency of the boundary distribution, and then the confidence distribution trend map is constructed in combination with these spatial matching information. In order to represent the deviation between these trends and the edge structure, an edge structure difference function is defined, which can comprehensively calculate the edge overlap, edge direction deviation, boundary intensity gradient change and other dimensional indicators, and output a measurement value to characterize the structural compatibility between the edge repeat feature and the confidence region. The edge structure difference function is used to quantitatively analyze which edge structures exhibit inconsistent spatial features with the high-confidence region, thereby providing a calculable difference scale basis for subsequent discrimination of real crack defects. This method can effectively avoid misjudgment of the structure repetition caused by edge-corner reflection as a crack, and improve the accuracy and robustness of the judgment.
[0043] For each edge repeat feature corresponding confidence region, calculate its matching score in the edge structure difference function. When the matching score exceeds the crack structure consistency threshold, it is judged that there is a real crack defect in the image. If the matching score is continuously lower than the crack structure consistency threshold, it is judged as a non-crack region caused by edge-corner reflection, and the label result of the real crack defect in the image is output in the form of coordinates.
[0044] In the crack judgment of the confidence region corresponding to each edge repeat feature, the edge repeat feature in the image space needs to be first corresponded with the high confidence response region corresponding thereto, and then the structural compatibility between the two is quantitatively analyzed through an edge structure difference function, and a matching score is output. The matching score reflects the degree of coincidence of the edge with the real crack feature in terms of direction, arrangement distance, continuity and confidence distribution trend, etc. The calculation of the matching score can be realized by weighted aggregation of multiple structure feature indicators, such as direction consistency score, confidence boundary distribution deviation, and local symmetry destruction degree, etc. A crack structure consistency threshold is preset in the system, which is derived from the edge structure similarity standard obtained by statistical learning of a large number of real crack samples, and is used to distinguish high matching structures with physical crack characteristics from pseudo-crack structures caused by light interference. When the matching score of a certain edge repeat feature exceeds the crack structure consistency threshold, it is judged that the region has a real crack defect; if the matching score is always lower than the threshold, it is considered as interference caused by edge light reflection. Finally, the region judged as a real crack is output in the form of boundary coordinates in the original image to form a spatial labeling result of the crack defect, which is used to support the subsequent quality judgment or decision-making process. The method realizes high-confidence crack recognition based on structural similarity, and significantly improves the interpretability and reliability of the judgment.
[0045] S4, fuse the crack confidence score map with the brightness disturbance amplitude and direction fluctuation rate of the original edge region of the image to construct a crack confidence fusion surface; In this embodiment, S4 is specifically: In the original edge region of the image, the brightness change of the continuous frame image is sampled, the brightness disturbance amplitude map is constructed according to the brightness value fluctuation amplitude of each pixel point in the time dimension, and the direction fluctuation rate map is generated by calculating the main direction change rate of adjacent pixels in different frames, which is used to represent the dynamic instability characteristics of the edge region in local brightness and direction; In order to accurately characterize the dynamic response characteristics of the original edge region of the image, a plurality of images collected in a continuous time period in the edge region can be selected as an input sequence, the brightness value of each pixel point in the time dimension is sampled and recorded, and the brightness change time curve of the pixel is constructed. By calculating the range or standard deviation of the brightness sequence, the brightness disturbance amplitude value of the pixel can be obtained. While obtaining the brightness disturbance amplitude map, the gradient main direction of each pair of adjacent pixels in each frame of image can be extracted, and the main direction change rate of the same pixel point between consecutive frames can be calculated to form a direction fluctuation rate map. This process can obtain the gradient direction by combining the Sobel operator, and the direction fluctuation rate can be calculated by normalizing the change amount of the direction angle between adjacent frames. For example, if the direction angle of an edge region changes by more than a predetermined range in five consecutive images, the response value of the corresponding pixel in the direction fluctuation rate map will be significantly increased, indicating that there is strong structural instability at this position. This implementation can effectively capture non-structural changes caused by light disturbance or slight mechanical jitter, and provide a more stable and reliable image basis for subsequent crack confidence modeling.
[0046] The brightness disturbance amplitude map is used to quantify the strength of the brightness value fluctuation of each pixel point in consecutive time frames, which reflects the gray uncertainty of the pixel under the interference of light or surface reflection. The generation of the map depends on statistical analysis, such as standard deviation, variance, maximum and minimum difference of time series, etc. The direction fluctuation rate map focuses on the change trend of the structure direction on the time axis. Specifically, by extracting the local gradient main direction in each frame and comparing the angle change amount between consecutive frames, a pixel-level direction stability evaluation image can be constructed. If the main direction changes greatly, it means that the structure direction of this region is easily disturbed, and it belongs to a non-stable edge. Combining the two feature maps can comprehensively describe the structural stability and brightness robustness of the image edge under dynamic sampling conditions, which helps to eliminate non-physical false responses in multi-frame analysis and provides more accurate data support for crack confidence fusion.
[0047] The crack confidence score map, the brightness disturbance amplitude map and the direction fluctuation rate map are pixel-level aligned, the crack confidence score map, the brightness disturbance amplitude map and the direction fluctuation rate map after pixel-level alignment are fused into a joint response matrix in a channel splicing manner, and a multi-dimensional weighted fusion operation is performed on the joint response matrix according to a spatial response consistency function, and a fusion confidence response map of the edge region is output. To effectively fuse the crack confidence score map, the brightness disturbance amplitude map, and the direction fluctuation rate map, a strict pixel-level alignment process needs to be performed on the three images in the pixel coordinate space. This process is usually based on frame synchronization identification and affine transformation correction, which maps different source images to the same size and coordinate index two-dimensional space. After alignment, the channel splicing strategy is used to merge the three images in the channel dimension to form a joint response matrix containing multi-source information. Each matrix element represents a set of response values of a certain pixel in terms of crack score, brightness disturbance, and direction fluctuation. Then, a spatial response consistency function is defined, which is used to evaluate the spatial resonance degree between the three types of information in the local area. Based on weighted averaging or attention guiding mechanism, the three-channel response of each location is fused to generate a fusion confidence response map. As an example, if an edge region has a high value in the crack score map but low responses in the brightness disturbance map and the direction fluctuation map, the spatial response consistency function will lower its fusion confidence, thereby avoiding misjudgment of non-structural ghosting as cracks.
[0048] Pixel-level alignment processing is a mapping method that ensures the strict correspondence of multi-source images in spatial position, usually using affine matrix transformation, bilinear interpolation resampling or optical flow alignment algorithm based on key point matching. Channel splicing is a common data combination method in the field of deep learning, which can combine multiple feature maps into a unified data structure in the form of channel expansion, and preserve their respective feature information during convolution processing. The joint response matrix is the core data body of the fusion process, and each row in the three-dimensional structure represents the multi-source perception state of a pixel in the image. The spatial response consistency function is a function model for quantifying the spatial distribution consistency between channels, which is usually achieved by modeling the response value correlation in the local neighborhood window. Multidimensional weighted fusion operation refers to using the similarity score output by the function as the fusion weight, and performing weighted summation operation for each pixel. The final fusion confidence response map can comprehensively reflect the structural authenticity of each edge point, effectively weaken the false response caused by light disturbance, and lay a high-quality data foundation for crack confidence modeling.
[0049] In the fusion confidence response map, the crack confidence fusion surface is constructed with the fusion value as the height dimension. The gradient trend change of the surface in the edge region and the fusion value distribution pattern form a continuous confidence space, which is used to express the spatial distribution structure of the probability of the existence of cracks in the edge region of the image.
[0050] When constructing the crack confidence fusion surface, first, the fusion value of each pixel point in the fusion confidence response map is taken as the height dimension, and the fusion surface is established by three-dimensional reconstruction. In the specific implementation process, the two-dimensional image coordinates (x, y) can be taken as the plane reference axis of the surface, and the fusion value can be taken as the vertical axis to realize the generation of point cloud in three-dimensional space. A smooth surface is constructed by an interpolation algorithm, such as a bicubic interpolation or a spline function fitting, so that the fusion surface has good continuity expression ability in the edge region. On the surface, the crack region usually appears as a narrow valley structure with obvious gradient fluctuations, and the non-crack region appears as a plateau structure with gentle fusion value distribution and slow gradient change. Based on the height change trend and local slope change of the fusion surface in space, the crack confidence gradient map can be calculated, and the continuous confidence space is extracted in combination with the distribution trajectory of multiple edge segments, and then the real defect existence of the edge structure in the image is determined. For example, if there are multiple fusion value steep drop belt structures in the image corner region, and the spatial trend is consistent with the repeated characteristics of the edge, it can be regarded as a high crack existence probability region.
[0051] The fusion confidence response map is a two-dimensional image containing the multi-dimensional fusion results of crack confidence scores, brightness disturbance amplitudes and direction fluctuation change rates, and each pixel position stores the fusion confidence value. The height dimension refers to the vertical axis position used to express the fusion value in the three-dimensional surface, which is used to show the spatial difference of the confidence. The core of constructing the crack confidence fusion surface is to convert the numerical information in the two-dimensional space into three-dimensional structure information, which not only retains the response strength of each position, but also strengthens the recognition of the continuously distributed structural features in vision and mathematics. The gradient trend change is the slope characteristic of the height change in the local range of the fusion surface, which is usually calculated by a Sobel operator or a local fitting method; the fusion value distribution mode is the distribution law of the overall height of the surface in the spatial dimension, which is used to describe the macro structure of the confidence change. The continuous confidence space refers to the region with a continuous response trend and a relatively consistent curvature feature extracted from the crack confidence fusion surface, which has strong structure directionality and defect candidacy, and can be used as a direct input region for subsequent crack explicit recognition.
[0052] S5, based on the crack confidence fusion surface, a joint distribution of the confidence value and the edge repetition value is extracted, a multi-dimensional dynamic response domain is constructed in the feature space, and the edge region with the crack confidence score in the image is classified and processed according to the dynamic response domain.
[0053] In this embodiment, S5 is specifically: The crack confidence value of each edge pixel position in the crack confidence fusion surface is extracted, and the edge repetition value of the corresponding position in the edge repetition feature vector is synchronously extracted, a joint feature group is formed by the crack confidence value and the edge repetition value, a two-dimensional feature statistical graph is constructed to analyze the joint distribution density, and a joint distribution structure for quantifying the crack response characteristics in the edge region is generated; When obtaining the crack confidence value corresponding to each edge pixel position in the crack confidence fusion surface, the fusion value of each coordinate point can be extracted as the confidence response value by traversing the two-dimensional pixel coordinates of the fusion surface. At the same time, the edge repetition value at the same spatial position is extracted from the edge repetition feature vector, and the two values are synchronously paired in the image dimension through index consistency. The two paired values are constructed as joint feature points, and all pixel joint feature pairs are collected to form a large-scale joint feature group in the entire image range. Subsequently, a two-dimensional feature statistical graph can be constructed by using two-dimensional kernel density estimation, bivariate histogram or scatter heat map, etc., to reveal the joint distribution trend between the crack confidence and the edge repetition. This process can mine which areas have high response of crack confidence and structural repetition features at the same time, thereby providing a data basis for subsequent multi-dimensional dynamic response domain construction. For example, if there are a large number of point pairs in a certain aggregation area, the crack confidence value of which is higher than 0.8 and the edge repetition value of which is concentrated between 0.6 and 0.8, then this area can be regarded as a potential high-risk crack response area.
[0054] The crack confidence value represents the response intensity of the edge pixel in the image to the existence of cracks after multi-modal feature fusion, and is usually in the normalized interval, such as between 0 and 1, for reflecting the structural abnormality confidence degree at the pixel level. The edge repetition value is derived from the modeling of the edge direction consistency and the structural arrangement pattern in the early stage, and the higher the value, the more the edge morphology conforms to the rules of the reflection ghosting. The joint feature group is a binary group composed of the two indicators at the same pixel position, representing the response characteristics of the pixel in two dimensions. The two-dimensional feature statistical graph is a way of visualizing the joint feature group in a two-dimensional space, in which the horizontal axis and the vertical axis respectively represent the crack confidence value and the edge repetition value, and the joint distribution intensity is expressed by the density, color or height of the pixel points. The joint distribution structure is a response distribution rule model formed by modeling and analyzing the statistical graph, which is used to describe the comprehensive relationship between the crack occurrence possibility and the repeated structure in the edge region, and is one of the basic components for subsequent multi-dimensional response domain classification and determination. This process essentially realizes the spatial feature aggregation of the crack potential area before response clustering, and provides data basis for the confidence level division in the next stage.
[0055] The joint distribution structure is projected to the feature space, and a multi-dimensional coordinate system is constructed with the crack confidence value, the edge repetition value and the spatial distribution gradient. The multi-dimensional dynamic response domain is constructed by using the kernel density aggregation operation, the area with high response aggregation trend in the feature space is identified, and the different crack response modes are expressed in the space. The process of projecting the joint distribution structure to the feature space first needs to extend the joint feature point composed of each pair of crack confidence value and edge repetition value to a three-dimensional feature vector containing spatial position information. In specific implementation, the spatial gradient change of the point in the image in the fusion response map can be introduced as the third dimension, that is, a three-dimensional feature vector set composed of the crack confidence value, the edge repetition value and the spatial distribution gradient is constructed. These vectors are mapped to the feature space to form a high-dimensional data cloud. On the basis of the data cloud, the kernel density aggregation operation is used to estimate the probability density of the feature space, so as to form a density field in the three-dimensional coordinate system. The identification of the high response aggregation area in the density field can be realized by setting the density threshold and detecting the local density peak value, so as to identify the clustering distribution of different crack response modes in the feature space. For example, in actual operation, there may be a feature area in which the crack confidence value is concentrated above 0.8, the edge repetition value is in the interval of 0.7 to 0.9, and the spatial gradient is relatively stable. This kind of feature aggregation area is usually identified as a typical real crack area. While another kind of dense area has a low confidence value and a large spatial gradient fluctuation, and it can be classified as a reflection interference area. This feature space mapping method can upgrade the two-dimensional response data to a structured multi-dimensional analysis model, which lays a foundation for subsequent crack type classification and classification processing.
[0056] The crack confidence value is the confidence level of each pixel in the crack identification task after fusing multi-source information, and the edge repetition value reflects the similarity and repetition of the edge structure in the geometric level. The spatial distribution gradient represents the gray or intensity change rate of the position in the spatial dimension in the fusion response map, which is used to capture the local dynamic characteristics of edge changes. The three-dimensional coordinate system formed by the three constitutes a spatial model that can express the coupling relationship between image local structure and response characteristics. In this model, each feature point has a clear physical and geometric meaning. Kernel density aggregation operation is a non-parametric statistical method used to estimate the distribution density of feature points in high-dimensional space, which is calculated based on the kernel function expansion and superposition of each point in space, and can form a smooth response density field. The multi-dimensional dynamic response domain is the dense response area extracted on the basis of the kernel density aggregation result, which represents the spatial area that shows significant response trends in multiple feature dimensions. The high response aggregation trend refers to the appearance of a large number of densely distributed and consistent feature point groups in the local area in the feature space, which is an important basis for distinguishing different types of cracks. The separation expression of different response modes in the feature space constitutes the key support mechanism for the crack identification from numerical judgment to spatial structure analysis, further enhancing the accuracy and interpretability of crack confidence classification.
[0057] According to the boundary shape and aggregation characteristics of each response cluster in the multi-dimensional dynamic response domain, the confidence grading criteria are set, the joint features of the crack confidence scoring area in the image are mapped to the dynamic response domain, the high confidence, medium confidence and low confidence levels are divided through the feature attribution relationship, and the classification processing is performed according to the crack risk level corresponding to each level, the classification label of each edge area is output and the classification result map is established, which is used to drive the subsequent crack judgment process and detection output.
[0058] To classify the risk level of crack response regions in images, first, the boundary morphology and aggregation characteristics of each response cluster in the multidimensional dynamic response domain are analyzed, including the distribution range, density gradient, shape connectivity, and central concentration of the response cluster. According to these parameters, a reliability grading criterion is constructed, for example, using the density threshold and shape compactness of the response cluster as the basis for division. The joint feature of the edge repetition value and the crack reliability value is mapped to the multidimensional response domain, and its attribution relationship is determined by calculating the Euclidean distance or Mahalanobis distance from the center of each response cluster. If the feature point falls into a high-density aggregation area and is close to the center, it is classified as high reliability level; if it falls into an edge sparse area, it is classified as medium or low reliability level. This process can be realized through density estimation map and spatial division grid, combined with the statistical indicators within the response cluster, to dynamically adjust the grading boundary. After classification, all crack response points in the image are labeled according to their respective levels and mapped back to the image coordinate space to generate a classification result image, which can pixel-level label different reliability level areas. This classification result not only visually expresses the risk level of edge cracks, but also serves as an input for subsequent crack automatic judgment modules, guiding alarm triggering, maintenance recommendations, or further crack morphological analysis. In this way, the system can transition from probability inference to risk management in crack region identification.
[0059] The reliability grading criterion is a classification standard based on the geometric morphology and statistical attributes of the response cluster, including the envelope curve, boundary smoothness, and closure of the response cluster, as well as the density function distribution, local concentration, and response consistency of the point group. The joint feature is a combination of the crack reliability value and the edge repetition value, and its mapping process in the multidimensional dynamic response domain reflects the correlation between pixel-level response and spatial structure. The attribution relationship of the feature is determined by measuring the relative position relationship between the feature point and the core of the response cluster, including kernel density response value, local density gradient direction, and global distribution consistency. The high, medium, and low reliability levels are level identifiers for the confidence level of crack regions, corresponding to high-risk, possible-risk, and low-risk judgment basis, respectively. Classification processing refers to the classification operation of different crack response regions based on level labels, and the classification label is the confidence level identifier of each pixel or edge structure point in the image. The classification result image is a crack level distribution map output in the form of a two-dimensional image, showing the crack risk level distribution state of each region. This image is used to drive subsequent processes, including real crack verification, defect alarm, manual review labeling, or automatic detection decision, thereby realizing the comprehensive upgrade of image defect identification to graded evaluation and intelligent output.
[0060] The above-described embodiments can be implemented in part or in whole through software, hardware, firmware or any combination thereof. When implemented in software, the above-described embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When loaded and executed by a computer, the computer instructions or computer programs cause the computer to perform all or part of the processes or functions described in the embodiments of the present application. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable apparatus. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through a wired or wireless (for example, infrared, wireless, microwave, etc.) manner. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. containing one or more available medium collections. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state disk.
[0061] It should be understood that the size of the sequence number of each process described above in various embodiments of the present application does not mean the order of execution, and the execution order of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0062] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0063] In several embodiments provided in the present application, it should be understood that the disclosed system and method can be implemented in other ways. For example, the above-described embodiments are only illustrative, for example, the division of units is only a logical function division, and actual implementation can have another division manner, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed each other can be indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0064] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0065] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
[0066] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A machine vision-based method for detecting defects in the stamping process of automotive parts, characterized in that, Specifically, the following steps are included: S1. By calculating the brightness gradient distribution and structural direction difference of the corner area in the stamping image of automotive parts, a corner reflectivity index is generated. Based on the corner reflectivity index, the area in the image containing corner reflectivity that causes image ghosting is determined, which is used to identify whether corner reflectivity causes image ghosting. S2. Extract edge segments from the region of the image where edge reflections cause image ghosting, and generate an edge repetition feature vector based on the directional consistency and structural repetition of the edge segments to determine the edge repetition features in the case of edge reflections causing image ghosting. S3. Input the edge repetition feature vector into the convolutional attention network structure, and combine it with the structural coherence in the image context region to generate a crack confidence score map, which is used to determine whether there is a real crack defect in the image based on the edge repetition feature in the case of image ghosting caused by edge reflection. S4. Combine the brightness perturbation amplitude and directional fluctuation rate of the crack confidence score map with the original edge region of the image to construct a crack confidence fusion surface; S5. Based on the crack confidence fusion surface, extract the joint distribution of confidence value and edge repeatability value, construct a multi-dimensional dynamic response domain in the feature space, and perform confidence grading and classification processing on the edge regions with crack confidence scores in the image according to the dynamic response domain.
2. The method for detecting stamping defects in automotive parts based on machine vision according to claim 1, characterized in that, S1 specifically includes the following steps: S101. Extract the corner region from the stamping forming image of automotive parts, calculate the brightness difference between each pixel in the corner region and its neighboring pixels, obtain the brightness gradient distribution, and generate an edge direction vector set according to the gradient change direction to form a structural direction difference feature map. S102. The brightness gradient distribution and the structural direction difference feature map are weighted and fused. The fusion result is quantized into the corner reflectivity index according to the preset mapping function. This index is used to characterize the possibility of multiple light reflections in the corner area, so as to generate the corner reflectivity index distribution map of the whole image. S103. Perform connected component detection on the corner reflectivity index distribution map to determine the set of pixels whose corner reflectivity index is continuously higher than a preset threshold. Mark the region of this pixel set as the region in the image that contains image ghosting caused by corner reflectivity, in order to identify whether image ghosting caused by corner reflectivity occurs.
3. The method for detecting stamping defects in automotive parts based on machine vision according to claim 2, characterized in that, S102 specifically refers to: Each pixel gradient value in the brightness gradient distribution is mapped one-to-one with the orientation angle difference value at the corresponding position in the structural orientation difference feature map. A weight factor matrix is constructed based on a linear combination function to adjust the participation ratio of gradient information and orientation information in the fusion process. The brightness gradient distribution and structural orientation difference feature map are weighted and fused using a weight factor matrix to obtain the multi-source information response value of each pixel in the fused image. The multi-source information response value of each pixel is then mapped to a standardized interval as the fused response output of the corner region. The fused response output is nonlinearly quantized according to a preset mapping function to generate a corner reflectivity index image, and a corner reflectivity index distribution map is established within the entire image range to characterize the possibility of multiple light reflections in the corner area.
4. The method for detecting stamping defects in automotive parts based on machine vision according to claim 1, characterized in that, S2 specifically refers to: In the region of the image containing edge reflections that cause image ghosting, the high-pass edge filtering algorithm is used to detect regions with abrupt changes in brightness gradient. The gradient threshold is used to filter the set of edge points that are consistent with the direction of the edge structure, and the pixel connectivity tracking algorithm is used to connect the continuous edge points to form edge segments. The distribution of direction vectors is calculated for edge line segments. A direction consistency matrix is constructed using the cosine similarity between direction vectors. Combined with the spacing pattern of edge line segments in spatial arrangement, autocorrelation analysis is used to obtain the structural repeatability value, which is used to describe the repeatability distribution characteristics of edge line segments in the corner area. The directional consistency matrix and structural repeatability value are fused to generate edge repeatability feature vectors. Then, the edge repeatability features in the case of image ghosting caused by edge reflection are determined by clustering calculation in the feature vector space, which is used to support the subsequent judgment process of real crack defects.
5. The method for detecting stamping defects in automotive parts based on machine vision according to claim 1, characterized in that, S3 specifically includes the following steps: S301. Embed the edge repeating feature vector into the two-dimensional spatial feature map and input it into the convolutional attention network structure. Perform multi-scale convolution operation in the network to extract the spatial correlation of edge repeating features. Strengthen the response difference of edge repeating features at different scales through the channel attention mechanism. S302. Encode the structural coherence features in the image context region into an auxiliary context feature map, and fuse it with the intermediate feature map of the convolutional attention network structure to keep the edge repetition features of the crack candidate region coherent with its context structure, and generate a crack confidence score map based on the multi-layer feature map. S303. Extract high-confidence and low-confidence regions from the crack confidence rating map, and construct an edge structure difference function based on the spatial location and confidence distribution trend of edge repetition features in the case of image ghosting caused by edge reflection. Use this edge structure difference function to determine whether there is a real crack defect in the image and label the results.
6. The machine vision-based method for detecting stamping defects in automotive parts according to claim 5, characterized in that, S303 specifically refers to: In the crack confidence rating map, a confidence distribution threshold range is set, and continuously distributed high-confidence regions and low-confidence regions are identified and extracted. Boundary contours are delineated by a region growing algorithm, and the spatial position and response intensity of each region in the image are recorded. The edge repetition features in the case of image ghosting caused by edge reflection are mapped to the confidence region in the image coordinate space. The spatial overlap and boundary distribution pattern between the feature and the high confidence region are analyzed. The confidence distribution trend and edge distribution deviation are extracted, and an edge structure difference function is constructed accordingly. For each edge repeating feature, calculate the matching score of the confidence region in the edge structure difference function. When the matching score exceeds the crack structure consistency threshold, it is determined that there is a real crack defect in the image. If the matching score is consistently lower than the crack structure consistency threshold, it is determined to be a non-crack region caused by edge reflection, and the annotation result of the real crack defect is output in the image in the form of coordinates.
7. The method for detecting stamping defects in automotive parts based on machine vision according to claim 1, characterized in that, S4 specifically refers to: Brightness variation sampling is performed on consecutive frames of images in the original edge region of the image. A brightness perturbation amplitude map is constructed based on the brightness value fluctuation amplitude of each pixel in the time dimension. An orientation fluctuation rate map is generated by calculating the main orientation change rate of adjacent pixels in different frames. This map is used to characterize the dynamic instability of the edge region in local brightness and orientation. The crack confidence score map, brightness perturbation amplitude map, and orientation fluctuation rate map are aligned at the pixel level. The crack confidence score map, brightness perturbation amplitude map, and orientation fluctuation rate map after pixel-level alignment are merged into a joint response matrix by channel stitching. Then, a multi-dimensional weighted fusion operation is performed on the joint response matrix according to the spatial response consistency function to output the fused confidence response map of the edge region. In the fused confidence response map, a crack confidence fusion surface is constructed with the fusion value as the height dimension. The gradient trend change of the surface in the edge region and the distribution pattern of the fusion value are used to form a continuous confidence space, which is used to express the spatial distribution structure of the probability of cracks in the edge region of the image.
8. The method for detecting stamping defects in automotive parts based on machine vision according to claim 1, characterized in that, S5 specifically refers to: Crack confidence values are extracted from each edge pixel position in the crack confidence fusion surface, and edge repetition values at corresponding positions in the edge repetition feature vector are extracted simultaneously. Crack confidence values and edge repetition values are combined to form a joint feature group. The joint distribution density is analyzed by constructing a two-dimensional feature statistical map to generate a joint distribution structure for quantifying the crack response characteristics of the edge region. The joint distribution structure is projected onto the feature space, and a multi-dimensional coordinate system is constructed using crack confidence value, edge repeatability value and spatial distribution gradient. A multi-dimensional dynamic response domain is constructed using kernel density aggregation operation to identify regions in the feature space with high response aggregation trend, thereby realizing the spatial differentiation of different crack response modes. Based on the boundary morphology and aggregation characteristics of each response cluster in the multidimensional dynamic response domain, a confidence level criterion is set. The joint features of the crack confidence scoring region in the image are mapped to the dynamic response domain. High confidence, medium confidence and low confidence levels are divided by feature attribution relationship. Classification processing is performed according to the crack risk level corresponding to each level. The classification label of each edge region is output and a classification result map is established to drive the subsequent crack judgment process and detection output.
Citation Information
Cited By
Motor insert defect detection method based on multi-sensor fusion
CN121415165A
Motor insert defect detection method based on multi-sensor fusion
CN121415165B
