A method and system for identifying defects in mobile phone camera glass based on visual inspection

By acquiring background interference and defect features from multiple frame image sequences during mobile phone camera glass production, determining the background drift range, and performing cross-frame correlation, the problem of missing detection of minute defects caused by background drift is solved, achieving higher detection accuracy.

CN123118646APending Publication Date: 2026-11-17SHENZHEN RUI EURO OPTICAL ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611624614.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-20
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In the current technology for producing mobile phone camera glass, minute defects caused by background drift are incorrectly rejected, resulting in missed detection problems.

Method used

By acquiring background interference distribution features and defect features in multi-frame image sequences, the background drift coverage range is determined, defect features are correlated across frames to generate a defect tracking sequence, the defect hypothesis location of missing frames is calculated, and the location correction and feature reconstruction are performed on frames marked as missing due to background drift coverage to generate a defect evidence chain.

Benefits of technology

It effectively solves the problem of missed detection caused by background drift, improves the robustness of micro-defect detection, and ensures the accuracy of defect detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123118646A_ABST
    Figure CN123118646A_ABST
Patent Text Reader

Abstract

This application relates to the field of machine vision inspection technology, and discloses a method and system for identifying defects in mobile phone camera glass based on visual inspection. The method includes acquiring background interference distribution features and defect features of the mobile phone camera glass under test in a series of continuously acquired multi-frame image sequences; determining the background drift coverage range in the multi-frame image sequence based on the position and intensity changes of the background interference distribution features between adjacent frames; marking single-frame images in the multi-frame image sequence that do not detect defect features matching the defect tracking sequence as missing frames; calculating the hypothetical defect position of the missing frames; if the hypothetical defect position falls within the background drift coverage range, marking the missing frames as having missing background drift coverage; and performing position correction and feature reconstruction on the missing frames marked as having missing background drift coverage to generate a defect evidence chain. This method can effectively distinguish between signal occlusion caused by background drift and random noise, thereby avoiding the incorrect rejection of real defects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of machine vision inspection technology, and more specifically, to a method and system for identifying defects in mobile phone camera glass based on vision inspection. Background Technology

[0002] In the manufacturing process of mobile phone camera glass, multi-frame continuous visual inspection is widely used for defect identification to improve the signal-to-noise ratio of minute defects and reduce the interference of random noise. Existing multi-frame visual inspection typically involves continuously acquiring multiple images of the same glass area and performing inter-frame consistency comparison after candidate defect extraction. Under normal circumstances, genuine minute defects will appear multiple times at the same physical location, and inter-frame consistency verification can distinguish them from unstable random noise. However, in actual high-speed continuous acquisition production line environments, thermal drift of the light source, slight positioning errors of the inspection carrier, and minor changes in glass orientation are common. When the visual inspection system faces these minor perturbations, the intensity and position of the bright areas reflected from the coating layer interface will slightly drift between adjacent frames. In the multi-frame candidate defect verification and noise removal stage, if the minute defect happens to be near a highly reflective background, this inter-frame background drift will cause serious problems. The area where the minute defect is located will overlap with the drifted highly reflective background of the coating layer in some acquired frames, causing the grayscale contrast of the defect to further decrease in these frames, or even completely appearing as part of the background drift.

[0003] Existing technologies typically rely on the continuous and stable occurrence of defects in each frame. When a small defect is not identified as a candidate defect in some frames due to high background coverage, it will be discontinuous in the time series between frames. This discontinuity is attributed to random noise or reflection fluctuations, rather than being identified as a real recurring defect. This approach cannot eliminate the disruption of the temporal stability of weak defect signals caused by background drift, ultimately leading to the incorrect rejection of real small defects and missed detections. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this application provides a method and system for identifying defects in mobile phone camera glass based on visual inspection, which can solve the technical problem of missed detection caused by the erroneous rejection of minute defects in the multi-frame confirmation process due to background drift.

[0005] In a first aspect, this application provides a method for identifying defects in mobile phone camera glass based on visual inspection, including: Acquire the background interference distribution characteristics and defect characteristics of the camera glass of the mobile phone under test in a series of continuously acquired multi-frame images; The background drift coverage range in a multi-frame image sequence is determined based on the changes in position and intensity of background interference distribution characteristics between adjacent frames. Defect features are associated across frames according to their physical spatial location to generate a defect tracking sequence. Single-frame images in which no defect features matching the defect tracking sequence are detected in a multi-frame image sequence are marked as missing frames, and single-frame images in which defect features matching the defect tracking sequence are detected are marked as non-missing frames. Based on the physical spatial location of the defect features in the nearest non-missing frame before and after the missing frame, the assumed defect location of the missing frame is calculated. If the assumed defect location falls within the background drift coverage area, the missing frame is marked as background drift coverage missing; otherwise, it is marked as random noise missing. For missing frames marked as having missing background drift coverage, position correction and feature reconstruction are performed to generate a defect evidence chain, and the defect detection results including the defect evidence chain are output.

[0006] Optionally, the steps for obtaining the background interference distribution characteristics and defect characteristics of the camera glass of the mobile phone under test in a series of continuously acquired images include: For each single frame in a multi-frame image sequence, large-scale morphological filtering and adaptive dual-threshold segmentation are used to extract the core region of the high-reflectivity background. A high-reflectivity background binary mask and gray-level intensity gradient field are generated based on the high-reflectivity background core region. The background drift vector field between adjacent frames is calculated. The high-reflectivity background binary mask, gray-level intensity gradient field and background drift vector field are used as background interference distribution features. For each single-frame image, local anisotropic filtering and local adaptive differential extraction are used to extract abnormal responses that are higher than the preset local noise floor, generating a single-frame defect point set as defect features.

[0007] Optionally, the step of determining the background drift coverage range in a multi-frame image sequence based on the positional and intensity changes of background interference distribution characteristics between adjacent frames includes: Based on the high-reflectivity background binary mask, grayscale intensity gradient field, and background drift vector field, the spatial region occupied by the high-reflectivity background binary mask in each single frame image and its drift path between adjacent frames are determined. The area covered by the drift path and the area covered by the high-reflectivity background binary mask after it expands or contracts during the drift process are jointly determined as the background drift coverage range.

[0008] Optionally, the step of associating defect features across frames according to their physical spatial location to generate a defect tracking sequence includes: For each frame of image, a connected component analysis is performed on the set of defect points to obtain the defect connected components. The geometric centroid coordinates and defect morphology features of each defect connected component are then calculated. Starting with the geometric centroid coordinates of the defect connected region corresponding to the first frame image in a multi-frame image sequence, a search is performed according to a preset physical space neighborhood search radius. Defect connected regions in subsequent single-frame images whose morphological similarity to the defect morphological features of the first frame image exceeds a preset morphological similarity threshold are grouped into the same temporal trajectory chain to obtain a defect tracking sequence.

[0009] Optionally, the step of calculating the hypothetical location of the defect in the missing frame based on the physical spatial locations of the defect features in the nearest non-missing frame before and after the missing frame includes: Extract the physical spatial location of the defect feature from the nearest non-missing frame before and after the missing frame, and use linear interpolation to calculate the theoretical sub-pixel spatial location of the defect feature corresponding to the missing frame, which is then used as the assumed defect location.

[0010] Optionally, before the step of marking the missing frame as a background drift coverage missing if the location of the defect hypothesis falls within the background drift coverage area, and otherwise marking it as a random noise missing, the method further includes: A multi-scale local neighborhood window is constructed with the defect hypothesis location as the center. The neighborhood background coverage ratio is calculated from the binary mask of the high-reflectivity background. The cumulative amount of neighborhood light intensity rise is calculated from the gray intensity gradient field. The crossing direction of the high-reflectivity background core region relative to the multi-scale local neighborhood window before and after the missing frame is extracted from the background drift vector field. If the neighborhood background coverage ratio and the cumulative increase in neighborhood light intensity are both higher than their respective preset upper limit thresholds, and the crossing direction points to the assumed location of the defect, then the missing frame will be marked as a background drift coverage missing frame; otherwise, it will be marked as a suspected background occlusion frame.

