Online identification system for surface defects of vehicle headlight covers based on vision inspection
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHONGQINGZONGSHENJIALI LUMINAIRE MFG CO LTD
- Filing Date
- 2026-04-13
- Publication Date
- 2026-07-31
AI Technical Summary
[0002]在当前的汽车零部件制造工业中,机动车车灯灯罩的表面缺陷视觉检测是确保装配质量的重要环节;为了满足装配质量的要求,现有技术通常在流水线上设置连续的在线视觉检测工位;然而,车灯灯罩多采用透明或半透明聚碳酸酯材质,且外观普遍存在大曲率过渡区和边缘翻边区
1.本系统通过双分支网络构架分别提取初始特征图的光照分布特征与表面纹理特征,结合横纵向灰度变化值构建灰度梯度分布矩阵,并通过傅里叶频域变换分离高频反射与低频折射分量调整该矩阵,从而精准分离真实异常特征图;该设计有效克服了传统检测易将大曲率过渡区产生的光学亮斑畸变误判为物理缺陷的问题,实现了复杂光学分布与表面纹理特征的模型解耦,提高了真实细小损伤的识别精度;
Smart Images

Figure CN122492567A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine vision and industrial defect detection, specifically to an online identification system for surface defects of motor vehicle headlight covers based on visual inspection. Background Technology
[0002] In the current automotive parts manufacturing industry, visual inspection of surface defects in vehicle headlight covers is a crucial step in ensuring assembly quality. To meet assembly quality requirements, existing technologies typically employ continuous online visual inspection stations on assembly lines. However, headlight covers are mostly made of transparent or semi-transparent polycarbonate, and their appearance generally features large curvature transition areas and edge flanges. During continuous machine vision imaging, the acquired images are often mixed with real structural defects and dynamic optical artifacts due to the influence of external light source refraction, reflection, and environmental fluctuations. Traditional visual inspection algorithms often rely on static single-point grayscale threshold judgment or simple image differencing, lacking a systematic model decoupling between optical distribution and surface texture features. This easily leads to misjudging optical bright spot distortion caused by curved surface transitions as physical defects, or overlooking subtle, real damage with weak contrast.
[0003] In existing technologies, although some studies have attempted to use conventional background modeling or frequency domain filtering methods for defect separation, these methods generally suffer from low accuracy in characterizing the imaging features of transparent large-curvature media and insufficient intelligence in artifact suppression. At the same time, most existing visual inspection processes ignore the interference of workpiece posture micro-jitter caused by continuous transport in the pipeline and long-term ambient light drift on the background reference, and lack a dynamic adaptive feedback adjustment mechanism based on state assessment, which makes the algorithm model prone to oscillation or false detection in actual complex working conditions. In addition, when faced with non-uniform large-curvature gradually changing transparent coverings, traditional extraction methods fail to establish a geometric consistency constraint relationship between two-dimensional defect features and three-dimensional physical curvature space, making it difficult to adapt to the needs of actual variable optical inspection environments.
[0004] Therefore, how to provide an online identification system for surface defects of motor vehicle headlight covers based on visual inspection is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention provides an online identification system for surface defects of vehicle headlight covers based on visual inspection. Specifically, the technical solution of this invention includes: The data acquisition module is used to acquire two-dimensional image data of the surface of a target object through an industrial camera during online continuous transmission; wherein the target object is a vehicle headlight cover, and the surface of the target object has an optical nonlinear distortion region; The feature decoupling module is used to extract an initial feature map from the two-dimensional image data, process the initial feature map based on a preset optical feature dynamic decoupling model that includes background parameters, extract the illumination distribution features and surface texture features of the initial feature map through the dual-branch network architecture in the optical feature dynamic decoupling model, calculate the numerical difference between the illumination distribution features and the surface texture features at corresponding pixel positions as the difference response value between the two, and separate the dynamic illumination artifact feature map and the real anomaly feature map based on the difference response value. The result generation module is used to extract abnormal morphological parameters based on the real abnormal feature map, obtain the curvature distribution correlation features of the target object surface, and calculate the state evaluation result based on the abnormal morphological parameters and the curvature distribution correlation features. An adaptive feedback module is used to update the background parameters of the optical feature dynamic decoupling model in response to the state evaluation result.
[0006] Preferably, the two-dimensional image data is a surface image acquired during the online continuous transmission of the vehicle headlight cover; the real anomaly feature image represents scratches, bubbles, and weld lines on the surface of the vehicle headlight cover.
[0007] Preferably, the feature decoupling module separates the dynamic illumination artifact feature map and the real anomaly feature map based on the difference response value, including: The gradient analysis unit is used to construct a difference feature map from the difference response values and to calculate the gray-level gradient distribution matrix of the difference feature map. The artifact suppression unit is used to calculate the illumination artifact suppression ratio based on the gray-level gradient distribution matrix. The artifact suppression unit divides the regions where the illumination artifact suppression ratio is higher than a preset suppression threshold into the dynamic illumination artifact feature map, and retains the regions where the illumination artifact suppression ratio is not higher than the preset suppression threshold into the real anomaly feature map.
[0008] Preferably, the result generation module includes: The curvature mapping unit is used to obtain the curvature distribution model of the surface of the target object, which is pre-established based on the three-dimensional digital engineering design source file of the target object and imported from the outside, and to calculate the cross-curvature feature consistency index corresponding to the real anomaly feature map, which is the curvature distribution correlation feature, in combination with the curvature distribution model. The classification and determination unit is used to generate the state evaluation result based on the cross-curvature feature consistency index; configured as follows: if the cross-curvature feature consistency index is greater than a preset consistency threshold, the classification and determination unit outputs a first state evaluation result representing a normal state; if the cross-curvature feature consistency index is less than or equal to the preset consistency threshold, the classification and determination unit outputs a second state evaluation result representing an abnormal defect state.
[0009] Preferably, the adaptive feedback module includes: The delay calculation unit is used to collect the state evaluation results that were judged to be in a normal state in the past to form an evaluation result sequence, and to extract the background stationary expectation parameter from the evaluation result sequence. The background stationary expectation parameter is used as the target background parameter corresponding to the state evaluation result. The unit also calculates the dynamic background adaptive convergence delay required for updating the optical feature dynamic decoupling model based on the difference between the current background parameter and the target background parameter of the optical feature dynamic decoupling model. The parameter update unit is used to adjust the background parameters of the dynamic decoupling model of the optical features based on the adaptive convergence delay of the dynamic background and the state evaluation result.
[0010] Preferably, the gradient analysis unit is specifically used for: Extract the horizontal and vertical grayscale change values from the difference feature map; The gray-level gradient distribution matrix is constructed based on the horizontal gray-level change value and the vertical gray-level change value.
[0011] Preferably, the artifact suppression unit calculates the illumination artifact suppression ratio based on the gray-level gradient distribution matrix, specifically for: The difference feature map is processed by a preset Fourier frequency domain transform algorithm. Based on a preset spatial frequency cutoff threshold, the difference feature map is divided into frequency domains. The spectral components with spatial frequencies lower than the preset spatial frequency cutoff threshold are separated and extracted as low-frequency refraction components, and the spectral components with spatial frequencies not lower than the preset spatial frequency cutoff threshold are separated and extracted as high-frequency reflection components. The gray-level gradient distribution matrix is adjusted based on the high-frequency reflection component and the low-frequency refraction component; The ratio of the local gradient maxima to the global gradient average in the adjusted gray-level gradient distribution matrix is used as the illumination artifact suppression ratio.
[0012] Preferably, the curvature mapping unit calculates the cross-curvature feature consistency index corresponding to the true anomaly feature map, specifically for: The real anomaly feature map is mapped to the curvature distribution model, and feature vectors of the real anomaly feature map under different curvature regions are extracted. The dimension parameters of the feature vectors include local edge strength, directional continuity and region closure. Calculate the pairwise cosine similarity of the feature vectors under different curvature regions, and use the average value of the cosine similarity as the cross-curvature feature consistency index.
[0013] Compared with the prior art, the present invention has the following beneficial effects: 1. This system extracts the illumination distribution features and surface texture features of the initial feature map through a dual-branch network architecture. It constructs a gray-level gradient distribution matrix by combining the horizontal and vertical gray-level change values, and adjusts the matrix by separating the high-frequency reflection and low-frequency refraction components through Fourier frequency domain transformation, thereby accurately separating the real anomaly feature map. This design effectively overcomes the problem that traditional detection methods easily misjudge optical bright spot distortions generated in large curvature transition areas as physical defects, realizes the model decoupling of complex optical distribution and surface texture features, and improves the recognition accuracy of real small damage. 2. This system introduces a curvature distribution model, maps the real anomaly feature map to this model, extracts feature vectors under different curvature regions and calculates cosine similarity, thereby deriving the cross-curvature feature consistency index and generating state evaluation results. This solves the problem of lack of geometric constraint correlation between two-dimensional defect features and three-dimensional physical curvature space when facing non-uniform large curvature gradually transparent covering surfaces, effectively suppressing false alarms caused by irregular refraction of the medium and curvature abrupt changes, making the overall online classification and judgment decision robust and consistent.
[0014] 3. The adaptive feedback module of this system obtains the target background parameters corresponding to the state evaluation results, calculates the difference between the target background parameters and the current background parameters of the optical feature dynamic decoupling model to obtain the dynamic background adaptive convergence delay, and adjusts the model background parameters accordingly. This mechanism solves the problem that the existing process ignores the interference of continuous transmission workpiece posture micro jitter and long-term ambient light drift on the background reference, endows the system with dynamic adaptive feedback adjustment capability, effectively avoids false detection caused by sudden disturbances being incorrectly absorbed into the background model, and establishes a long-term stable, low-drift online recognition closed loop. Attached Figure Description
[0015] The present invention will be further explained below with reference to the accompanying drawings and embodiments: Figure 1 This is a schematic diagram of the module of the online identification system for surface defects of motor vehicle headlight covers based on visual inspection, according to the present invention. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments.
[0017] like Figure 1 As shown, the online identification system for surface defects of motor vehicle headlight covers based on visual inspection includes: a data acquisition module, used to acquire two-dimensional image data of the target object surface through an industrial camera during online continuous transmission; wherein, the target object is a motor vehicle headlight cover, and the surface of the target object has an optical nonlinear distortion region; The feature decoupling module is used to extract the initial feature map from the two-dimensional image data. It processes the initial feature map based on the preset optical feature dynamic decoupling model that includes background parameters. The lighting distribution features and surface texture features of the initial feature map are extracted through the dual-branch network architecture in the optical feature dynamic decoupling model. The numerical difference between the lighting distribution features and surface texture features at the corresponding pixel positions is calculated as the difference response value between the two. Based on the difference response value, the dynamic lighting artifact feature map and the real anomaly feature map are separated. The result generation module is used to extract abnormal morphological parameters based on the real abnormal feature map, obtain the curvature distribution correlation features of the target object surface, and calculate the state evaluation results based on the abnormal morphological parameters and curvature distribution correlation features. An adaptive feedback module is used to update the background parameters of the dynamic decoupling model of optical features in response to the state assessment results.
[0018] This embodiment provides an online identification mechanism for surface defects of vehicle headlight covers based on visual inspection. Specifically, the mechanism is deployed in the online inspection station from injection molding of headlight covers to packaging. The headlight covers are continuously fed into the inspection area via a conveyor belt. An industrial camera is set above, a ring light source and a supplementary light unit are set on the side, and a trigger encoder is set below to trigger image acquisition when each headlight cover reaches a predetermined position. Since lampshades are usually made of transparent or semi-transparent polycarbonate material, and the outer surface has a large curvature transition area and edge flange area, real scratches, bubbles, and weld lines may appear in the same frame image, as well as dynamic bright spots or stripes formed by reflection, refraction and environmental fluctuations. Therefore, this embodiment completes online recognition through four continuous links: data acquisition, feature decoupling, result generation and adaptive feedback. In one feasible implementation, the data acquisition module can use an area array industrial camera to acquire two-dimensional image data; in one feasible implementation, the camera resolution is set to 2448×2048, and the exposure time is adaptively adjusted according to the conveyor belt speed; when the encoder detects that the lamp cover enters the center of the field of view, a frame of surface image is acquired as the current detection frame. As an example: Suppose the acquired local image is only a 3×3 grayscale block with pixel values as follows: Row 1: 210, 215, 220; Row 2: 208, 150, 222; Row 3: 211, 216, 221. The central pixel 150 may correspond to a scratch or dark line, or it may be a local grayscale abrupt change caused by surface refraction. If only a single-point grayscale threshold is used for judgment, optical artifacts are easily misjudged as defects. Therefore, further feature decoupling is required. Furthermore, the feature decoupling module first extracts an initial feature map from the two-dimensional image data; this initial feature map can be generated by a convolutional coding layer, preserving both local edge information and overall brightness distribution; the optical feature dynamic decoupling model processes the same initial feature map separately through a dual-branch network architecture, with one branch used to extract illumination distribution features and the other branch used to extract surface texture features; The former tends to capture large-scale brightness fluctuations, reflected highlights, and refracted blurred boundaries, while the latter tends to capture fine textures, local pit contours, and texture continuity interruptions. Specifically, the branch for extracting illumination distribution features includes large-scale mean pooling layers and large receptive field convolutional networks, which are used to smooth local detail features and obtain low-frequency global brightness backgrounds. The branch for extracting surface texture features includes edge detection operators or small-scale high-frequency convolutional kernels, which are used to enhance edge pixel gradients and effectively suppress low-frequency illumination backgrounds. For example, taking a 3×3 pixel area as an example; assuming the output of the illumination distribution branches is: row 1: 205, 210, 215; row 2: 206, 209, 216; row 3: 207, 212, 217; The surface texture branch output is as follows: Line 1: 204, 211, 214; Line 2: 205, 165, 215; Line 3: 206, 213, 216; Performing numerical difference operations at the corresponding pixel positions yields the following difference response value matrix: Row 1: 1, 1, 1; Row 2: 1, 44, 1; Row 3: 1, 1, 1; It can be seen that the difference at the center position is greater than the preset feature difference threshold, indicating that the abnormal response value at this position is higher than the surrounding background in the texture branch, while it is regarded as part of the background lighting in the illumination branch. Based on this, the system forms a difference feature map from the difference response values and continues to separate the dynamic lighting artifact feature map from the real abnormal feature map. In a specific implementation, if the position of a certain region in multiple consecutive frames of images drifts slightly due to transmission jitter, but its brightness pattern is highly consistent with the overall illumination direction, then the region is more likely to be classified into the dynamic illumination artifact feature map. If a region is stable in the workpiece coordinate system and continuously exhibits edge interruption, strip stretching, or closed spot morphology in the texture branch, then the region is preserved in the real anomaly feature map. Therefore, the system does not directly perform difference operations on the original image, but performs difference discrimination between two representations: illumination distribution features and surface texture features, thereby improving the recognition stability of transparent curved objects. Furthermore, the result generation module extracts abnormal morphological parameters based on the real abnormal feature map; these abnormal morphological parameters may include the area of the abnormal region, aspect ratio, edge curvature, grayscale contrast, main direction length, and region closure; for example, when an abnormal region is a thin strip with a length of 12 pixels, a width of 2 pixels, an aspect ratio of 6, and high edge continuity, it is closer to a scratch. When an abnormal area is approximately circular with an area of 20 pixels and a high degree of circularity, it is closer to a bubble; when an abnormal area extends in a fan shape and crosses the direction of a local weld line, it is closer to a weld line; the result generation module can input these parameters into a preset classifier to obtain the status evaluation result, such as normal, slight abnormality, or abnormal defect. The preset classifier can be one of support vector machine, random forest or multilayer perceptron; before actual deployment, the preset classifier is trained in a supervised manner based on a set of real sample morphological parameters of defect categories that have been manually labeled in advance, so as to build a nonlinear mapping relationship between abnormal morphological parameters and state evaluation results. The adaptive feedback module is used to update the background parameters in the dynamic decoupling model of optical features based on the state assessment results. In this embodiment, the background parameters can be understood as the background illumination baseline, brightness fluctuation tolerance, and expected reflection distribution template of the curved area under the current production batch, current workstation environment, and current light source stability. When multiple lampshades are judged to be normal in succession, the system can gradually increase the level of trust in the current background mode, so that the background parameters are more in line with the real-time status of the scene; when the anomaly detection rate suddenly increases in a short period of time and the anomaly locations are randomly scattered, the system will reduce the update amplitude to avoid erroneously absorbing sudden environmental disturbances into the background model. As a supplementary anomaly handling mechanism, during image acquisition, if the workpiece does not fully enter the field of view, the local grayscale value of the image exceeds the upper limit of the sensor's dynamic response range, or the shadow size is greater than the preset geometric tolerance due to vibration at the trigger time, the current frame will be marked as a low-confidence frame. For low-confidence frames, a resampling mechanism can be used: if the subsequent frame is successfully resampled within the allowed time window, it will be used as the resampled frame for subsequent processing. If the re-sampling fails, the system outputs a pending inspection status instead of directly giving a defect conclusion. In the feature decoupling stage, if the outputs of the illumination branch and the texture branch are highly similar in most areas, resulting in generally low difference response values, the system determines that the current frame information is insufficient and can combine the previous and next adjacent frames for temporal fusion. If the difference response value is abnormally high in the whole image, it may indicate that there is light source flicker or lens contamination. At this time, the background parameter update is paused and only the detection results are retained for manual spot checks. During the status assessment stage, if the abnormal morphological parameters meet the characteristics of multiple types of defects at the same time, the system will prioritize outputting the abnormal defect status and attach a conflict label to avoid misjudging it as normal. For example, on a vehicle headlight assembly production line, headlight covers A1 to A5 pass through the inspection station continuously at 0.8-second intervals; A1 and A2 have bright bands in the high curvature area of the edge, which are characterized as suspected cracks in the original image. However, after dual-branch decoupling, the bright bands have obvious responses in the illumination distribution branch and weak responses in the texture branch. The difference response values are classified into the dynamic illumination artifact feature map after region clustering, so the state assessment result is normal; A3 has a thin line about 3 mm long in the central flat area. The thin line retains a continuous strip edge in the texture branch and only shows weak undulations in the illumination distribution branch. The difference response is concentrated, and finally, abnormal morphological parameters with high aspect ratio and strong directionality are extracted. The state assessment result is abnormal defect; The adaptive feedback module updates the tolerance range for edge highlights in the background parameters based on the normal results of A1 and A2, but does not use the abnormal area of A3 to update the background, thereby avoiding the absorption of real scratches as background. The purpose of this step is to separate false anomalies caused by illumination from true anomalies caused by material or molding defects in a continuous detection scenario of a transparent, highly reflective curved lampshade, and to correct the background model in reverse through the results, thereby achieving stable online recognition under complex optical backgrounds.
[0019] For example, the two-dimensional image data is a surface image collected during the online continuous transmission of the vehicle headlight cover; the real anomaly feature map represents scratches, bubbles and weld lines on the surface of the vehicle headlight cover.
[0020] This embodiment provides a surface image acquisition and defect characterization mechanism for continuous transmission conditions. Specifically, in the previous embodiment, although it was possible to decouple illumination and texture for a single frame image, if the image source and anomaly type are not further defined, the system may still face two problems in the actual production line: First, the slight jitter of the workpiece posture caused by continuous transmission will result in the background of adjacent frames not being completely consistent; Second, the imaging performance of different defects on the transparent lampshade is quite different. If there is no clear anomaly semantic range, the subsequent classification results will lead to the generalization of feature boundaries, making it difficult to effectively guide process rework. Therefore, this embodiment limits the two-dimensional image data to surface images acquired during online continuous transmission, and clearly associates the real abnormal feature images with the three most common industrial defects that affect assembly quality: scratches, bubbles, and weld lines. In one feasible implementation, online continuous transmission means that images are not acquired through offline static shooting, but are synchronously acquired under conditions of continuous movement of the conveyor belt; industrial cameras can capture images at fixed intervals, or images can be captured by encoders triggered by displacement; For example, if the conveyor belt speed is 300 mm / s, the lampshade length is 240 mm, and the camera is triggered every 20 mm, then 12 frames of local images can be obtained for each lampshade. The system can stitch these local images into a set of two-dimensional image data according to the workpiece coordinates. The technical effect of this data organization and acquisition mechanism is that it can complete the complete detection coverage of the workpiece without completing the shooting through a single high-resolution full-frame imaging, but by using the time-sequential stitching of multiple frames of images during continuous transmission. To illustrate the differences between the three types of anomalies, a further detailed explanation is provided based on the distribution characteristics of local pixel sets. Assume that after decoupling a certain local region, three candidate anomaly patches are obtained: the pixel set of patch B1 is in the shape of a thin line, with a length of 10 pixels, a width of 1 to 2 pixels, and a stable main direction; patch B2 is approximately circular, with the center being darker than the edges, and an area of about 16 pixels; patch B3 is a band-like diffusion with relatively blurred boundaries, extending along the material fusion direction. The system can map B1 as a scratch candidate, B2 as a bubble candidate, and B3 as a weld line candidate respectively. The real anomaly feature map does not simply overlay pixels on all identified anomaly areas, but independently retains the spatial coordinates, edge approximation contours and corresponding process category labels of each type of anomaly, so as to serve as a digital guide for subsequent industrial assembly or local process rework. Furthermore, the continuous transmission image mechanism can also be used to assist in determining whether an abnormal target is rigidly associated with the physical workpiece. If a bright reflective spot or shadow moves forward by an equal relative distance with the reference origin in the workpiece coordinate system in three consecutive frames, it is determined that it is closely attached to the surface structure of the workpiece and is characterized as a real physical anomaly. Conversely, if the absolute position of a target feature patch in the camera's physical reference frame remains stable and stationary, deviating from the motion extension boundary, the judgment result is the opposite, indicating that it is more likely to originate from external refractive pollution of the field of view lens or bright spots projected by ambient light interference. The system will immediately and forcibly remove such fixed optical artifacts. As a contingency plan and fault-tolerant mechanism for system operation anomalies in this processing stage, if the output speed of the controlled continuous transmission servo motor fluctuates too much, causing unequal and discontinuous displacements between adjacent overlapping images, the main control board actively reads the high-precision position pulse offset value fed back by the system encoder to initiate reverse position deformation geometric compensation registration stretching correction for each input frame; it automatically converts to compare and reads the edge reference positioning benchmark points in the common coverage area of two consecutive frames of images, thereby implementing visual temporal stitching error compensation; When multiple defects such as scratches and bubbles are extracted simultaneously in an abnormal area, the system extracts the area, marks it as a primary and secondary composite morphological abnormal feature area code, and transmits all of its underlying original physical state index parameters to the downstream integrated system logic for judgment. In the case of a narrow edge irregular surface that randomly appears in the assembly line operation and still lacks sufficient physical pixel coverage under the cumulative view of multiple frames of images, the system monitors and outputs the local field of view coverage of the corresponding sub-position as insufficient, effectively preventing the risk of detection omission and misjudgment caused by insufficient edge coverage. For example, on the same automotive headlight cover production line, a headlight cover enters the inspection field of view from left to right, and the system continuously acquires 12 frames of surface images. In the 4th frame, a thin dark line appears. In the 5th frame, the dark line continues to exist as the workpiece moves and its length remains approximately constant, so it is identified as a scratch rather than a momentary shadow. In the 7th frame, a nearly circular dark spot appears. In the 8th frame, it still maintains a closed outline. Combining the area and roundness features, it is identified as a bubble. In the 10th frame, a wide-band texture appears in the gate transition area. Its edge gradient changes gently, and its main direction is consistent with the melt confluence line, so it is marked as a weld line. The results of multiple categories of processing together constitute the true abnormal feature map of this headlight cover. The purpose of this mechanism is to classify and delineate the continuous conveying operation of the entire industrial production line and the specific industrial actual repair guidance for the extracted defect targets, thereby ensuring that the data source of the subsequent processing model has sufficient environmental self-verifying physical information as a basis, and thereby converge the evaluation boundary to construct a high-precision set of surface defect feature criteria that can effectively support the industrial control decision-making of the production line terminal.
[0021] For example, the feature decoupling module separates the dynamic lighting artifact feature map and the real anomaly feature map based on the difference response value, including: a gradient analysis unit, used to construct the difference feature map from the difference response value and calculate the gray-level gradient distribution matrix of the difference feature map; The artifact suppression unit is used to calculate the illumination artifact suppression ratio based on the gray-level gradient distribution matrix. The artifact suppression unit divides the region where the illumination artifact suppression ratio is higher than the preset suppression threshold into a dynamic illumination artifact feature map, and retains the region where the illumination artifact suppression ratio is not higher than the preset suppression threshold as a real anomaly feature map.
[0022] This embodiment provides an artifact suppression mechanism based on gray-level gradient distribution. Specifically, in the aforementioned scheme, although the difference response value has been obtained, under some extreme conditions, the magnitude of the difference response value alone may still be insufficient to stably distinguish between illumination artifacts and real defects. For example, edge highlights can also produce a high difference response at certain curvature locations; conversely, shallow scratches may not have a prominent difference response in low-light areas. To address this issue, this embodiment further introduces a gradient analysis unit and an artifact suppression unit, using the gradient organization method within the region rather than simply the numerical value to identify artifacts. In one feasible implementation, the gradient analysis unit first constructs a difference feature map from the difference response values and calculates the gray-level gradient distribution matrix; this matrix can be understood as a combination of the intensity of change of each pixel in the horizontal and vertical directions; taking a simplified region as an example, assume the difference feature map is as follows: row 1: 2, 2, 2; row 2: 2, 8, 2; row 3: 2, 2, 2. If calculated based on the difference between adjacent pixels, the difference between the center position and its four neighboring areas is relatively large, indicating that there is a significant local abrupt change at this position; further assume that the difference feature map of another region is as follows: Row 1: 3, 4, 5; Row 2: 3, 4, 5; Row 3: 3, 4, 5; The region exhibits a smooth, gradual change, suggesting that it is more likely a gradual artifact caused by illumination rather than a real defect. This demonstrates that the spatial distribution of gradients is more indicative of the anomaly than a single-point response value. Furthermore, the artifact suppression unit calculates the illumination artifact suppression ratio based on the gray-level gradient distribution matrix. The basic idea is that if a certain region mainly exhibits a large-area, consistent, and slowly changing gradient distribution, it is more likely to be an illumination artifact, and the corresponding suppression ratio should be higher. If a region exhibits abrupt changes, closed edges, or sharp, elongated breaks, it is more likely to be a true anomaly, and the corresponding suppression ratio should be low. The system classifies regions with suppression ratios higher than a preset suppression threshold as dynamic lighting artifact feature maps, and retains regions with suppression ratios no higher than the threshold as true anomaly feature maps. As a concrete example, suppose the local gradient statistics of a candidate region R1 are: average gradient 2.0, maximum gradient 2.4, and the gradient direction within the region is concentrated in the same direction with smooth changes; the system calculates a suppression ratio of 1.2. If the preset threshold is 1.0, then R1 is classified as an illumination artifact; the statistical results of another candidate region R2 are: average gradient 1.8, maximum gradient 6.0, and the local gradient direction changes abruptly at the anomalous boundary, with a calculated suppression ratio of 0.7, then R2 is retained as a true anomalous; thus, even if R1 and R2 are equally high in terms of difference response values, the system can still distinguish them through the gradient organization method; As a supplementary anomaly handling mechanism, if the suppression ratio of a certain region is close to a threshold, for example, between 0.95 and 1.05, it can be considered an uncertain region. For uncertain regions, the system does not delete them immediately, but instead re-evaluates them based on the consistency of adjacent frames. If the region drifts in position and changes shape significantly across multiple consecutive frames, it is classified as an artifact; if it remains stable in the workpiece coordinates, it is retained as a true anomaly. If a certain area is too small, for example, consisting of only 1 to 2 pixels, the gradient distribution is unstable. Minimum area filtering can be performed first to avoid treating random noise as defects. If the average gradient of the entire image increases abnormally, it may indicate focal length drift or a sudden increase in image noise. In this case, the threshold should be appropriately increased to prevent the entire image from being incorrectly segmented. For example, in the same online inspection station, when a lampshade passes through a high-curvature area at the edge, a bright band appears in the image that extends continuously with the curved surface; the difference response corresponding to this bright band is not low, but gradient analysis shows that its lateral change is slow and the direction is consistent, and a high suppression ratio is calculated, so it is suppressed as a dynamic lighting artifact; another lampshade has a small scratch in the central area. Although the area is not large, the boundary gradient change is obvious and the difference between the local gradient extremum and the average value is significant, resulting in a low suppression ratio, and it is ultimately preserved in the true anomaly feature map; The purpose of this mechanism is to add gradient structure as a discriminative dimension in addition to the difference response value, thereby further suppressing dynamic lighting artifacts and improving the accuracy of preserving real defects.
[0023] For example, the result generation module includes: a curvature mapping unit, used to obtain a curvature distribution model of the surface of the target object that is pre-established based on the three-dimensional digital engineering design source file of the target object imported from the outside, and to calculate the cross-curvature feature consistency index corresponding to the real abnormal feature map as the curvature distribution correlation feature in combination with the curvature distribution model; The classification and determination unit is used to generate a state assessment result based on the cross-curvature feature consistency index; it is configured such that if the cross-curvature feature consistency index is greater than a preset consistency threshold, the classification and determination unit outputs a first state assessment result representing a normal state. If the consistency index of the curvature feature is less than or equal to the preset consistency threshold, the second state evaluation result, which is characterized as an abnormal defect state, will be output. It should be noted that the first state evaluation result output here is equivalent to the normal or slightly abnormal state output by the preset classifier above, indicating that the optical distortion of the target object is within the allowable tolerance range of the process; the second state evaluation result is equivalent to the abnormal defect state mentioned above, indicating that there is substantial physical damage on the surface of the target object that must be intercepted or enter the rework process.
[0024] This embodiment provides a state assessment verification and anti-false judgment mechanism based on three-dimensional curvature space reference mapping. In a feasible implementation, in the aforementioned feature separation scheme, the system already has the ability to separate and screen out real anomalies from dynamic light and shadow artifacts. However, motor vehicle lamp covers generally have non-uniform large curvature gradient transparent covering surfaces based on aerodynamic design. For transparent media, the endogenous refraction imaging of the same normal background texture under the cross-curvature structure also shows obvious nonlinear contrast differences. Without the introduction of the original curvature reference of the lampshade structure, the optical distortion in the steep gradient area of the surface, which is originally caused by the transition texture of conventional design, is easily misclassified as a broken band-like anomaly; and the potential defects characterized in the central area with gentle thickness are also easily identified and ignored because the contrast change is weak. Therefore, this embodiment further introduces the curvature mapping system of the target ontology, and by establishing a coordinate coupling transformation mechanism between abnormal two-dimensional features and physical three-dimensional geometric benchmarks, it conducts a quantitative comparison measurement of the cross-curvature continuity stability characterization of the same continuous texture. In one feasible implementation, the curvature distribution model is pre-established and obtained based on the three-dimensional digital engineering design source file of the target object, and is supplemented by multi-view, multi-channel visual calibration results to import the physical molding comparison and correction results to form the final three-dimensional curved surface array parameter field. Among them, the visual calibration result is obtained by pre-obtaining the intrinsic parameter matrix of the industrial camera and its extrinsic parameter matrix relative to the conveyor belt coordinate system through Zhang's calibration method, and by combining the three-dimensional structured light scanning technology to obtain the surface point cloud of the standard qualified lampshade. The result is obtained by rigidly registering the point cloud with the three-dimensional digital engineering design source file using the iterative nearest point algorithm. In this 3D array, each spatial projection node of the target component surface layer is mapped or assigned a clear continuous gradient or discrete interval curvature metric numerical label, that is, it is precisely assigned to a smooth curvature domain, a medium mixed alternating transition domain, or a high gradient curvature steep edge region. When implementing the projection tracking process, the underlying computing platform uses the pre-calibrated industrial lens distortion intrinsic parameter matrix and the full six degrees of freedom attitude extrinsic parameter matrix of the acquisition end frame to map the specific target associated pixel matrix extracted from the input real anomaly feature 2D map, and restore it to the spatial coordinate node surface constructed by the 3D model. After the networked feature coordinate localization of suspected problems is completed, the system extracts the core feature vectors generated by the corresponding inspected area in different curvature constraint surface intervals. The indicators covered by these cross-region feature sequences mainly include parameters such as gray-level nonlinear contrast, edge micro-cut contour change steepness, spatial pointing direction stability correlation distribution, and topological distribution closure morphology. Further quantification is provided by comparing specific numerical values of cross-regional feature vectors. Assuming that the current two-dimensional result map contains a type of suspected anomalous region signal that spans several variable curvature spatial surfaces, the processing system extracts two sets of quantized feature vectors under different spatial curvature sections: the low curvature sub-feature vector measures are 0.8, 0.7, and 0.9; the feature vectors measured on the corresponding high curvature band edges of the continuous extension are 0.78, 0.69, and 0.88. The comparison results indicate that the similarity between the two sets of multidimensional information vectors is greater than the preset consistency judgment threshold. It can be inferred that this type of associated structure maintains a stable form in different curvature environments and does not exhibit a discrete fracture form. It is further confirmed that this change belongs to the smooth transition background interference mode exhibited by the lampshade design deformation light strip effect. The system calculates the cross-curvature feature consistency index of the combined object to be 0.96. Under the condition that the consistency benchmark threshold is preset to 0.85, the system determines that it exceeds the limit value and outputs the normal state characterizing the health of the component, that is, the first state evaluation result. Conversely, if a suspected problem area detects a low-curvature sub-feature vector of 0.8, 0.7, and 0.9, while a steep area abruptly changes to 0.3, 0.9, and 0.2, the system determines that the local direction and geometric representation of this type of feature are affected by the local physical surface curvature disturbance, and have lost their internal extension, support, and cooperative continuity capabilities and have undergone significant heterogeneous splitting. Therefore, the deduced consistency reference scalar drops to 0.54, which is lower than the preset threshold lower limit. Ultimately, this accurately outputs the abnormal defect state that prompts a quality degradation warning, i.e., the second state evaluation result. The system's underlying mechanism is set up to intercept, evaluate, and filter. The judgment logic of this mechanism is not based on the single assumption that feature consistency decay is equivalent to the existence of physical defects. Instead, it is based on the objective observation rules rooted in the physical mechanism of injection molding curing: no matter how the surface structure is visually deformed and stretched due to spatial perspective and light path bending, its original geometric connection structure framework and spatial texture coherence will usually not be completely broken. In contrast, real anomalies such as material damage in solid industrial applications or residual gas inside injection molding often exhibit discontinuous characteristics of non-uniform thick-walled multipolar distortion and high edge reversal jumps after being affected by curved surfaces. These characteristics are difficult to maintain consistency across curvature regions. As an abnormal exit and early warning supplementary protection mechanism for the system classification processing logic, when the identified features that are marked and located are only isolated and limited to the local area specified by the target workpiece, and do not contain any specific single plane sub-curvature base area of any continuous transition surface, the system lacks the data foundation required to form cross-layer and cross-step comparison observation samples. At this time, the main control safety mechanism automatically intercepts the target area that cannot fully realize the verification logic of this layer, and makes it fall back to the basic area morphological feature parameters obtained by the previous network, and uses the average gray level of the first adjacent background in the surrounding local area as an auxiliary judgment item to complete the conventional default output judgment calculation. This execution step can complete the final verification of feature consistency without relying on the reference surface support of the missing prerequisites; and at the same time, considering that if the system mapping calibration deviates from the corresponding mapping tracking due to the accuracy vibration displacement, causing the region to fall in the unstable edge area of the pre-constructed model, resulting in frequent jitter and sudden values of the actual curvature level, the system will introduce a thickened mean filter kernel of the surrounding 3×3 connected steady-state continuous neighborhood to perform weighted smoothing coverage replacement compensation on the central fluctuation node. Furthermore, as an anti-boundary misjudgment interception strategy, when the consistency index of the curvature feature measured by the system approaches the preset threshold and shows a fluctuating state, that is, if it falls within the critical range of the preset wide threshold protection window of 0.83 to 0.87, the system immediately controls the interception to avoid outputting a normal state evaluation result for the target object due to the feature data being in the critical state of classification judgment. At this time, the system does not output the first evaluation result identifier, but directly calls the switching label to generate a prompt for secondary re-inspection, or requests a multi-node, multi-source secondary re-acquisition sampling re-inspection instruction from the frame-supplementing imaging and lighting process control center associated with the current physical machine through communication, so as to complete the correction qualitative inspection. The core of this mechanism is to forcibly correlate suspected anomaly information extracted from the two-dimensional plane with the curvature of the solidified three-dimensional shape of the target part. Using real physical geometric benchmarks as case support and constraint scales, the mechanism distinguishes between true and false changes in decoupled texture information. This transforms complex cross-optical high-dimensional decoupled information into traceable and comparable physical geometric consistency rules, thereby more robustly suppressing false alarms caused by irregular refraction and curvature abrupt changes in the medium, and making the overall online release decision more robust and consistent.
[0025] For example, the adaptive feedback module includes: a delay calculation unit, used to collect historical state evaluation results that were judged to be in a normal state to form an evaluation result sequence, and to extract background stationary expected parameters from the evaluation result sequence, using the background stationary expected parameters as the target background parameters corresponding to the state evaluation results, and to calculate the dynamic background adaptive convergence delay required for updating the optical feature dynamic decoupling model based on the difference between the current background parameters and the target background parameters; and a parameter update unit, used to adjust the background parameters of the optical feature dynamic decoupling model based on the dynamic background adaptive convergence delay and the state evaluation results.
[0026] This embodiment provides a background parameter adaptive update and adjustment mechanism with a dynamic convergence control factor; specifically, in the aforementioned abnormal feature decoupling algorithm deployment scheme, although it has the ability to receive detection feedback results and change the background benchmark correction parameters inside the network in real time, in order to ensure the realization of the closed-loop self-iterative design objective; However, if all verified feedback calibration information is updated and written back without filtering during the transmission of the master parameter matrix at a fixed frequency and ratio, the following identification bias may easily occur under complex conditions of continuous transmission: Firstly, a high refresh rate allows the model to incorporate local high-frequency ambient light jitter errors into the learning base of the lighting environment tolerance, quickly covering subsequent real scratches and low-contrast defects. Secondly, if the iteration is too slow or the update rate is too low, the optical feature decoupling mechanism will be unable to dynamically align with the long-term background illuminance drift caused by changes in the external solar angle and temperature rise on the production line, thereby increasing the false detection rate of subsequent large batches of qualified parts. Therefore, this embodiment further introduces a delay calculation feedback control unit with frequency modulation and vibration damping function, and a parameter adjustment unit with limited protection update weight. By dynamically analyzing the state sequence and change index, a dynamic background adaptive convergence delay with continuous elasticity is obtained, so as to accurately control the update frequency and step size of the environmental correction parameters in the front-end feature dynamic network. In one feasible implementation, the delayed calculation unit obtains the evaluation result sequence that has been verified as normal and reliable through statistics, and extracts the background stationary expected parameters of the specific feature target region from it to obtain the target background parameter array corresponding to the state evaluation result. The target background parameters refer to the baseline of expected brightness of spatial fixed target curvature interval associated with illumination intensity, the range of fluctuation of environmental diffuse reflection threshold, and the balance scalar of dynamic reflective spot artifact suppression, etc., obtained from normal samples confirmed in the near time zone detection sequence after smoothing by sliding window mean. Based on this, the core operator within the unit performs a full-dimensional difference comparison between the background parameters currently used by the system and the verified target background parameters. Through this type of verification calculation, if the difference measurement shows a jump gradient or divergence rate greater than the preset change threshold, it indicates that there is a significant shift in the corresponding pipeline external ambient lighting reference and internal target optical scattering path, that is, the actual background field strength in the detection point's field of view has drifted. However, a significant change in the parameter difference results alone is not sufficient to warrant an immediate and substantial update of the decoupling parameters. When entering the convergence evaluation and judgment logic, the system also requires the simultaneous introduction of a diagnostic report on the quality status of the current production work order throughout the entire process. This is combined with the distribution of whether the product results are continuously identified as having high-confidence-risk defects to jointly determine the convergence delay. Furthermore, the system uses the network parameter bias feedback quantity for further quantitative explanation. For example, the current benchmark parameter for dynamic network lighting distribution used by the system in the high curvature surface area at the edge is set to 120. After smoothing and statistical analysis of the most recent continuous normal samples, the expected value of the target background parameter is 132, and the difference between the two is 12. If 20 consecutive products appearing simultaneously within the time interval that cause the difference of 12 to drift are all identified as normal by the system, the system infers that the difference is more likely to come from stable environmental changes such as long-term temperature drift caused by continuous heating of workshop lighting equipment. At this time, the delay calculation unit can issue a shorter period of convergence delay for this area, such as 2 cycles, so that the system can complete the compensation for the slow changes in the external environment at a faster pace. Conversely, if the difference is also 12 points, but 3 out of the last 5 consecutive detections within the corresponding time window are judged as serious defects, the system infers that the current difference data may have been mixed in by local strong light instantaneous disturbances or real defect interference, and does not have direct reference significance as a stable background benchmark. If it is updated quickly at this time, it may assimilate and absorb the real anomaly into the background. Therefore, the system protection mechanism will automatically configure the feedback delay to a longer convergence period, such as 8 periods, to significantly reduce the speed at which short-term mutations are absorbed into the background model. Furthermore, after receiving the delay calculation results, the parameter update unit, based on the allocated convergence delay constant and combined with the latest reliable state evaluation results of synchronous transmission, jointly controls the update step size of various environmental background parameters in the dynamic decoupling model of optical features. In a feasible algorithmic structure, a cumulative iterative weighted update function with smoothing control can be used, where the incremental update coefficients characterize the fusion progress. The dynamic background adaptive convergence delay is inversely related to the background parameter Param in the next cycle; therefore, the background parameter Param in the next cycle is... new From the original background parameter Param oldParam, the target background parameter obtained through near-time observation and reliable filtering target The following weighted fusion method was used to obtain the following:
[0027] As shown in the example above, if the system sets the feedback delay to 2, the corresponding update coefficient is 0.5, which means that in each detection cycle, the system is allowed to quickly correct the background parameters with 50% of the current difference. If the system increases the delay to 8 in response to the instability assessment results, the corresponding coefficient is 0.125, which means that in each running cycle, only 12.5% of the target parameters are allowed to be slowly absorbed. Through this linkage and weighted convergence control method, not only can the network be avoided from being overly sensitive to secondary jitter and causing oscillations, but the network can also effectively overcome the defect of delayed feedback to actual steady-state changes. In addition, to better match the complex injection molding space, for areas with high background stability and less susceptible to polarization random reflections, such as the flat and low curvature areas of the lampshade body, a fast learning partition with high fusion sensitivity and short latency can be assigned separately; for complex areas with high curvature and folded edges, such as the areas with high curvature, which are susceptible to light field interference and prone to reflection, a slow update partition with low sensitivity, long latency, and low gain damping feedback is designed separately. By giving different physical feature regions their own environmental adaptive response frequency, step size, and update cycle, it is possible to more fully match the nonlinear reflection and refraction disturbance characteristics corresponding to different curved surface regions in the real workstation. As a backup anomaly defense and rollback mechanism, if the final summary status result of the product currently being processed has been clearly output as an abnormal defect, the system will forcibly freeze the product data and block its update permission to write to the background parameters, so as to prevent the light and dark anomalies caused by real defects, cracks, etc. from being absorbed into the background environment benchmark by the system and causing subsequent similar defects to be missed. When multiple faulty image frames with severe overexposure, blurriness, undervoltage, or out-of-focus conditions appear at the continuous acquisition end, and the continuous queue is in an unreliable state due to mechanical vibration, light source control alarm, or low-resolution anomaly, the system immediately locks the delay calculation and feedback analysis functions, suspends all parameter update actions, and continues to call the most recent stable and reliable historical background parameter version locally to participate in the detection. When the system detects that the difference between the current background parameters and the target background parameters of the dynamic decoupling model of optical features at the same coordinate position exceeds three times the upper limit of the safe discrete band of the long-term historical average fluctuation value of this workstation, the system triggers a forced defense mechanism, stops the continued execution of the progressive self-feedback update, and issues an equipment failure warning through the communication system, requiring manual inspection of factors such as surrounding lighting source arrays, camera windows, lens contamination, and abnormal hardware structure of the workstation, in order to prevent the spread of benchmark drift caused by the unconstrained erroneous environmental benchmark update of the system; if the difference is less than or equal to three times the upper limit of the safe discrete band, the conventional parameter weighted update logic is executed. The core design principle of this structure is to endow the online industrial screening system deployed under complex working conditions of transparent and highly reflective structural components with dynamic adaptive adjustment and feedback hysteresis control capabilities. This enables it to respond with high sensitivity to background changes caused by the slow drift of the natural light field, and effectively avoid occasional transient disturbances from being incorrectly absorbed into the background model. Thus, it establishes a long-term stable, low-drift, and highly reliable online identification closed loop from a mechanistic perspective.
[0028] For example, the gradient analysis unit is specifically used to: extract the horizontal and vertical grayscale change values of the difference feature map; and construct a grayscale gradient distribution matrix based on the horizontal and vertical grayscale change values.
[0029] This embodiment provides a specific construction step for a gray-level gradient distribution matrix. Specifically, in the aforementioned artifact suppression mechanism, if the gradient calculation is only described in a general way, there will still be uncertainties in engineering implementation, especially when the curvature of the lampshade edge is large and the local brightness changes drastically. How to stably extract comparable gradient information from the difference feature map requires a more explicit construction method. Therefore, this embodiment further limits the gradient analysis unit to extract the horizontal gray-level change value and the vertical gray-level change value respectively, and the two are used together to construct the gray-level gradient distribution matrix. In one feasible implementation, the difference can be calculated based on the difference between adjacent pixels. Let a local 3×3 region of the difference feature map be: Row 1: 1, 2, 2; Row 2: 1, 8, 3; Row 3: 1, 2, 2. For the central pixel 8, its horizontal grayscale change value can be represented by the difference between its left and right neighbors, for example, taking the average of (|8-1|) and (|8-3|), which yields 6; its vertical grayscale change value can be represented by the difference between its upper and lower neighbors, for example, taking the average of (|8-2|) and (|8-2|), which yields 6. Thus, the gradient representation of the central position is relatively large. Analyzing the upper left pixel 1, its horizontal and vertical changes are both small, indicating that this position is closer to a flat background. The system records the horizontal and vertical values of each location in the entire area in pairs to form a gray-level gradient distribution matrix. This matrix can be represented by two sub-matrices of the same size, or it can be further synthesized into a gradient magnitude matrix and a direction matrix. If the magnitude form is used, the horizontal and vertical change values of each pixel can be combined to obtain the gradient intensity of that pixel. Taking the aforementioned center position as an example, if both the horizontal and vertical values are 6, then its gradient amplitude is significantly higher than that of the surrounding area. If the direction is used, it can be determined whether the abnormal boundary is more horizontally or vertically extended, which is also helpful in distinguishing between scratches and lighting stripes. Generally speaking, real scratches often appear as a discontinuous distribution of high gradients along a certain thin and long direction, while lighting artifacts tend to form a continuously and gradually changing directional field. Furthermore, in the imaging scenario of the curved surface of the lampshade, the horizontal and vertical directions do not necessarily correspond to the physical left and right and up and down of the workpiece, but can also correspond to two orthogonal directions in the image coordinate system; as long as the front and back are consistent, the subsequent calculation of the artifact suppression ratio can be carried out stably. As a supplementary anomaly handling mechanism, if the boundary pixels of the difference feature map lack a complete neighborhood, mirroring, copying, or only one-sided difference calculation can be used to avoid null values at the boundary. If a certain region has extremely small horizontal and vertical differences due to noise, but its absolute gray level is obviously abnormal, the region can be marked as a low gradient suspicious region and left to be judged by subsequent morphological parameters instead of being directly judged as normal. If there are saturated pixels in the image, causing the difference results to be distorted, the saturated region can be cropped or its maximum weight can be limited before calculating the gradient. For example, at the same workstation, a suspected bright line appears on the edge of a lampshade. After the system extracts the difference feature map of the bright line, it finds that the gray level changes slowly in the horizontal direction and smoothly in the vertical direction. Therefore, the constructed gray level gradient distribution matrix shows a continuous transition state. On the other hand, a fine scratch in the center of another lampshade shows a sudden increase in the horizontal change value and a sudden change in the vertical change value in a few local pixels, forming a peak structure in the matrix. Based on this, subsequent modules can more easily classify the former as a lighting artifact and the latter as a real anomaly. The purpose of this step is to provide an executable construction method for gradient analysis, so that local changes in the difference feature map can be stably quantified, thereby supporting the subsequent artifact suppression judgment.
[0030] For example, the artifact suppression unit calculates the illumination artifact suppression ratio based on the gray-level gradient distribution matrix, specifically by: processing the difference feature map using a preset Fourier frequency domain transform algorithm to separate and extract the high-frequency reflection component and the low-frequency refraction component in the difference feature map; adjusting the gray-level gradient distribution matrix based on the high-frequency reflection component and the low-frequency refraction component; and using the ratio of the local gradient maxima to the global gradient average value in the adjusted gray-level gradient distribution matrix as the illumination artifact suppression ratio.
[0031] This embodiment provides a computational mechanism for suppressing illumination artifacts by combining frequency domain components. Specifically, in the aforementioned artifact suppression scheme, if the judgment is based solely on the spatial domain gradient distribution, bottlenecks may still be encountered under certain complex conditions. For example, small-area specular reflections can also form sharp gradients, while large-scale refracted shadows can lower the local average value, resulting in an unstable ratio in the simple spatial domain. Therefore, this embodiment further introduces Fourier frequency domain transform to separate the high-frequency reflection component and the low-frequency refraction component in the difference feature map, and then adjusts the gray-level gradient distribution matrix accordingly to improve the discrimination ability of the suppression ratio. In one feasible implementation, after the difference feature map enters the frequency domain, the system divides the spectrum into high and low frequency bands based on a preset spatial frequency cutoff threshold. The spatial frequency cutoff threshold is pre-calibrated according to the physical scale of the expected texture on the lampshade surface and the spatial resolution of the image acquisition module. The system generates low-frequency refraction components by inverse Fourier transform of the spectral components below the threshold, and generates high-frequency reflection components by inverse Fourier transform of the spectral components above or equal to the threshold. Therefore, rapidly changing local components can be regarded as high-frequency reflection components, and slowly fluctuating large-scale components can be regarded as low-frequency refractive components. High-frequency reflection components usually correspond to sharp bright spots and specular reflection edges, while low-frequency refractive components usually correspond to slow transitions between light and dark caused by material thickness and curved surface refraction. Since both can form artifacts, their influence cannot be accurately measured by relying solely on the original gradient, so frequency domain separation is required first. For ease of understanding, as a specific derivation example, suppose that after frequency domain processing, a certain region has a high-frequency reflection component intensity of 4 and a low-frequency refraction component intensity of 6; another region has a high-frequency reflection component intensity of 7 and a low-frequency refraction component intensity of 1. For the former, it indicates that the region is dominated by a gradually varying refractive background with fewer local high-frequency components, which is often closer to a large-scale illumination artifact; for the latter, it indicates that there is obvious local sharpness, which is more likely to be related to the edge of a real scratch or a strong reflection peak. Based on this, the system adjusts the original gray-level gradient distribution matrix, for example, by increasing the background weight of the low-frequency dominant region and suppressing the influence of its local gradient peaks; at the same time, it retains the high-frequency dominant region with structural continuity. In one feasible implementation, the position in the gray-level gradient distribution matrix Adjusted gradient value The calculation process can be quantified as follows:
[0032] in, Indicates position The original gradient value before adjustment, and These represent the intensity of the high-frequency reflection component and the intensity of the low-frequency refraction component at the corresponding positions, respectively. The preset sensitivity adjustment coefficient, A minimal constant introduced to prevent the denominator from being zero; In this process, the spatial frequency cutoff threshold is selected based on the following criteria: the spatial periodic component formed by the gradual refraction of the normal surface of the lampshade is located in the low-frequency range below the threshold, while the gray-scale abrupt component caused by defects such as scratches is located in the high-frequency range above the threshold. The recommended value range for the sensitivity adjustment coefficient ω is 0.5 to 2.0, and its specific value is inversely proportional to the overall reflectivity of the target object's surface. That is, the higher the reflectivity of the material, the smaller the value of ω, in order to prevent high-frequency noise interference from being excessively amplified. Through this structured calculation, the gradient of the real abnormal region with significant high frequencies and weak low frequencies will be enhanced and preserved; while the gradient amplification effect of the illumination artifact region dominated by low frequencies will be effectively suppressed. The artifact suppression unit extracts the local gradient maxima and the global gradient average from the adjusted gray-level gradient distribution matrix, and uses the ratio of the two as the illumination artifact suppression ratio. If a region is only a slowly varying refractive background, even if there are small local fluctuations, after frequency domain adjustment, its local maxima will not be too prominent relative to the global average, and the resulting ratio is often high, indicating that the region should be suppressed. If a region is the edge of a real defect, its local maximum value is still significantly higher than the global average value after adjustment. However, since this peak is consistent with the structural boundary, the system can suppress it by a preset mapping relationship, thus preserving it as a real anomaly. Another set of digital simulations can be performed; assuming that after adjustment, the global gradient average value of region D1 is 2.0 and the local gradient maximum value is 2.6, then the ratio is 1.3; after adjustment, the global gradient average value of region D2 is 1.5 and the local gradient maximum value is 6.0, then the ratio is 4.0; if the suppression condition is determined solely based on the positive correlation of the ratio, it may conflict with the rules for determining the true defect characteristics. Therefore, in this embodiment, the ratio is not only considered in terms of numerical value, but also in conjunction with the aforementioned frequency domain adjustment results: when high-frequency reflection and low-frequency refraction are jointly dominant and the gradient distribution lacks closed boundaries, the high ratio region tends to be identified as an illumination artifact; when the high ratio originates from a stable continuous structure of the defect edge, it will be preserved through structural constraints; in other words, the suppression ratio here is a composite criterion after frequency domain correction, rather than an isolated value. As a supplementary anomaly handling mechanism, if the spectral energy of a certain region is too low after Fourier transform, it indicates that the difference features themselves are insufficient. In this case, frequency domain adjustment can be skipped, and the original gradient distribution matrix can be used directly for calculation. If both high-frequency and low-frequency components are very strong, it indicates that the region may have both real defects and superimposed strong reflections. It can be marked as a complex region and combined with the stability of adjacent frames for re-judgment. If the denominator of the local gradient maximum and the global average is close to zero, the minimum protection value is used to replace the denominator to avoid abnormal amplification in the calculation. If periodic interference peaks appear in the frequency domain processing, they may be caused by light source flicker or sensor noise. In this case, the interference peaks are filtered out first, and then the suppression ratio is calculated. For example, in the night shift environment of the same automotive lamp cover production line, a set of temporary lighting was added to the side of the workshop, which caused strong specular bright spots to appear on the edges of some lamp covers. After the system performed frequency domain analysis on the difference feature map of these areas, it found that although the high frequency reflection component was high, it was superimposed with the low frequency refraction component to form an unstable structure. The adjusted gradient matrix showed isolated peaks and unclosed boundaries, so it was finally classified into the dynamic lighting artifact feature map. In contrast, a lampshade has a real scratch in the center. This area also has high frequency components, but its gradient peaks are continuously distributed along the direction of the thin line and are stable in position in consecutive frames. Therefore, it is not suppressed, but is retained as a real anomaly. The purpose of this mechanism is to combine spatial domain gradients with frequency domain components to more precisely distinguish between artifacts caused by reflection and refraction and real anomalies formed by surface defects.
[0033] For example, the curvature mapping unit calculates the cross-curvature feature consistency index corresponding to the real anomaly feature map, specifically for: mapping the real anomaly feature map to the curvature distribution model, extracting the feature vectors of the real anomaly feature map under different curvature regions; calculating the cosine similarity of the feature vectors under different curvature regions, and using the cosine similarity as the cross-curvature feature consistency index.
[0034] This embodiment provides a specific method for calculating the cross-curvature feature consistency index. Specifically, in the aforementioned curvature mapping determination, although it has been proposed to evaluate the state based on the feature consistency of different curvature regions, if the quantification method of consistency is not clear, inconsistencies in the caliber can easily occur in engineering implementation. Therefore, this embodiment further specifies that: first, the real anomaly feature map is mapped to the curvature distribution model, then the feature vectors under different curvature regions are extracted, and the cross-curvature feature consistency index is calculated by cosine similarity. In one feasible implementation, the feature vector can be composed of multiple normalized anomaly descriptors, such as local edge strength, directional continuity, thinness, texture contrast, and region closure. After mapping the anomaly region to the curvature model, corresponding vectors can be extracted in low-curvature, medium-curvature, and high-curvature regions, respectively. Since these vectors are represented using the same dimension, the angle relationship between each pair can be directly calculated. The closer the cosine similarity is to 1, the more consistent the feature directions are under different curvature regions; the closer it is to 0, the greater the feature differences. In one feasible implementation, for two sets of feature vectors V, each with dimension (n) A and VB The cosine similarity CosSim can be calculated using the following formula:
[0035] Among them, V A,i With V B,i Representing the eigenvector V A and V B The component value in the i-th dimension; for example, suppose the feature vector V of a candidate region is in a low curvature region. A The eigenvectors V in the high curvature region are 0.6 and 0.8. B The values are 0.58 and 0.79. After substituting them into the above calculation, the difference in direction between the two is less than the preset direction threshold. Therefore, the cosine similarity approaches 0.99, indicating that its features have high consistency under different curvatures and are judged as normal structural texture. If we assume that the vectors of another candidate region are 0.9 and 0.2 in the low curvature region and 0.3 and 0.95 in the high curvature region, then the directional deviation between the two is significant, and the cosine similarity can be only 0.47, indicating that this feature is greatly affected by local anomalies and is more likely to be a real defect. If the system has three curvature regions, we can first calculate the pairwise similarities of the three sets and then take the average value as the final consistency index. Furthermore, using cosine similarity instead of simple Euclidean distance has the following technical effects: it can weaken the influence of overall brightness scale changes and pay more attention to whether the feature composition ratio is stable. This is especially suitable for transparent lampshade detection scenarios, because the absolute brightness at different curvature positions may be different, but the feature directions of normal textures are usually still comparable. As a supplementary anomaly handling mechanism, if a certain curvature region cannot extract enough feature points, the corresponding vector of that region can be excluded from averaging, and the consistency index can be calculated from the remaining valid regions. If there are fewer than two valid regions, the process reverts to the default judgment process of the previous layer. If the vector magnitude is too small, it may mean that there is almost no valid anomaly information in that region. To avoid instability in cosine calculation, a minimum magnitude protection value can be used, or the region can be directly marked as an invalid sample. If the similarity of multiple regions is high and low, it indicates that the anomaly is stable under certain curvatures and unstable under certain curvatures. In this case, additional region weights can be added, such as increasing the weight of high curvature edge regions, so as to better match the actual imaging characteristics of the lampshade. For example, in the same production batch, a lampshade has a stable bright line on its edge. After the system maps the bright line to the curvature distribution model, it extracts two sets of vectors in the medium curvature area and the high curvature area respectively. The cosine similarity is calculated to be 0.95, so the consistency index is high and the judgment result is biased towards normal. Another lampshade has a weld line in the transition area from the center to the edge. This line appears as a weak band in the flat area, but as a broken dark line in the high curvature area. The extracted vectors have obvious differences in direction, and the cosine similarity is only 0.52. Therefore, the consistency index is low and it is finally classified as an abnormal defect. The purpose of this step is to provide a clear and actionable calculation method for cross-curvature consistency, thereby improving the repeatability and engineering feasibility of the state assessment results.
[0036] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A vision-based online identification system for surface defects in vehicle headlight covers, comprising: The data acquisition module is used to acquire two-dimensional image data of the surface of a target object through an industrial camera during online continuous transmission; wherein the target object is a vehicle headlight cover, and the surface of the target object has an optical nonlinear distortion region; The feature decoupling module is used to extract an initial feature map from the two-dimensional image data, process the initial feature map based on a preset optical feature dynamic decoupling model that includes background parameters, extract the illumination distribution features and surface texture features of the initial feature map through the dual-branch network architecture in the optical feature dynamic decoupling model, calculate the numerical difference between the illumination distribution features and the surface texture features at corresponding pixel positions as the difference response value between the two, and separate the dynamic illumination artifact feature map and the real anomaly feature map based on the difference response value. The result generation module is used to extract abnormal morphological parameters based on the real abnormal feature map, obtain the curvature distribution correlation features of the target object surface, and calculate the state evaluation result based on the abnormal morphological parameters and the curvature distribution correlation features. An adaptive feedback module is used to update the background parameters of the optical feature dynamic decoupling model in response to the state evaluation result.
2. The online identification system for surface defects of motor vehicle headlight covers based on visual inspection as described in claim 1, characterized in that, The two-dimensional image data is a surface image acquired during the online continuous transmission of the vehicle headlight cover; the real anomaly feature map represents scratches, bubbles, and weld lines on the surface of the vehicle headlight cover.
3. The online identification system for surface defects of motor vehicle headlight covers based on visual inspection as described in claim 1, characterized in that, The feature decoupling module separates the dynamic illumination artifact feature map and the real anomaly feature map based on the difference response value, including: The gradient analysis unit is used to construct a difference feature map from the difference response values and to calculate the gray-level gradient distribution matrix of the difference feature map. The artifact suppression unit is used to calculate the illumination artifact suppression ratio based on the gray-level gradient distribution matrix. The artifact suppression unit divides the regions where the illumination artifact suppression ratio is higher than a preset suppression threshold into the dynamic illumination artifact feature map, and retains the regions where the illumination artifact suppression ratio is not higher than the preset suppression threshold into the real anomaly feature map.
4. The online identification system for surface defects of motor vehicle headlight covers based on visual inspection as described in claim 1, characterized in that, The result generation module includes: The curvature mapping unit is used to obtain the curvature distribution model of the surface of the target object, which is pre-established based on the three-dimensional digital engineering design source file of the target object and imported from the outside, and to calculate the cross-curvature feature consistency index corresponding to the real anomaly feature map, which is the curvature distribution correlation feature, in combination with the curvature distribution model. The classification and determination unit is used to generate the state evaluation result based on the cross-curvature feature consistency index; configured as follows: if the cross-curvature feature consistency index is greater than a preset consistency threshold, the classification and determination unit outputs a first state evaluation result representing a normal state; if the cross-curvature feature consistency index is less than or equal to the preset consistency threshold, the classification and determination unit outputs a second state evaluation result representing an abnormal defect state.
5. The online identification system for surface defects of motor vehicle headlight covers based on visual inspection as described in claim 1, characterized in that, The adaptive feedback module includes: The delay calculation unit is used to collect the state evaluation results that were judged to be in a normal state in the past to form an evaluation result sequence, and to extract the background stationary expectation parameter from the evaluation result sequence. The background stationary expectation parameter is used as the target background parameter corresponding to the state evaluation result. The unit also calculates the dynamic background adaptive convergence delay required for updating the optical feature dynamic decoupling model based on the difference between the current background parameter and the target background parameter of the optical feature dynamic decoupling model. The parameter update unit is used to adjust the background parameters of the dynamic decoupling model of the optical features based on the adaptive convergence delay of the dynamic background and the state evaluation result.
6. The online identification system for surface defects of motor vehicle headlight covers based on visual inspection as described in claim 3, characterized in that, The gradient analysis unit is specifically used for: Extract the horizontal and vertical grayscale change values from the difference feature map; The gray-level gradient distribution matrix is constructed based on the horizontal gray-level change value and the vertical gray-level change value.
7. The online identification system for surface defects of motor vehicle headlight covers based on visual inspection as described in claim 3, characterized in that, The artifact suppression unit calculates the illumination artifact suppression ratio based on the gray-level gradient distribution matrix, specifically for: The difference feature map is processed by a preset Fourier frequency domain transform algorithm. Based on a preset spatial frequency cutoff threshold, the difference feature map is divided into frequency domains. The spectral components with spatial frequencies lower than the preset spatial frequency cutoff threshold are separated and extracted as low-frequency refraction components, and the spectral components with spatial frequencies not lower than the preset spatial frequency cutoff threshold are separated and extracted as high-frequency reflection components. The gray-level gradient distribution matrix is adjusted based on the high-frequency reflection component and the low-frequency refraction component; The ratio of the local gradient maxima to the global gradient average in the adjusted gray-level gradient distribution matrix is used as the illumination artifact suppression ratio.
8. The online identification system for surface defects of motor vehicle headlight covers based on visual inspection as described in claim 4, characterized in that, The curvature mapping unit calculates the cross-curvature feature consistency index corresponding to the true anomaly feature map, specifically for: The real anomaly feature map is mapped to the curvature distribution model, and feature vectors of the real anomaly feature map under different curvature regions are extracted. The dimension parameters of the feature vectors include local edge strength, directional continuity and region closure. Calculate the pairwise cosine similarity of the feature vectors under different curvature regions, and use the average value of the cosine similarity as the cross-curvature feature consistency index.