[0011] Optionally, if the location of the defect hypothesis falls within the background drift coverage area, the missing frame is marked as a background drift coverage defect; otherwise, it is marked as a random noise defect. If a missing frame is marked as suspected background occlusion and the location of the defect is assumed to fall within the background drift coverage area, then the missing frame is remarked as a background drift coverage missing frame; otherwise, it is remarked as a random noise missing frame.

[0012] Optionally, the steps of performing position correction and feature reconstruction on missing frames marked as having missing background drift coverage to generate a defect evidence chain include: Extract the physical spatial location of the defect feature and the gray-level energy distribution feature reflecting the gray-level distribution of the original image data of the missing frame from the nearest non-missing frame before and after the missing frame. Calculate the final location of the defect in the missing frame based on the physical spatial location and gray-level energy distribution feature of the defect feature. In the original image data of the missing frame, a local analysis region is defined with the final position of the defect as the center. A fitting surface is constructed to describe the background brightness distribution pattern of the local analysis region due to the non-uniform distribution of background brightness caused by the reflection of the coating interface. The background brightness value corresponding to the fitting surface is subtracted from the original brightness value of the local analysis region to obtain the residual image after the high-brightness background is stripped. Defect residual features are extracted from the residual image, and the defect residual features are filled in by assigning values ​​based on the defect features in the nearest non-missing frame before the missing frame and the nearest non-missing frame after the missing frame. Based on the final location of the defect and the associated storage of the defect residual features after assignment and completion, a defect evidence chain is generated.

[0013] Optionally, the step of outputting defect detection results including a defect evidence chain includes: The comprehensive confidence score of the defect evidence chain is calculated based on the proportion of missing frames to the total number of frames and the similarity between the defect residual features after assignment and completion and the defect features. The output includes the defect evidence chain and the overall confidence score for defect detection results.

[0014] Secondly, this application also discloses a visual inspection-based mobile phone camera glass defect recognition system, comprising: The feature extraction module is used to obtain the background interference distribution features and defect features of the camera glass of the mobile phone under test in a series of continuously acquired multi-frame images; The background drift coverage determination module is used to determine the background drift coverage range in a multi-frame image sequence based on the position and intensity changes of the background interference distribution characteristics between adjacent frames. The cross-frame tracking module is used to associate defect features across frames according to their physical spatial location, generate a defect tracking sequence, and mark single-frame images in which no defect features matching the defect tracking sequence are detected in the multi-frame image sequence as missing frames, and single-frame images in which defect features matching the defect tracking sequence are detected as non-missing frames. The missing frame classification module is used to calculate the assumed location of the defect in the missing frame based on the physical spatial location of the defect features in the nearest non-missing frame before and after the missing frame. If the assumed location of the defect falls within the background drift coverage area, the missing frame is marked as background drift coverage missing; otherwise, it is marked as random noise missing. The evidence completion and output module is used to perform position correction and feature reconstruction on missing frames marked as missing due to background drift coverage, generate a defect evidence chain, and output the defect detection results including the defect evidence chain.

[0015] This application constructs a background drift coverage model to dynamically identify background drift regions caused by minute differences in light source or glass positioning. In multi-frame consistency detection, missing frames are no longer mechanically judged as random noise. Instead, by matching the calculated defect location with the background drift coverage, false defects caused by background occlusion are accurately located. By performing position correction, background fitting and stripping, and feature reconstruction on these missing frames, the minute defect signals obscured by the bright background can be effectively recovered, thereby constructing a complete defect evidence chain. This improves the robustness of minute defect detection in high-speed production line environments and effectively solves the problem of missed detection caused by background drift. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating a method for identifying defects in mobile phone camera glass based on visual inspection, provided in an embodiment of this application.

[0017] Figure 2 This is a schematic diagram of a visual inspection-based mobile phone camera glass defect recognition system provided in an embodiment of this application.

[0018] Labeling Explanation: 210 Feature Extraction Module; 220 Background Drift Coverage Determination Module; 230 Cross-Frame Tracking Module; 240 Missing Frame Classification Module; 250 Evidence Completion and Output Module. Detailed Implementation

[0019] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments. The components of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0020] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, the terms "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0021] In modern precision optical manufacturing and consumer electronics assembly lines, mobile phone camera glass, as a key optical component, directly affects the light transmittance, optical resolution, and image quality of the imaging module due to the quality of its surface and coating layer. To accurately identify minute defects such as scratches, dents, or dirt, and to reduce interference from random noise such as ambient light fluctuations in the production line, multi-frame continuous visual inspection technology is widely used in the defect detection process of mobile phone camera glass. In actual high-speed continuous acquisition production line environments, the glass under test is placed on a precision moving vehicle for continuous multi-frame image acquisition. However, thermal drift of the detection light source, micro-vibration of the high-speed moving mechanism, and slight differences in the glass's positioning posture can cause a slight positional shift and light intensity fluctuation in the bright background formed by the reflection from the coating layer interface on the mobile phone camera glass surface between different frames, resulting in background drift. If the actual minute defect happens to be located near this highly reflective background area, the drifting bright background will spatially overlap and grayscale mix with the minute defect in some acquisition frames, causing the local contrast of the defect to be significantly compressed or even completely submerged, thus preventing the minute defect from being identified as a candidate anomaly in these frames. Because minute defects appear intermittently in the time frame sequence, traditional multi-frame consistency verification logic often misjudges them as unstable random noise or occasional reflected light spots and directly rejects them, resulting in the missed detection of real minute defects.

[0022] Firstly, see [the following] Figure 1 This application discloses a method for identifying defects in mobile phone camera glass based on visual inspection, including: Acquire the background interference distribution characteristics and defect characteristics of the camera glass of the mobile phone under test in a series of continuously acquired multi-frame images; The background drift coverage range in a multi-frame image sequence is determined based on the changes in position and intensity of background interference distribution characteristics between adjacent frames. Defect features are associated across frames according to their physical spatial location to generate a defect tracking sequence. Single-frame images in which no defect features matching the defect tracking sequence are detected in a multi-frame image sequence are marked as missing frames, and single-frame images in which defect features matching the defect tracking sequence are detected are marked as non-missing frames. Based on the physical spatial location of the defect features in the nearest non-missing frame before and after the missing frame, the assumed defect location of the missing frame is calculated. If the assumed defect location falls within the background drift coverage area, the missing frame is marked as background drift coverage missing; otherwise, it is marked as random noise missing. For missing frames marked as having missing background drift coverage, position correction and feature reconstruction are performed to generate a defect evidence chain, and the defect detection results including the defect evidence chain are output.

[0023] Among them, the background interference distribution characteristics refer to the feature expression of non-target interference areas with specific brightness distribution and macroscopic geometric shape formed by strong reflection of the coating interface on the glass surface of the mobile phone camera in a multi-frame image sequence. It is used to quantify the spatial range, light intensity gradient and dynamic changes of the reflected background between frames.

[0024] Background drift coverage refers to the geometric set of physical space areas swept by the movement and deformation of highly reflective background areas between consecutive frames of images, caused by thermal drift of the light source, mechanical vibration, or slight deviation of the workpiece posture.

[0025] A defect tracking sequence refers to a spatiotemporal correlation trajectory chain formed by concatenating suspected defect responses with physical spatial proximity and morphological similarity detected in multiple image frames along a temporal dimension. This sequence records at least the defect's occurrence status in each frame, its corresponding coordinates, local morphological description, and the index of any missing frames.

[0026] Specifically, within the acquisition time span corresponding to a defect tracking sequence, if a single frame image successfully captures the defect feature, then the frame is defined as a non-missing frame; if a single frame image fails to directly extract the defect feature that matches the sequence, then the frame is defined as a missing frame.

[0027] The defect hypothesis location refers to the theoretical spatial coordinates of the defect that should exist in the missing frame, which are derived through spatial geometry based on the physical spatial coordinates of the defect in the time-series frames before and after which defects were normally detected.

[0028] A defect evidence chain refers to a comprehensive temporal basis for defect determination covering the entire acquisition cycle, consisting of defect feature data detected in multiple image frames and inferred data obtained by positional correction and feature reconstruction of missing frames after decoupling from background interference. This evidence chain typically includes the defect's coordinate information in each frame, its morphological description, its presence or absence status, the cause of the absence label, the background influence level, and the temporal continuity information after completion.

[0029] First, by performing parallel analysis on multiple frames of continuously acquired images of the camera glass of the mobile phone under test, macroscopic background interference distribution features and microscopic candidate defect features are extracted. These multiple frames are typically acquired continuously by an industrial area scan camera as the glass passes through the inspection field of view. Before entering subsequent analysis, each frame is preferably aligned to a unified physical spatial reference to eliminate rigid body displacement deviations caused by vehicle vibration and glass attitude changes, so that the same pixel position in different frames can correspond to the same physical micro-area on the glass.

[0030] Subsequently, by utilizing the spatial movement and light intensity changes of background interference distribution characteristics between frames, a background drift coverage range was constructed to define the dynamic physical region swept by high-reflectivity, strong interference in a multi-frame time sequence. Simultaneously, cross-frame tracking was performed based on the physical spatial coordinates of defect features in the temporal dimension, associating continuously captured defects into a defect tracking sequence. The capture status of each frame was then binarized and labeled to clearly distinguish between non-missing and missing frames.

[0031] Next, for the missing frames with discontinuities, the hypothetical location of the defect is deduced by using the spatial location of the temporally adjacent non-missing frames. The hypothetical location is then spatially intersected with the background drift coverage area. If the hypothetical location is within the background drift area, it proves that the invisibility of the defect is a false loss caused by the high reflectivity background coverage, and it is classified as a background drift coverage loss. If it does not fall within this range, it indicates that the discontinuity is more likely to originate from random photoelectric noise, occasional reflection disturbances, or unstable stray responses, and it is classified as a random noise loss.

[0032] Finally, for the frame data confirmed to be lost due to background coverage, directional position correction and signal feature reconstruction are performed to restore the continuous state of the defect throughout the entire time sequence, forming a highly reliable defect evidence chain and completing the result output.

[0033] Specifically, the camera glass of the mobile phone under test is driven by a precision tooling fixture through the optical imaging field of view. An industrial area array camera continuously acquires multiple frames of images under the illumination of a tuned light source. The number of consecutively acquired frames can be N, where N is an integer greater than or equal to 3. In one example, 5 frames can be acquired continuously, with an image resolution of 4096×3072 pixels. To ensure that subsequent cross-frame comparisons are based on the same physical region, the geometric center of the glass body's edge contour or a preset positioning marker is first used as a rigid body reference. Subpixel-level edge contour extraction is performed on each frame of the image to obtain the horizontal displacement, vertical displacement, and rotational deflection information of that frame relative to the reference frame. Then, interpolation mapping is used to transform each frame of the image to a unified global physical space reference coordinate system. Under the unified coordinate system, the overall reflective morphology is extracted as the background interference distribution feature by low-frequency background estimation of the entire image, and isolated dark spots, bright spots, or fine line-like abnormal responses are extracted as single-frame defect features by local high-frequency enhancement.

[0034] More specifically, when determining the background drift coverage area, the geometric envelopes of the reflective bright areas in frames 1 to 5 are compared. First, the outer contour of the highly reflective background area in each frame is extracted. Then, the changes in the reflective center position, contour boundary, and edge gradient diffusion width between adjacent frames are compared. If a slight shift in the reflective center in the X direction is found, and the edge transition zone expands outward in some frames, then instead of simply retaining the static bright areas of each frame, the contour union of the reflective areas in each frame, the sweep path area between adjacent frames, and the transition influence area formed by edge diffusion are combined to construct a continuously covering two-dimensional polygonal mask area. In the cross-frame association stage, starting from a small scratch candidate point in frame 1, candidate points with similar shapes and distances less than a preset search radius are searched in subsequent frames. This preset search radius is set according to the maximum non-rigid small deformation tolerance allowed by the system and can be expressed in pixels; in one example, it can be 3 pixels. If matching points are found in frames 1, 2, 4, and 5, but no matching features are detected in frame 3, then frame 3 is marked as a missing frame, and the remaining frames are marked as non-missing frames. Morphological similarity here can be jointly determined by the equivalent size of the candidate region, the ratio of its major and minor axes, the direction of local grayscale difference, and the stability of the boundary rectangle, rather than relying solely on a single grayscale value.

[0035] Further, the coordinates of the scratch are extracted from frames 2 and 4, and the hypothetical location of the defect in frame 3 is calculated using the geometric median method. If the position of the defect changes very little between the preceding and following effective frames, the hypothetical location is usually located in the middle neighborhood of the centroid line connecting the preceding and following frames; if there is a slight continuous drift, it can be smoothed by combining the trajectory trend of the preceding and following frames. Then, it is checked whether the hypothetical location of the defect is included in the aforementioned reflective polygon mask area, and further checked whether the local neighborhood around the location is within the high-reflectivity background core area, transition diffusion area, or background sweep path band. If it is included, it is determined that the defect in frame 3 was not detected because the reflective bright spot in frame 3 drifted to that location, causing the grayscale contrast to be swallowed up, thus marking frame 3 as a background drift coverage missing area. If the location does not fall within the background drift coverage area, and no obvious background rise is observed in its neighborhood, the missing area is more likely to be attributed to random noise.

[0036] Finally, the spatial geometric coordinates of the preceding and following valid frames are directly used to lock the theoretical physical location of the scratch in the third frame. A local analysis window is established around this location in the original image of the missing frame. After directional stripping of the local background, the defect description vector is reconstructed. If the local residual signal can still recover weak features, the recovery result is written into the feature description of the frame. If the local area has been covered by highlight saturation and a stable texture cannot be recovered, the geometric features and average morphological parameters of the preceding and following valid frames are inherited, and the frame is explicitly marked as having strong background coverage and physical inference is valid. Finally, a defect evidence chain containing all 5 frame states is generated and output.

[0037] By introducing the above technical solution, the spatiotemporal dynamic tracking of background interference distribution characteristics and background drift coverage range can accurately depict the physical migration trajectory of the bright reflection area between frames. When the state is missing in the time-series tracking sequence, the theoretical defect assumption position and background coverage range derived from the non-missing frames before and after are used for spatial inclusion verification, which reduces the false negative rate of weak defects, fully restores the physical evidence chain of real defects in the spatiotemporal dimension, and improves the accuracy of visual detection of defects in mobile phone camera glass.

[0038] Furthermore, the steps for obtaining the background interference distribution characteristics and defect characteristics of the camera glass of the mobile phone under test in a series of continuously acquired images include: For each single frame in a multi-frame image sequence, large-scale morphological filtering and adaptive dual-threshold segmentation are used to extract the core region of the high-reflectivity background. A high-reflectivity background binary mask and gray-level intensity gradient field are generated based on the high-reflectivity background core region. The background drift vector field between adjacent frames is calculated. The high-reflectivity background binary mask, gray-level intensity gradient field and background drift vector field are used as background interference distribution features. For each single-frame image, local anisotropic filtering and local adaptive differential extraction are used to extract abnormal responses that are higher than the preset local noise floor, generating a single-frame defect point set as defect features.

[0039] Specifically, targeting the background interference distribution characteristics, a large-scale background estimation is first performed on a single frame image to suppress small defects and isolated noise, retaining only the low-frequency large-scale reflective distribution. Then, through adaptive dual-threshold segmentation, the high-reflectivity area is divided into a bright core region and a gradient edge, thereby generating an accurate binary mask of the high-reflectivity background and calculating the gray-level intensity gradient field that characterizes the spatial variation trend of light intensity. At the same time, a background drift vector field that characterizes the background motion direction and displacement magnitude is calculated between adjacent frames, thus constructing a multi-dimensional background interference distribution feature.

[0040] To address defect characteristics, local anisotropic filtering is used to preserve high-frequency edge information and suppress smooth backgrounds. Combined with local adaptive differential calculation of the relative grayscale difference between a pixel and its micro-neighborhood, a single-frame defect point set with a lower trigger threshold is extracted, ensuring that minute defect signals in low-contrast conditions are fully captured in the initial stage. The preset local noise floor is obtained during equipment calibration. Specifically, multiple frames are continuously acquired under conditions of no sample or standard defect-free glass, and the grayscale fluctuation range within the local window is statistically analyzed. The upper bound of the stable noise is used as a reference value for the local noise floor. During actual operation, adaptive correction is performed based on the local brightness level of the current frame to avoid threshold distortion under different lighting conditions.

[0041] For specific examples, please refer to the following: When processing a single-frame image, a circular structuring element is used to perform morphological opening operations on the high-reflectivity background track. The size of the structuring element is set according to the typical scale of the target background patch and the maximum allowable size of the defect to be detected. The principle is to filter out small defects at this scale while preserving the reflective contours of large-area coatings. In one example, a circular structuring element with a radius of 15 pixels can be used. Then, hysteresis thresholding is performed using high and low thresholds to obtain a binary mask of the high-reflectivity background. The high threshold is used to lock the bright core region, and the low threshold is used to connect the diffusion edges that are continuously transitioned to the core region. The two thresholds can be adaptively determined based on the local mean, the local brightness fluctuation range, and the background estimation results, rather than being limited to fixed constants. Next, the local grayscale change direction and intensity are calculated on the original grayscale image using a first-order grayscale change operator to obtain the grayscale intensity gradient field. Then, the displacement vector between the background masks of two adjacent frames is calculated using optical flow, block matching algorithms, or inter-frame comparison methods based on centroid drift to form a background drift vector field. The minor defect feature algorithm employs anisotropic diffusion filtering of local windows to smooth random noise. Then, it uses the absolute value of the difference between the current pixel's grayscale and the mean of surrounding local windows to filter out all pixels whose differential response exceeds the sensor's dark current noise floor and local texture fluctuation noise floor. These are then aggregated through connectivity testing to form a single-frame defect point set. If a connected region is too small and only appears instantaneously on a single pixel, it can be temporarily retained as a weak candidate for further screening in subsequent cross-frame tracking and background occlusion discrimination, rather than being directly deleted at the single-frame stage.

[0042] The above technical solution accurately locks the geometric contour and gradient field of the high-reflectivity area of ​​the coating by using large-scale morphological filtering and adaptive dual-threshold segmentation, and quantifies the dynamic movement of the background by using drift vector field; by using local anisotropic filtering and local adaptive difference, the weak defect response is preserved to the greatest extent and is not masked by the large-scale background.

[0043] Furthermore, the step of determining the background drift coverage range in a multi-frame image sequence based on the positional and intensity changes of background interference distribution characteristics between adjacent frames includes: Based on the high-reflectivity background binary mask, grayscale intensity gradient field, and background drift vector field, the spatial region occupied by the high-reflectivity background binary mask in each single frame image and its drift path between adjacent frames are determined. The area covered by the drift path and the area covered by the high-reflectivity background binary mask after it expands or contracts during the drift process are jointly determined as the background drift coverage range.

[0044] Specifically, firstly, the absolute static spatial coordinate range corresponding to the binary mask of the highly reflective background in each frame is determined; then, based on the background drift vector field, the geometric envelope swept by the background core as it moves between adjacent frames is depicted, constructing the dynamic drift path; simultaneously, the gradient diffusion trend of the background boundary between frames is evaluated using the grayscale intensity gradient field, and the deformation extension region when the background expands or contracts is determined by combining the changes in mask area. Finally, a spatial Boolean union operation is performed on all single-frame mask regions, dynamic drift path coverage areas, and deformation extension regions to merge them into a background drift coverage range that can completely encompass all dynamic effects of the background.

[0045] Furthermore, in boundary scenarios for background occlusion discrimination, a local neighborhood window can be established around the hypothetical defect location corresponding to the missing frame. The neighborhood background coverage ratio is calculated from the high-reflectivity background binary mask, the cumulative increase in neighborhood light intensity is calculated from the gray-scale intensity gradient field, and the crossing direction of the background boundary relative to the window is extracted from the background drift vector field. Combined with the local contrast changes of the effective frames before and after, the degree of background influence is graded and discriminated. If both the neighborhood background coverage ratio and the cumulative increase in neighborhood light intensity are at a high level, and the crossing direction of the background boundary clearly points to the theoretical defect location, the missing element can be directly confirmed as background occlusion. If the above evidence is weak, it is likely to be judged as non-background occlusion. If it is in a boundary transition state, it can be marked as suspected background occlusion first, and then verified by the background drift path band of adjacent frames. After this processing, the background drift coverage area is not only a geometric region, but also becomes the evidence basis for subsequent missing cause differentiation.

[0046] For specific examples, please refer to the following: Assume that in frame k, a high-reflectivity background binary mask occupies region A_k, and in frame k+1, it occupies region A_{k+1}. The background drift vector field indicates that the reflection center moves from the previous position to the next position. First, extract the outer contours of A_k and A_{k+1} respectively, and construct a connecting polygon between them along the direction of movement to form the drift sweep path band R_path. At the same time, compare the area and edge gradient distribution of A_k and A_{k+1}. If the area increases or the edge transition band widens in the next frame, then dynamically expand the mask boundary outward according to the width of the low gradient transition area in the gray intensity gradient field of frame k+1, generating an expanded coverage area R_exp. If the area decreases in the next frame, retain the influence band of the edge extension region of the previous frame during the transition time to avoid missing areas that may still cause suppression during the shrinkage process. Finally, a union operation is performed on A_k, A_{k+1}, R_path, and R_exp to form the comprehensive background drift coverage range from frame k to frame k+1. If the theoretical position of the missing frame corresponding to a defect tracking sequence between frame k and frame k+1 falls within this comprehensive range, it indicates that the position is affected by at least one of the following during this time period: background core coverage, boundary diffusion coverage, or drift path sweep. Therefore, it should be prioritized for inclusion in the background occlusion discrimination branch and should not be directly removed as random noise.

[0047] By incorporating the drift path sweep area and the expansion and contraction deformation area into the background drift coverage area, the above technical solution ensures that any physical area affected by background movement or edge light intensity enhancement is included in the judgment criteria without omission.

[0048] Furthermore, the steps of associating defect features across frames according to their physical spatial location to generate a defect tracking sequence include: For each frame of image, a connected component analysis is performed on the set of defect points to obtain the defect connected components. The geometric centroid coordinates and defect morphology features of each defect connected component are then calculated. Starting with the geometric centroid coordinates of the defect connected region corresponding to the first frame image in a multi-frame image sequence, a search is performed according to a preset physical space neighborhood search radius. Defect connected regions in subsequent single-frame images whose morphological similarity to the defect morphological features of the first frame image exceeds a preset morphological similarity threshold are grouped into the same temporal trajectory chain to obtain a defect tracking sequence.

[0049] Specifically, connected component analysis refers to aggregating spatially contacting or adjacent candidate defect pixels into a unified target based on their connectivity, transforming the originally scattered pixel responses into defect connected components with boundary, area, and orientation attributes. In the scenario of mobile phone camera glass inspection, real micro-defects usually do not appear as isolated pixels but rather form several adjacent abnormal pixels locally. Therefore, connected component analysis can better reflect the imaging morphology of real physical defects. Geometric centroid coordinates are used to characterize the center position of the defect connected component in a unified physical space reference, while defect morphological features are used to characterize the shape, scale, and grayscale response characteristics of the defect connected component, such as equivalent diameter, aspect ratio, boundary rectangle size, average grayscale difference, and contrast-to-noise ratio.

[0050] By constructing a cross-frame tracking trajectory tree with the first frame as the root node in time sequence, and setting a dual constraint threshold combining the physical spatial neighborhood search radius and morphological similarity, erroneous association between adjacent defects can be effectively prevented, while filtering out occasional discrete random noise points in a single frame. The preset physical spatial neighborhood search radius can be set according to the system's maximum non-rigid micro-deformation tolerance. Specifically, it can be obtained by collecting a batch of standard glass sample images that have completed spatial reference alignment under stable production line operation, statistically analyzing the residual position fluctuation range of the same fixed defect in adjacent frames, and then leaving a safety margin on this fluctuation range. The preset morphological similarity threshold can be determined by establishing a validation set with manually labeled real defect samples and noise samples, comparing the cross-frame feature differences of similar defects with the feature differences of dissimilar targets, so that real defects can be stably associated under normal drift conditions, while random noise and proximity artifacts are difficult to pass the matching threshold.

[0051] For a specific example, consider the following: For the single-frame defect point set extracted in the k-th frame, an 8-neighborhood connected component labeling algorithm is used to aggregate adjacent pixels into defect connected components. An 8-neighborhood refers to considering a given pixel in its horizontal, vertical, and diagonal directions. If these pixels are consecutively present in the candidate defect point set, they are grouped into the same defect connected component. This approach is used because microcracks and small pits often exhibit oblique extensions or irregular edges during imaging; using only a 4-neighborhood can easily lead to incorrect segmentation of the same defect.

[0052] For each defect connected component, its zeroth and first moments are calculated to obtain the sub-pixel level geometric centroid coordinates (x, y). Simultaneously, its second central moment is calculated, and the equivalent diameter, major axis length, minor axis length, major-minor axis ratio, circumscribed rectangle aspect ratio, and average grayscale contrast are extracted to form a multi-dimensional defect morphological feature vector. To avoid interference from extremely small isolated noise points, a minimum area filter can be added after connected component analysis, retaining only defect connected components with an area not less than a preset pixel threshold. This area threshold can be calibrated based on camera resolution and the smallest detectable defect size. The average grayscale contrast in the morphological features can be obtained by comparing the grayscale inside the defect connected component with the grayscale of its surrounding local background ring. The contrast signal-to-noise ratio can be normalized by combining the local background fluctuation amplitude, thus making defect features in different brightness regions comparable. During cross-frame tracking, the centroid coordinates of a defect connected component detected in the first frame image are used as the starting point, and a physical space neighborhood search radius R is set (e.g., set to 3 pixels based on the maximum allowable non-rigid micro-deformation tolerance of the production line).

[0053] In the second frame image, candidate defect connected components are searched within a circular region centered on the centroid coordinates and with radius R. If one or more candidate components are found within the search region, the Euclidean distance between the candidate component and the defect connected component in the first frame is further calculated. If the morphological similarity corresponding to the minimum Euclidean distance is greater than a preset morphological similarity threshold (e.g., 0.85), the candidate component is determined to be the response of the same defect in the second frame, and its centroid and features are added to the temporal trajectory chain. This process is repeated for all subsequent frames. If no candidate connected component satisfying the morphological similarity threshold is found within the search radius of a certain frame, the temporal trajectory chain retains the state missing marker for that frame, but the trajectory chain is not truncated. It continues to extrapolate based on the previous trajectory and search in subsequent frames until all frames are traversed, ultimately generating a complete defect tracking sequence. The extrapolation here can use the position of the previous valid frame or combine the displacement trend of the previous two valid frames for short-range prediction. Its purpose is not to directly confirm the existence of the defect, but to provide a more stable search center for subsequent frames, avoiding the breakage of the entire trajectory chain due to the absence of a single frame.

[0054] The above technical solution not only significantly reduces the computational complexity of multi-frame correlation, but also effectively overcomes the disturbance of target positioning caused by minute local vibrations, so that the appearance, continuation and temporary disappearance of the same physical defect in the continuous acquisition process can be completely recorded and form a clear temporal trajectory chain.

[0055] Furthermore, the step of calculating the hypothetical location of the defect in the missing frame based on the physical spatial locations of the defect features in the nearest non-missing frame before and after the missing frame includes: Extract the physical spatial location of the defect feature from the nearest non-missing frame before and after the missing frame, and use linear interpolation to calculate the theoretical sub-pixel spatial location of the defect feature corresponding to the missing frame, which is then used as the assumed defect location.

[0056] Specifically, since a unified physical spatial reference alignment has been completed before multi-frame image acquisition, the actual physical defects have an absolutely fixed physical position on the glass surface. Even with extremely weak, incompletely compensated residual uniform linear velocity or slight uniform drift of the vehicle, the positional migration of the defect between consecutive frames strictly follows a linear translation law. The assumed defect position refers to the theoretical position that should be located at the time of the missing frame, based on the actual observed position of the defect in the nearest preceding and following valid frames, even though no defect response was directly detected in the missing frame. The physical spatial positions of the defect features in the nearest non-missing frame before and after the missing frame can be directly read from the aforementioned defect tracking sequence, because each trajectory chain has recorded the geometric centroid coordinates and time index of each valid frame. Calculating the theoretical sub-pixel spatial position of the defect features corresponding to the missing frame using linear interpolation can recover the target reference point in the missing frame with low computational cost, making it particularly suitable for mobile phone camera glass inspection scenarios with high-speed continuous acquisition, fixed inter-frame time intervals, and smooth residual motion. If a fixed exposure cycle and a fixed trigger beat are used in the production line, the time interval between adjacent frames will be naturally consistent, and the physical meaning of linear interpolation will be clearer. If there is a small amount of trigger jitter, interpolation can be performed according to the actual time interval after reading the timestamp of each frame, without changing the basic processing logic of this step.

[0057] For a specific example, consider the following: Assume a time-series image sequence has a total of 5 frames (frames 1 to 5). A defect tracking sequence is stably detected in frames 1, 2, 4, and 5, but a signal is missing in frame 3. In this case, frame 3 is the missing frame, the nearest preceding non-missing frame is frame 2, and the nearest following non-missing frame is frame 4. Extract the sub-pixel centroid physical coordinates P_2(x_2,y_2) of the defect in frame 2 and the sub-pixel centroid physical coordinates P_4(x_4,y_4) of the defect in frame 4. Since frame 3 is located at the midpoint between frames 2 and 4, the theoretical sub-pixel spatial position of frame 3 is calculated using the linear interpolation formula: P_3 = P_2 + (P_4 - P_2) * (3 - 2) / (4 - 2) = ((x_2 + x_4) / 2, (y_2 + y_4) / 2). The calculated coordinate value P_3 is then used as the assumed defect position of the missing frame in frame 3. If multiple frames are missing consecutively (e.g., frames 2 and 3 are missing consecutively), linear piecewise interpolation is performed based on the time span of the preceding and following valid frames and the corresponding temporal weights. To make this step easier to implement, in an executable example, the valid frame numbers, corresponding centroid coordinates, and acquisition timestamps at both ends of the missing segment can be read from the trajectory chain first, and then the assumed defect position can be generated frame by frame according to the relative position of the missing frame in the entire time interval. If the missing segment is located at the beginning or end of the trajectory chain, resulting in only one valid frame, then this type of case will not use double-frame interpolation, but will be retained as a special state that cannot be directly interpolated, and will be handled by subsequent confidence constraints or re-examination processes, in order to avoid unreliable position inferences when there is insufficient evidence.

[0058] Using the above technical solution, without relying on the measured pixel response of the missing frame, the theoretical sub-pixel spatial location of the defect at the missing moment is mathematically reconstructed by utilizing high-confidence physical space observations of the preceding and following valid frames.

[0059] Furthermore, before the step of marking the missing frame as a background drift coverage missing if the location of the defect hypothesis falls within the background drift coverage area, and otherwise marking it as a random noise missing, the method further includes: A multi-scale local neighborhood window is constructed with the defect hypothesis location as the center. The neighborhood background coverage ratio is calculated from the binary mask of the high-reflectivity background. The cumulative amount of neighborhood light intensity rise is calculated from the gray intensity gradient field. The crossing direction of the high-reflectivity background core region relative to the multi-scale local neighborhood window before and after the missing frame is extracted from the background drift vector field. If the neighborhood background coverage ratio and the cumulative increase in neighborhood light intensity are both higher than their respective preset upper limit thresholds, and the crossing direction points to the assumed location of the defect, then the missing frame will be marked as a background drift coverage missing frame; otherwise, it will be marked as a suspected background occlusion frame.

[0060] Specifically, the multi-scale local neighborhood window refers to establishing multiple local analysis regions of different sizes but with a consistent center around the assumed location of the defect. This is used to simultaneously observe the background state of the vicinity of the defect's micro-region and the background diffusion trend over a slightly larger area. Smaller windows are more suitable for reflecting the direct coverage near the defect, while larger windows are more suitable for reflecting the gradual intrusion degree of the high-reflectivity background edge. The high-reflectivity background binary mask and grayscale intensity gradient field both come from the aforementioned dual-track feature extraction stage. The high-reflectivity background binary mask is used to represent the spatial distribution of the high-reflectivity background core region and the transition diffusion region, the grayscale intensity gradient field is used to represent the direction and intensity of local brightness changes, and the background drift vector field is used to represent the movement direction, displacement distance, and local deformation trend of the high-reflectivity background between adjacent frames.

[0061] The neighborhood background coverage ratio quantifies the spatial occupancy of highly reflective backgrounds within a local window; the cumulative increase in neighborhood light intensity quantifies the overall brightness increase within the local window, rather than simply checking if a single point's brightness exceeds a threshold; the crossing direction determines whether the highly reflective background is moving towards or has already swept past the assumed defect location. The preset upper limit threshold can be obtained through offline calibration. Specifically, a batch of manually confirmed background drift coverage missing samples and random noise missing samples can be selected, and the distribution ranges of their neighborhood background coverage ratio and cumulative increase in neighborhood light intensity can be statistically analyzed. Then, a threshold that effectively distinguishes between the two types of samples can be selected as the upper limit threshold. If the production line changes the light source angle, camera gain, or glass coating process, the threshold can be recalibrated, but the judgment logic remains unchanged. Marking samples that do not meet the strong coverage condition as suspected background occlusion, rather than immediately classifying them as random noise missing, preserves genuine weak defects for subsequent verification, avoiding premature rejection at the judgment entry point.

[0062] For specific examples, consider the following: Assume the defect location P_0(x_0, y_0) in a missing frame. Construct a dual-scale local neighborhood window W with dimensions of 11×11 pixels and 21×21 pixels, centered on P_0. Calculate the proportion of pixels with a value of 1 in the binary mask of the highly reflective background within window W, obtaining the neighborhood background coverage ratio C_bg. Simultaneously, accumulate the light intensity change rate along the gradient direction of all pixels within window W in the grayscale intensity gradient field to calculate the cumulative neighborhood light intensity lift G_lift. Furthermore, combining the background drift vector fields of the previous and next frames of the missing frame, calculate the projection of the highly reflective core centroid motion vector onto the direction of window W, and determine whether the background boundary movement's crossing direction vector V_dir explicitly points to P_0.

[0063] First, a local region of the same size as window W is extracted from the binary mask of the high-reflectivity background corresponding to the missing frame. The number of pixels marked as high-reflectivity background is counted and then divided by the total number of pixels in the window to obtain the neighborhood background coverage ratio. Second, the gradient magnitude of each pixel in window W is read from the grayscale intensity gradient field, and weighted and accumulated based on whether the gradient direction is towards the vicinity of the window center to highlight the brightness increase trend that suppresses the assumed defect location. Third, local drift vectors intersecting with the window are extracted from the background drift vector field of the adjacent valid frames before and after the missing frame. It is determined whether the dominant direction of these vectors points from outside the window to the region where P_0 is located. If so, it indicates that the high-reflectivity background has a dynamic trend of invading or sweeping towards the defect micro-region. If the calculated C_bg is greater than the preset upper limit threshold (e.g., 0.70), G_lift is greater than the preset upper limit threshold for light intensity increase (e.g., local mean increase exceeds 30 gray levels), and the angle between the line connecting V_dir and P_0 is less than the preset angle tolerance (e.g., within 30 degrees), it indicates that the defect has been suppressed by the high reflectivity background in the missing frame, and the missing frame is directly marked as a background drift coverage missing frame. If any of the above three strong constraints is not fully met (e.g., C_bg is between 0.30 and 0.70, or the cumulative amount of light intensity increase is in the transition range), it is not directly removed, but marked as a suspected background occlusion in an intermediate state. The decrease in local contrast signal-to-noise ratio recorded in the candidate features of the preceding and following valid frames can also be used as an auxiliary reference: if the contrast near the defect is continuously decreasing in the adjacent valid frames before and after the missing frame, it is more supportive of the background suppression judgment; if the contrast change is close to the noise baseline fluctuation, it is more inclined to retain it as a suspected state for review, rather than directly upgrading it to a background drift coverage missing frame.

[0064] The above technical solution introduces multi-source physical evidence at the neighborhood scale at the key classification entry point, and deeply integrates static mask, light intensity gradient field and dynamic drift vector field, effectively solving the problem of decision failure caused by insufficient single-point evidence at the gradient edge of coating reflection of small defects.

[0065] Furthermore, if the location of the defect hypothesis falls within the background drift coverage area, the missing frame is marked as a background drift coverage defect; otherwise, it is marked as a random noise defect. If a missing frame is marked as suspected background occlusion and the location of the defect is assumed to fall within the background drift coverage area, then the missing frame is remarked as a background drift coverage missing frame; otherwise, it is remarked as a random noise missing frame.

[0066] Specifically, the background drift coverage is a spatiotemporally continuous polygonal envelope formed by the sweeping path of the highly reflective background between adjacent frames and the expansion and contraction extension regions. The background drift coverage can be generated by retrieving the binary masks of the highly reflective background in the preceding and following valid frames, the centroid position of the background core region, and the background drift vector field: first, the core region and transition diffusion region of the highly reflective background in the preceding and following frames are determined; then, the sweeping regions between the preceding and following positions are connected according to the drift vector, and the edge diffusion portion is appropriately extended to obtain the coverage path band. This coverage path band reflects the spatial region that the highly reflective background may have actually swept during the temporal transition, therefore its evidentiary priority is higher than that of a single-point mask query result. When a missing frame is initially judged as potentially occluded by background, it indicates that varying degrees of light intensity anomalies or transition features have been observed in its local neighborhood.

[0067] At this point, by checking whether the location of the defect hypothesis is within the macroscopic background drift coverage range: if it falls within this range, it is confirmed from a physical spatiotemporal mechanism that the location must have been subjected to dynamic sweeping or edge diffusion suppression of the high-brightness reflection area during the temporal transition, thus providing sufficient macroscopic physical basis to upgrade and correct its status to background drift coverage deficiency, allowing it to enter the subsequent feature reconstruction main chain; if the location is not within the background drift coverage range, it indicates that the local weak anomaly is not caused by background dynamic drift and lacks a continuous macroscopic physical cause, and it should be prudently re-marked as random noise deficiency and removed. If, in individual cases, the background drift nonlinearity is strong and the path band cannot be stably established, the sample can be retained as a low-confidence suspected item and entered into the re-examination cache queue, but the above priority review logic remains unchanged.

[0068] The above technical solution not only protects the real tiny defects in the weak contrast state at the reflective edge, but also effectively blocks the interference of non-physical random noise.

[0069] Furthermore, for missing frames marked as having missing background drift coverage, the steps of performing position correction and feature reconstruction to generate a defect evidence chain include: Extract the physical spatial location of the defect feature and the gray-level energy distribution feature reflecting the gray-level distribution of the original image data of the missing frame from the nearest non-missing frame before and after the missing frame. Calculate the final location of the defect in the missing frame based on the physical spatial location and gray-level energy distribution feature of the defect feature. In the original image data of the missing frame, a local analysis region is defined with the final position of the defect as the center. A fitting surface is constructed to describe the background brightness distribution pattern of the local analysis region due to the non-uniform distribution of background brightness caused by the reflection of the coating interface. The background brightness value corresponding to the fitting surface is subtracted from the original brightness value of the local analysis region to obtain the residual image after the high-brightness background is stripped. Defect residual features are extracted from the residual image, and the defect residual features are filled in by assigning values ​​based on the defect features in the nearest non-missing frame before the missing frame and the nearest non-missing frame after the missing frame. Based on the final location of the defect and the associated storage of the defect residual features after assignment and completion, a defect evidence chain is generated.

[0070] Specifically, when a tiny defect is squeezed by the edge of a bright background, a slight energy distortion may occur locally. Therefore, in addition to utilizing the physical spatial location of the preceding and following non-missing frames, a weighted fine-tuning is performed using the local gray-scale energy distribution characteristics of the missing frame to obtain a more accurate final defect location than simple geometric interpolation. The local analysis region is a local microscopic window (e.g., a 31×31 pixel rectangular area) centered on the final defect location. For the smooth, non-uniform brightness distribution within this window due to reflection from the optical coating on the phone camera glass surface, a fitted surface (e.g., using low-order bivariate polynomial surface fitting or local B-spline fitting) is constructed to accurately approximate the bright background baseline. Subsequently, by subtracting the spatial residuals, the originally towering background baseline is stripped away, exposing the submerged weak residual response of the defect.

[0071] After generating the residual image, defect residual features such as residual peaks and local gradient trends are extracted. Considering that some missing frames may be located in areas of severe background oversaturation, resulting in low signal-to-noise ratios of local residual signals, the extracted defect residual features are assigned values ​​and temporally smoothed based on high-quality defect features (such as aspect ratio, geometric area, and main direction) that have been stably acquired in the nearest non-missing frames. Finally, the precise final location of the defect is bound and recorded with the completed feature vector in a structured form, generating a defect evidence chain that spans multiple frames and the entire temporal sequence.

[0072] For specific examples, please refer to the following: For frame 3 marked as having missing background drift coverage, firstly extract the centroid P_2 of frame 2 and the centroid P_4 of frame 4. Combine this with the local grayscale centroid offset of frame 3 at the theoretical position of P_3 to perform sub-pixel fine-tuning of the theoretical coordinates, locking the final defect position P_final(x_f,y_f). Next, extract a 31×31 pixel local sub-image I_local centered on P_final. Use a bi-second-order polynomial surface S(x,y)=ax^2+by^2+cxy+dx+ey+f to perform least-squares fitting on the background pixels in I_local, excluding the potential defect center, to accurately fit the light intensity pattern of the high-reflectivity coated background. Here, x and y are the horizontal and vertical coordinates of the pixels in the local analysis area, respectively, and S(x,y) is the background brightness given by the fitted surface at coordinates (x,y). The estimated values ​​are as follows: a and b are the curvature coefficients of the quadratic surface along the x and y directions, respectively, used to characterize the degree of curvature of the background brightness in the orthogonal directions; c is the cross quadratic term coefficient, used to characterize the degree of torsion or tilt coupling of the background surface; d and e are the linear slope coefficients along the x and y directions, respectively, used to characterize the unidirectional gradual change trend of the background brightness; f is a constant term, used to characterize the background brightness reference offset in the local analysis area; the high-frequency residual map I_res is obtained by subtracting the fitted background surface S(x,y) from I_local. Then, local extreme points are searched in I_res to extract the residual contour. If the contrast of the residual contour is greater than the preset recovery noise, the residual features of the current frame are directly extracted; if the residual is not obvious due to local overexposure, the mean value of the defect morphology parameters of the 2nd and 4th frames is directly inherited, and the state field of the 3rd frame is assigned as valid for background coverage feature reconstruction. This is then merged and encapsulated with the final defect position P_final into the temporal evidence chain data structure of the defect.

[0073] The above technical solution utilizes local surface fitting technology to remove the complex non-uniform strong reflection background of the coating interface, and completes the residual features by using the features of the previous and next frames, thereby constructing a defect evidence chain.

[0074] Furthermore, the steps for outputting defect detection results, including a defect evidence chain, include: The comprehensive confidence score of the defect evidence chain is calculated based on the proportion of missing frames to the total number of frames and the similarity between the defect residual features after assignment and completion and the defect features. The output includes the defect evidence chain and the overall confidence score for defect detection results.

[0075] Specifically, the proportion of missing frames to the total number of frames (i.e., the missing rate) reflects the visible stability of the defect during multi-frame observation. The lower the proportion of missing frames, the more sufficient the direct observation evidence from actual measurements. The similarity between the defect residual features after assignment and the defect features in the preceding and following non-missing frames (i.e., feature temporal consistency) reflects the degree of agreement between the feature reconstruction results and the inherent properties of the physical defect. The higher the similarity, the more realistic and reliable the features recovered through local surface stripping and residual assignment are. The two are normalized and calculated using a preset weighted fusion model to obtain a comprehensive confidence score between 0 and 1 (or 0 to 100 points). This score, along with the defect evidence chain containing the spatial coordinates, morphological parameters, and missing labels of each frame, is then packaged into a standard detection result output.

[0076] For a specific example, consider the following: For a defect evidence chain with a total of 5 frames, where 1 frame is a missing frame due to background drift and 4 frames are directly detected non-missing frames, the calculated frame missing penalty factor is (1-1 / 5)=0.8. Simultaneously, the cosine similarity between the padded morphological vector of the missing frame and the average morphological vector of the preceding and following frames is calculated, yielding a feature consistency coefficient of 0.92. Using a weighted model Score=100*(w1*0.8+w2*0.92) (where weights w1 and w2 can be configured to 0.4 and 0.6 respectively), the overall confidence score of this defect evidence chain is calculated to be 87.2. The final defect detection result output includes not only the physical spatial coordinates of the defect, the defect type, and the equivalent geometric dimensions, but also the confidence score of 87.2 for this evidence chain and the complete spatiotemporal completion trajectory of the 5 frames, which can be directly used by production line sorting machines or re-inspection machines for automated classification and processing.

[0077] Secondly, see Figure 2 This application also discloses a visual inspection-based mobile phone camera glass defect recognition system, comprising: Feature extraction module 210 is used to obtain background interference distribution features and defect features of the camera glass of the mobile phone under test in a series of continuously acquired multi-frame image sequences; Background drift coverage determination module 220 is used to determine the background drift coverage range in a multi-frame image sequence based on the position and intensity changes of background interference distribution characteristics between adjacent frames; The cross-frame tracking module 230 is used to associate defect features across frames according to their physical spatial locations, generate a defect tracking sequence, and mark single-frame images in which no defect features matching the defect tracking sequence are detected in the multi-frame image sequence as missing frames, and mark single-frame images in which defect features matching the defect tracking sequence are detected as non-missing frames. The missing frame classification module 240 is used to calculate the defect hypothesis position of the missing frame based on the physical spatial position of the defect features in the nearest non-missing frame before the missing frame and the nearest non-missing frame after the missing frame. If the defect hypothesis position falls within the background drift coverage area, the missing frame is marked as background drift coverage missing; otherwise, it is marked as random noise missing. The evidence completion and output module 250 is used to perform position correction and feature reconstruction on missing frames marked as background drift coverage loss, generate a defect evidence chain, and output defect detection results including the defect evidence chain.

[0078] The above technical solution effectively solves the problem of missed detection and misjudgment of minor defects caused by background drift due to strong reflection of the coating on mobile phone camera glass, and improves the accuracy of defect detection.

[0079] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for identifying defects in mobile phone camera glass based on visual inspection, characterized in that, include: Acquire the background interference distribution characteristics and defect characteristics of the camera glass of the mobile phone under test in a series of continuously acquired multi-frame images; Based on the changes in position and intensity of the background interference distribution characteristics between adjacent frames, the background drift coverage range in the multi-frame image sequence is determined; The defect features are associated across frames according to their physical spatial location to generate a defect tracking sequence. Single-frame images in the multi-frame image sequence that do not detect defect features that match the defect tracking sequence are marked as missing frames, and single-frame images that detect defect features that match the defect tracking sequence are marked as non-missing frames. Based on the physical spatial location of the defect feature in the nearest non-missing frame before the missing frame and the nearest non-missing frame after the missing frame, the assumed defect location of the missing frame is calculated. If the assumed defect location falls within the background drift coverage area, the missing frame is marked as background drift coverage missing; otherwise, it is marked as random noise missing. For the missing frames marked as having missing background drift coverage, position correction and feature reconstruction are performed to generate a defect evidence chain, and the defect detection result including the defect evidence chain is output.

2. The method for identifying defects in mobile phone camera glass based on visual inspection according to claim 1, characterized in that, The steps for obtaining the background interference distribution characteristics and defect characteristics of the camera glass of the mobile phone under test in a series of continuously acquired multi-frame image sequences include: For each single frame image in the multi-frame image sequence, a high-reflectivity background core region is extracted using large-scale morphological filtering and adaptive dual-threshold segmentation. A high-reflectivity background binary mask and a gray-level intensity gradient field are generated based on the high-reflectivity background core region. The background drift vector field between adjacent frames is calculated. The high-reflectivity background binary mask, the gray-level intensity gradient field, and the background drift vector field are used as the background interference distribution features. For each single-frame image, local anisotropic filtering and local adaptive differential extraction are used to extract abnormal responses that are higher than the preset local noise floor, generating a single-frame defect point set as the defect feature.

3. The method for identifying defects in mobile phone camera glass based on visual inspection according to claim 2, characterized in that, The step of determining the background drift coverage range in the multi-frame image sequence based on the position and intensity changes of the background interference distribution characteristics between adjacent frames includes: Based on the high-reflectivity background binary mask, the grayscale intensity gradient field, and the background drift vector field, the spatial region occupied by the high-reflectivity background binary mask in each single frame image and its drift path between adjacent frames are determined. The area covered by the drift path and the area covered by the high-reflectivity background binary mask after it expands or contracts during the drift process are jointly determined as the background drift coverage range.

4. The method for identifying defects in mobile phone camera glass based on visual inspection according to claim 2, characterized in that, The step of associating the defect features across frames according to their physical spatial locations to generate a defect tracking sequence includes: For each frame of image, perform connected component analysis on the set of defect points to obtain the defect connected component, and calculate the geometric centroid coordinates and defect morphology features of each defect connected component. Starting with the geometric centroid coordinates of the defect connected region corresponding to the first frame image in the multi-frame image sequence, a search is performed according to a preset physical space neighborhood search radius. Defect connected regions in subsequent single-frame images whose morphological similarity to the defect morphological features of the first frame image exceeds a preset morphological similarity threshold are grouped into the same temporal trajectory chain to obtain the defect tracking sequence.

5. The method for identifying defects in mobile phone camera glass based on visual inspection according to claim 1, characterized in that, The step of calculating the assumed location of the defect in the missing frame based on the physical spatial locations of the defect features in the nearest non-missing frame before and after the missing frame includes: The physical spatial location of the defect feature is extracted from the nearest non-missing frame before the missing frame and the nearest non-missing frame after the missing frame. The theoretical sub-pixel spatial location of the defect feature corresponding to the missing frame is calculated using linear interpolation and used as the assumed defect location.

6. The method for identifying defects in mobile phone camera glass based on visual inspection according to claim 2, characterized in that, Before the step of marking the missing frame as having background drift coverage loss if the assumed defect location falls within the background drift coverage area, and otherwise marking it as having random noise loss, the method further includes: A multi-scale local neighborhood window is constructed with the assumed defect location as the center. The neighborhood background coverage ratio is calculated from the high-reflectivity background binary mask. The cumulative increase in neighborhood light intensity is calculated from the gray-scale intensity gradient field. The crossing direction of the high-reflectivity background core region relative to the multi-scale local neighborhood window before and after the missing frame is extracted from the background drift vector field. If the neighborhood background coverage ratio and the neighborhood light intensity increase cumulative amount are both higher than their respective preset upper limit thresholds, and the crossing direction points to the assumed defect location, then the missing frame is marked as a background drift coverage missing frame; otherwise, it is marked as a suspected background occlusion frame.

7. The method for identifying defects in mobile phone camera glass based on visual inspection according to claim 6, characterized in that, The step of marking the missing frame as having background drift coverage missing if the assumed location of the defect falls within the background drift coverage area, and otherwise marking it as having random noise missing, includes: If the missing frame is marked as suspected background occlusion and the location of the defect is assumed to fall within the background drift coverage area, then the missing frame is remarked as background drift coverage missing; otherwise, it is remarked as random noise missing.

8. The method for identifying defects in mobile phone camera glass based on visual inspection according to claim 1, characterized in that, The step of performing position correction and feature reconstruction on the missing frames marked as having background drift coverage defects to generate a defect evidence chain includes: Extract the physical spatial location of the defect feature and the gray-level energy distribution feature reflecting the gray-level distribution of the original image data of the missing frame from the nearest non-missing frame before the missing frame and the nearest non-missing frame after the missing frame. Calculate the final defect location of the missing frame based on the physical spatial location of the defect feature and the gray-level energy distribution feature. In the original image data of the missing frame, a local analysis region is defined with the final position of the defect as the center. A fitting surface is constructed to describe the background brightness distribution pattern of the local analysis region due to the non-uniform distribution of background brightness caused by the reflection of the coating interface. The background brightness value corresponding to the fitting surface is subtracted from the original brightness value of the local analysis region to obtain the residual image after stripping the bright background. Defect residual features are extracted from the residual image, and the defect residual features are filled in by assigning values ​​based on the defect features in the nearest non-missing frame before the missing frame and the nearest non-missing frame after the missing frame. Based on the final location of the defect and the associated storage of the defect residual features after assignment and completion, the defect evidence chain is generated.

9. The method for identifying defects in mobile phone camera glass based on visual inspection according to claim 8, characterized in that, The step of outputting the defect detection results including the defect evidence chain includes: The comprehensive confidence score of the defect evidence chain is calculated based on the proportion of the missing frames to the total number of frames and the similarity between the defect residual features after assignment and completion and the defect features. The output includes the defect evidence chain and the comprehensive confidence score, representing the defect detection result.

10. A visual inspection-based mobile phone camera glass defect identification system, used to execute the visual inspection-based mobile phone camera glass defect identification method as described in any one of claims 1 to 9, characterized in that, The system includes: The feature extraction module is used to obtain the background interference distribution features and defect features of the camera glass of the mobile phone under test in a series of continuously acquired multi-frame images; The background drift coverage determination module is used to determine the background drift coverage range in the multi-frame image sequence based on the position and intensity changes of the background interference distribution characteristics between adjacent frames; The cross-frame tracking module is used to associate the defect features across frames according to their physical spatial locations, generate a defect tracking sequence, and mark single-frame images in the multi-frame image sequence that do not detect defect features that match the defect tracking sequence as missing frames, and single-frame images that detect defect features that match the defect tracking sequence as non-missing frames. The missing frame classification module is used to calculate the defect hypothesis position of the missing frame based on the physical spatial position of the defect feature in the nearest non-missing frame before the missing frame and the nearest non-missing frame after the missing frame. If the defect hypothesis position falls within the background drift coverage range, the missing frame is marked as background drift coverage missing; otherwise, it is marked as random noise missing. The evidence completion and output module is used to perform position correction and feature reconstruction on the missing frames marked as missing due to background drift coverage, generate a defect evidence chain, and output the defect detection result including the defect evidence chain.