A mobile phone curved glass cover plate detection method, device and electronic equipment

By matching and correcting the distortion of images on the curved glass cover of mobile phones, combined with a pre-trained model, the problem of low detection efficiency was solved, and efficient and accurate defect identification was achieved.

CN121120657BActive Publication Date: 2026-03-03GUIZHOU UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511676579.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-17
Publication Date
2026-03-03
Estimated Expiration
2045-11-17

AI Technical Summary

Technical Problem

Existing technologies for inspecting curved glass covers for mobile phones involve large computational loads and cumbersome processing steps, resulting in low inspection efficiency and failing to meet the real-time inspection requirements of high-speed production lines.

Method used

By acquiring an image of the target glass cover and matching it with a standard image, suspicious areas are identified. Distortion correction and fine matching are performed on curved parts. Combined with a pre-trained defect recognition model, the detection range is narrowed down, and detection efficiency is improved.

Benefits of technology

It significantly improves the efficiency and accuracy of mobile phone glass cover inspection, can quickly locate defective areas, reduce misjudgments and missed detections, and meet the real-time inspection needs of rapid production lines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121120657B_ABST
    Figure CN121120657B_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, and electronic device for detecting curved glass covers of mobile phones, which improves the efficiency of mobile phone glass cover detection. The method includes: acquiring a first image of a target glass cover; matching the first image with a second image to determine a first suspicious region in the first image, where the second image is an image corresponding to a standard glass cover; determining whether there is a portion distributed along the curved edge of the target glass cover within the first suspicious region; if so, correcting the distortion of the curved edge portion of the first image to obtain a third image; matching the third image with a fourth image to determine a second suspicious region in the third image, where the fourth image is a corrected image corresponding to the curved edge portion of the second image; updating the first suspicious region based on the second suspicious region to obtain a target suspicious region; and inputting the target suspicious region into a pre-trained defect recognition model to determine the true defect region.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of glass cover testing technology, and in particular to a method, apparatus and electronic device for testing curved glass covers of mobile phones. Background Technology

[0002] As the functions of smart terminal devices continue to improve, the quality requirements for glass covers are also increasing. Surface defect detection, as a crucial step in ensuring product quality, has received widespread attention. Existing technologies typically employ image acquisition equipment to obtain images of the target glass cover and compare these images with images of a standard glass cover, determining the location of defects based on the differences between the images. This image-matching-based defect detection method can accurately identify abnormal areas on the target glass cover, providing important data for subsequent quality control.

[0003] However, with the increasing complexity of glass cover designs, especially those incorporating curved edges and irregular shapes, traditional image matching and defect detection processes face challenges such as high computational demands and cumbersome processing steps, resulting in low overall detection efficiency. Specifically, processes such as pixel-by-pixel comparison, grayscale difference determination, and defect region extraction consume significant computational resources and involve lengthy detection times. This not only limits the production capacity of inspection equipment but also hinders the ability to meet the real-time inspection needs of fast production lines. Summary of the Invention

[0004] This application provides a method, apparatus, and electronic device for detecting curved glass covers of mobile phones, which can improve the efficiency of mobile phone glass cover detection.

[0005] The first aspect of this application provides a method for testing curved glass covers for mobile phones, including:

[0006] Acquire the first image of the target glass cover;

[0007] The first image is matched with the second image to determine the first suspicious area in the first image, and the second image is the image corresponding to the standard glass cover.

[0008] Determine whether there are curved portions distributed along the edge of the target glass cover in the first suspicious area;

[0009] If so, then the distortion of the curved parts of the first image is corrected to obtain the third image;

[0010] The third image is matched with the fourth image to determine the second suspicious region in the third image, and the fourth image is the corrected image corresponding to the curved part of the second image;

[0011] The first suspicious area is updated based on the second suspicious area to obtain the target suspicious area;

[0012] The target suspicious area is input into a pre-trained defect recognition model to determine the real defect area.

[0013] Optionally, matching the first image with the second image to determine a first suspicious region in the first image includes:

[0014] Calculate the first grayscale difference between the first image and the second image pixel by pixel;

[0015] The first suspicious area is determined based on the first grayscale difference.

[0016] Optionally, determining the first suspicious region based on the first grayscale difference includes:

[0017] The first grayscale difference is compared with a preset first threshold to identify suspicious pixels;

[0018] Connect adjacent suspicious pixels to obtain the first suspicious region.

[0019] Optionally, determining whether there is a portion distributed along the curved edge of the target glass cover in the first suspicious area includes:

[0020] The straight-face region and curved-edge region of the first image are determined based on the second image;

[0021] Determine whether the first suspicious region exists in the curved edge region of the first image.

[0022] Optionally, the distortion correction of the curved portion of the first image to obtain the third image includes:

[0023] Retrieve the pre-stored correction equation;

[0024] The distortion of the curved portion of the first image is corrected according to the correction equation to obtain the third image.

[0025] Optionally, before obtaining the pre-stored correction equation, the method further includes:

[0026] Based on the shape of the standard glass cover, a full frontal scan of the standard glass cover is performed to obtain a fifth image;

[0027] The straight-face region and curved-edge region of the fifth image are determined based on the second image;

[0028] The curved edge regions of the first image and the fifth image are segmented to obtain the corresponding sixth image and second image;

[0029] The correction equation is calculated based on the sixth and second images.

[0030] Optionally, matching the third image with the fourth image to determine the second suspicious region in the third image includes:

[0031] Calculate the second grayscale difference between the third image and the fourth image pixel by pixel;

[0032] The second grayscale difference is compared with a preset second threshold to identify suspicious pixels;

[0033] Connect adjacent suspicious pixels to obtain the second suspicious region.

[0034] The second aspect of this application provides a mobile phone curved glass cover detection device, comprising:

[0035] The acquisition unit is used to acquire a first image of the target glass cover.

[0036] The first matching unit is used to match the first image with the second image to determine a first suspicious area in the first image, wherein the second image is an image corresponding to a standard glass cover.

[0037] The judgment unit is used to determine whether there is a portion distributed on the curved edge of the target glass cover in the first suspicious area;

[0038] A correction unit is used to correct the distortion of the curved edge portion of the first image when the judgment unit determines that there is a portion of the curved edge distributed on the target glass cover in the first suspicious area, so as to obtain a third image;

[0039] The second matching unit is used to match the third image with the fourth image to determine the second suspicious region in the third image, wherein the fourth image is the corrected image corresponding to the curved edge portion of the second image;

[0040] An update unit is used to update the first suspicious area based on the second suspicious area to obtain the target suspicious area;

[0041] The determination unit is used to input the target suspicious area into a pre-trained defect recognition model to determine the real defect area.

[0042] Optionally, the first matching unit includes:

[0043] The calculation module is used to calculate the first grayscale difference between the first image and the second image pixel by pixel;

[0044] The determination module is used to determine the first suspicious area based on the first grayscale difference.

[0045] Optionally, the determining module is specifically used for:

[0046] The first grayscale difference is compared with a preset first threshold to identify suspicious pixels;

[0047] Connect adjacent suspicious pixels to obtain the first suspicious region.

[0048] Optionally, the determination unit is specifically used for:

[0049] The straight-face region and curved-edge region of the first image are determined based on the second image;

[0050] Determine whether the first suspicious region exists in the curved edge region of the first image.

[0051] Optionally, the correction unit is specifically used for:

[0052] Retrieve the pre-stored correction equation;

[0053] The distortion of the curved portion of the first image is corrected according to the correction equation to obtain the third image.

[0054] Optionally, the device further includes a computing unit, the computing unit being used for:

[0055] Based on the shape of the standard glass cover, a full frontal scan of the standard glass cover is performed to obtain a fifth image;

[0056] The straight-face region and curved-edge region of the fifth image are determined based on the second image;

[0057] The curved edge regions of the first image and the fifth image are segmented to obtain the corresponding sixth image and second image;

[0058] The correction equation is calculated based on the sixth and second images.

[0059] Optionally, the second matching unit is specifically used for:

[0060] Calculate the second grayscale difference between the third image and the fourth image pixel by pixel;

[0061] The second grayscale difference is compared with a preset second threshold to identify suspicious pixels;

[0062] Connect adjacent suspicious pixels to obtain the second suspicious region.

[0063] A third aspect of this application provides an electronic device, comprising:

[0064] Processor, memory, input / output units, and bus;

[0065] The processor is connected to the memory, the input / output unit, and the bus;

[0066] The memory stores a program, and the processor calls the program to execute the method of the first aspect and any possible implementation of the first aspect.

[0067] The fourth aspect of this application provides a computer-readable storage medium storing a program that, when executed on a computer, causes the computer to perform the methods of the first aspect and any possible implementation thereof.

[0068] As can be seen from the above technical solutions, this application has the following advantages:

[0069] In this embodiment, by matching the first image and the second image, the first suspicious region is quickly identified. Distortion correction and fine-tuning are performed on curved areas to update the target suspicious region, significantly narrowing the detection range. Combined with a pre-trained defect recognition model, efficient and accurate identification of real defects is achieved, which helps improve the efficiency of mobile phone glass cover inspection. Attached Figure Description

[0070] Figure 1 This is a flowchart illustrating one embodiment of the mobile phone curved glass cover detection method in this application;

[0071] Figure 2 This is a flowchart illustrating one embodiment of determining the first suspicious region in this application;

[0072] Figure 3 This is a flowchart illustrating an embodiment of determining whether a portion distributed along the curved edge of the target glass cover exists in the first suspicious area in this application.

[0073] Figure 4 This is a flowchart illustrating an embodiment of distortion correction for the curved portion of the first image in this application.

[0074] Figure 5 This is a schematic flowchart of one embodiment of calculating the correction equation in this application;

[0075] Figure 6 This is a flowchart illustrating one embodiment of determining a second suspicious region in this application;

[0076] Figure 7 This is a schematic diagram of the structure of one embodiment of the mobile phone curved glass cover detection device in this application;

[0077] Figure 8 This is a schematic diagram of the structure of one embodiment of the electronic device in this application. Detailed Implementation

[0078] This application provides a method, apparatus, and electronic device for detecting curved glass covers of mobile phones, which can improve the detection efficiency of mobile phone glass covers.

[0079] The method of this application can be applied to servers, terminals, or other devices with logical processing capabilities; therefore, this application does not limit its application. For ease of description, the following description uses a terminal as the executing entity.

[0080] The embodiments of this application will now be described with reference to the accompanying drawings.

[0081] Please see Figure 1 , Figure 1 An embodiment of the mobile phone curved glass cover plate testing method provided in this application includes:

[0082] 101. Obtain the first image of the target glass cover;

[0083] The target glass cover is securely fixed in the preset detection position to ensure stability and consistent posture during the imaging process, avoiding image content deviation due to positional changes. The terminal acquires the first image from the target camera. This first image is captured from a frontal view, covering the entire glass cover, including key edges and curved areas. The terminal ensures that the acquired first image has sufficient sharpness and contrast, especially at the edges and curved parts of the glass cover, as defects in these areas are difficult to detect and are easily affected by imaging distortion. High-quality image acquisition is a prerequisite for subsequent accurate defect identification; the terminal guarantees that the first image contains complete details and accurate visual information.

[0084] 102. Match the first image with the second image to determine the first suspicious area in the first image, and the second image is the image corresponding to the standard glass cover.

[0085] The terminal matches a first image of the target glass cover with a corresponding second image of the standard glass cover. The matching process compares pixels one by one to locate the areas of difference between the two images. This process reveals areas in the target glass cover that do not match the standard image, thus identifying the first suspicious area. The first suspicious area is typically a potential defect area, which may manifest as anomalies in grayscale, texture, or structure. The terminal uses this area to filter out key locations for further analysis, reducing the computational burden of subsequent processing.

[0086] 103. Determine whether there are curved parts distributed on the target glass cover in the first suspicious area; if so, proceed to step 104.

[0087] The terminal analyzes the spatial distribution of the first suspicious area to determine whether it covers the curved edge of the target glass cover. Due to their curved shape and unique viewing angle, curved edges often exhibit strong distortion and deformation in images, leading to potential misjudgments during defect detection. This step, through spatial analysis, helps distinguish between curved and non-curved suspicious areas, allowing for the application of special processing methods for curved sections. If the first suspicious area involves a curved area, the terminal immediately executes step 104 to perform distortion correction, ensuring the accuracy of subsequent defect identification.

[0088] 104. Correct the distortion of the curved parts of the first image to obtain the third image;

[0089] The terminal performs distortion correction on the curved areas in the first image. This correction uses pre-calibrated parameters and algorithms to correct the geometric deformation of the curved areas, eliminating image distortion caused by the curved surface of the glass cover and the shooting angle. Through correction, the image of the curved areas is restored to a planar shape that is closer to the actual physical form. The corrected image is called the third image. The third image is more accurate in geometric information, which is beneficial to improving the accuracy of subsequent matching and defect analysis.

[0090] 105. Match the third image with the fourth image to determine the second suspicious region in the third image, and the fourth image is the corrected image corresponding to the curved part of the second image;

[0091] The terminal matches the distortion-corrected third image with the corresponding fourth image. The fourth image is the result of the same correction process applied to the curved edge portion of the second image of the standard glass cover. By comparing the third and fourth images, the terminal can accurately identify the second suspicious area within the curved edge region, further focusing and refining the specific location of the defect. This matching process overcomes the errors caused by the complex shape of the curved edge portion, improving the accuracy and reliability of curved edge defect detection.

[0092] 106. Update the first suspicious area based on the second suspicious area to obtain the target suspicious area;

[0093] The terminal uses the detection results of the second suspicious region to update and correct the first suspicious region. Specifically, the second suspicious region covers or replaces the corresponding curved edge portion of the first suspicious region, so that the overall suspicious region, while including both non-curved and curved edge defects, has higher spatial precision and accuracy. The updated region is called the target suspicious region, which has more comprehensive defect candidate information, providing more accurate input for the subsequent defect identification model and avoiding false positives and false negatives.

[0094] 107. Input the suspected target area into the pre-trained defect recognition model to determine the real defect area.

[0095] The terminal inputs the updated target suspicious area into a pre-trained defect identification model. This model, trained on a large amount of defect sample data, can deeply analyze image features within the target suspicious area, identify the true defect boundaries and properties, filter out false alarms and interference, and ultimately accurately determine the actual defect area on the glass cover. The defect detection results output by this model provide crucial data support for the quality control of glass covers.

[0096] Specifically, the defect identification model is based on a deep neural network with multimodal feature fusion, and includes three core sub-networks: a multi-scale feature extraction backbone network, a fine-grained defect attention enhancement module, and an adaptive suppression module for reflection interference.

[0097] The multi-scale feature extraction backbone network employs an improved ResNet-50 architecture, embedding deformable convolutional modules after its Conv3_x and Conv4_x layers. This allows the network to adaptively adjust the receptive field of the convolutional kernels, better adapting to the curved edge geometry of the phone's curved glass cover and the irregular shapes of minute defects. Simultaneously, the network integrates a feature pyramid structure, effectively fusing deep, strong semantic features with shallow, high-resolution detail features through top-down and lateral connections. This constructs a multi-scale feature map that combines semantic information and spatial detail, laying the foundation for subsequent detection of defects of different sizes.

[0098] The fine-grained defect attention enhancement module improves the model's sensitivity and localization accuracy for small, low-contrast defects. Its core is a coordinate attention mechanism, which decomposes channel attention along two vertical directions (height and width) in space, performing one-dimensional global pooling on each to generate a pair of orientation-aware feature maps. These two sets of feature maps are encoded and fused, then further decomposed into attention weight maps corresponding to height and width, respectively. Finally, these two weight maps are multiplied by the original input feature map, enabling the network to accurately focus on key defect-related regions in the feature map, thereby enhancing the response to small defects such as scratches and microbubbles. Building on this, a local response enhancement mechanism is introduced, which calculates the contrast within the local neighborhood and adaptively enhances the feature response accordingly, further amplifying the signal of small defects.

[0099] The adaptive reflection interference suppression module is specifically designed to address the pain point of reflection interference easily generated on glass cover surfaces. This module includes a lightweight branch running parallel to the backbone network, structured as a compact encoder-decoder network specifically for predicting the probability distribution map of reflective regions from the input image. The encoder employs depthwise separable convolutions to reduce computational overhead, while the decoder recovers spatial details through progressive upsampling combined with skip connections. After obtaining the reflection probability map, the module dynamically adjusts the weights of the corresponding feature maps in the backbone network using an adaptive feature gating mechanism to suppress feature responses identified as strongly reflective areas. For feature regions severely affected by reflection, a reconstruction algorithm based on neighborhood feature interpolation is also employed to recover the masked underlying texture information, effectively mitigating the negative impact of reflection on defect identification.

[0100] During the training phase, a large-scale, multi-scenario image dataset of curved glass cover plates for mobile phones is first constructed. This dataset contains over 100,000 high-resolution images (e.g., 2048x2048 pixels) acquired in real industrial production line environments, covering various lighting conditions, cover plates of different curvatures, and various typical defects, including but not limited to scratches, bubbles, impurities, and cracks. Furthermore, to improve the model's generalization ability, the dataset undergoes rigorous data cleaning and labeling before training. Comprehensive data augmentation is also employed, including random rotation, random brightness and contrast adjustment, Gaussian noise injection, random occlusion, and simulated glass reflection spot overlay, to approximate the complex real-world application environment.

[0101] The defect identification model is trained using an end-to-end multi-task collaborative learning paradigm. In the defect classification task, a dynamic hard sample mining loss function is employed, and the formula for calculating the classification loss is as follows:

[0102] Formula 1

[0103] Formula 2

[0104] in, This represents the model's predicted probability of the true class. Indicates the category balance weight; Indicates the dynamic modulation factor; For the current training cycle, Total training cycle; and These are the preset hyperparameters.

[0105] In the defect localization task, a curvilinear deformation consistency constraint loss is adopted. The calculation formula for the localization loss is as follows:

[0106] Formula 3

[0107] in, This represents the complete CIoU (Complete Cross-Union-Uniform) localization loss; This represents the offset of the i-th vertex of the bounding box predicted by the network relative to the reference position of its face region; This represents the theoretically expected deformation offset calculated based on the standard cover plate curved edge mathematical model; and The hyperparameter represents the balance between the two losses; It represents a very small constant used to ensure numerical stability;

[0108] The training process employs a four-stage progressive strategy. The optimizer used is AdamW, and a restartable cosine annealing learning rate scheduler is employed, which performs a learning rate reset operation at preset training epochs. The total training epochs are set to 200, and the batch size is set to 16 or 32 depending on the GPU memory.

[0109] Furthermore, during the model inference stage, an online adaptive fine-tuning mechanism can be introduced. The model deployed on the production line compares its detection results with the confirmation results of subsequent manual review. When specific types of misjudgments or missed judgments occur consecutively, these cases are automatically grouped into a micro-batch, and the final layer of the model is rapidly fine-tuned with an extremely low learning rate using a joint loss function.

[0110] In this embodiment, the terminal quickly identifies the first suspicious region by matching the first and second images. Distortion correction and fine-tuning are then performed on curved areas to update the target suspicious region, significantly narrowing the detection range. Combined with a pre-trained defect recognition model, the terminal achieves efficient and accurate identification of real defects, which helps improve the efficiency of mobile phone glass cover inspection.

[0111] Please see Figure 2 In some embodiments of this application, step 102 in the above embodiments, which matches the first image with the second image to determine the first suspicious region in the first image, may include the following steps:

[0112] 201. Calculate the first grayscale difference between the first image and the second image pixel by pixel;

[0113] The terminal calculates the grayscale value of each corresponding pixel position in the first and second images, and obtains the grayscale difference of each pair of pixels in the two images. This specifically reflects the change in pixel brightness of the target glass cover compared to the standard glass cover, ensuring that subtle abnormal changes can be captured.

[0114] 202. Compare the first grayscale difference with a preset first threshold to identify suspicious pixels;

[0115] The terminal compares the grayscale difference of each pixel obtained in step 201 with a preset first threshold. Only when the difference is greater than the threshold is the pixel determined as a suspicious pixel. This filters out low-amplitude grayscale differences caused by environmental noise or normal changes, thereby improving the accuracy of defect identification.

[0116] 203. Connect adjacent suspicious pixels to obtain the first suspicious region.

[0117] The terminal connects spatially adjacent suspicious pixels, merging these discrete pixels into a continuous region, forming the first suspicious region. This region represents a set of continuous pixels in the target glass cover that differ significantly from the standard glass cover, and serves as the focus of subsequent defect detection.

[0118] In this embodiment, the terminal calculates the grayscale difference pixel by pixel and filters pixels by combining the threshold. Finally, it merges adjacent suspicious pixels into a region, which effectively improves the accuracy of defect candidate region identification, reduces false positives and false negatives, and improves the efficiency and reliability of subsequent defect detection.

[0119] Please see Figure 3 In some embodiments of this application, step 103 in the above embodiments, determining whether there are curved portions distributed on the target glass cover in the first suspicious area, may include the following steps:

[0120] 301. Determine the straight-sided region and curved-edge region of the first image based on the second image;

[0121] Based on the known structural information of the standard glass cover in the second image, the terminal analyzes and marks the corresponding regions in the first image, clearly distinguishing between flat and curved areas. Specifically, the terminal locates and divides the curved parts in the second image, mapping them to their positions in the first image to accurately determine the spatial distribution range of the curved parts in the first image. At the same time, it identifies the remaining areas as flat areas, providing a basis for regional difference processing in subsequent defect detection.

[0122] 302. Determine whether the first suspicious region contains a curved edge region in the first image.

[0123] The terminal overlays and compares the first suspicious area with the curved edge area defined in step 301, and analyzes pixel by pixel whether the pixels in the first suspicious area fall within the curved edge area. If there are pixels distributed in the curved edge area, the terminal determines that the first suspicious area contains the curved edge part, and will subsequently take targeted processing such as distortion correction for this part to ensure detection accuracy and completeness.

[0124] In this embodiment, the terminal accurately divides the straight and curved areas of the first image by analyzing the spatial structure of the standard glass cover image, and determines whether the first suspicious area contains curved parts. This improves the ability to identify and process special curved areas during defect detection, significantly improves the detection accuracy and the targeting of subsequent processing, thereby improving the efficiency and reliability of overall defect detection.

[0125] Please see Figure 4 In some embodiments of this application, step 104 in the above embodiments, which corrects the distortion of the curved edge portion of the first image to obtain the third image, may include the following steps:

[0126] 401. Obtain the pre-stored correction equation;

[0127] The terminal retrieves a pre-stored correction equation from memory for correcting distortion in curved areas. This equation is designed based on the geometric features and optical properties of a standard glass cover plate, providing mathematical model support for subsequent image correction of curved areas.

[0128] The specific form of the correction equation is a mathematical model based on a control point grid and a bivariate polynomial mapping. This equation defines the coordinates of the distorted image. To the corrected image coordinates The transformation relationship.

[0129] The correction equation is as follows:

[0130]

[0131]

[0132] in, The input coordinates represent the coordinates of a pixel in the curved part of the first image that has been captured and is distorted. The output coordinates represent the ideal coordinates where the pixel should appear in the third image after correction, once the distortion has been eliminated. This represents a preset positive integer (e.g., n=3 or 5), which determines the complexity and fitting ability of the correction model. The higher the order, the better the model can fit complex distortions, but it also requires more computational resources. and This represents the mapping coefficient.

[0133] The correction equation is a coordinate mapping function. When using this equation, the coordinates of each pixel in the curved portion of the image to be corrected are... Substituting into the above equation, using the pre-determined coefficients and This allows us to calculate its correct position in the corrected image. This allows for the correction of geometric distortions.

[0134] 402. Based on the correction equation, the distortion of the curved part of the first image is corrected to obtain the third image.

[0135] The terminal uses the correction equation obtained in step 401 to perform an image distortion correction algorithm on the defined curved edge portion in the first image. It adjusts and remaps the pixel position and grayscale information in the region to correct the image distortion caused by the curved surface, and finally generates a third image after distortion correction, ensuring that the image information of the curved edge portion is accurate and reliable.

[0136] In this embodiment, the terminal corrects the distortion of the curved edge by calling the pre-stored correction equation, which effectively repairs the image deformation caused by the curved surface, improves the realism and clarity of the image in the curved edge area, provides an accurate image basis for subsequent defect identification, and improves the detection accuracy and overall efficiency.

[0137] Please see Figure 5 In some embodiments of this application, before obtaining the pre-stored correction equation in step 401 of the above embodiments, the mobile phone curved glass cover detection method may further include the following steps:

[0138] 501. Based on the shape of the standard glass cover, perform a full frontal scan of the standard glass cover to obtain the fifth image;

[0139] A robotic arm, controlled by a terminal control unit and working with a camera, scans a standard glass cover from multiple preset angles, gradually acquiring image data covering the entire front and edges of the cover. Through image stitching and fusion processing from these multi-angle acquisitions, a complete and high-resolution fifth image is generated. This scanning process ensures that details across all areas of the standard glass cover surface are captured, especially curved and edge regions, thus providing a detailed and accurate image information foundation for subsequent calculations of the correction equations.

[0140] 502. Determine the straight-sided region and curved-edge region of the fifth image based on the second image;

[0141] Based on the standard glass cover structure information already labeled in the second image, the terminal uses an image segmentation algorithm combined with edge detection and region labeling techniques to divide the fifth image into regions. Specifically, this involves analyzing the spatial coordinate relationship between curved and straight areas in the second image, mapping this information to the fifth image, accurately identifying and distinguishing between straight and curved areas in the fifth image, and generating region masks or annotation maps to facilitate subsequent processing measures for different regions.

[0142] 503. Segment the curved edge regions of the first image and the fifth image respectively to obtain the corresponding sixth image and second image;

[0143] Based on the region segmentation information generated in step 502, the terminal locates and segments the corresponding curved edge region in the first image, extracting it to form the sixth image; simultaneously, it extracts the corresponding curved edge region in the fifth image using the same region segmentation method, obtaining the second image. This step ensures that the image content contained in the sixth image and the second image corresponds to each other and centrally reflects the image information of the curved edge portion of the glass cover under test and the standard glass cover, providing consistent image input for accurate correction.

[0144] 504. Calculate the correction equation based on the sixth and second images.

[0145] The terminal extracts the spatial coordinates and grayscale information of corresponding pixels in the curved regions of the sixth and second images, aligns them using image registration methods, and constructs a pixel mapping relationship by analyzing the pixel position offset caused by surface deformation in the curved regions. Specific implementations may include using polynomial fitting, spline interpolation, or a reverse mapping method based on a camera distortion model to establish the correction equation. For example, the terminal can use the dot matrix coordinate data collected by the calibration plate, combined with the surface features of a standard glass cover plate, to calculate the distortion parameters of the curved regions using a radial distortion model, thereby generating a correction function. Alternatively, the terminal can use a feature point-based registration algorithm to identify multiple corresponding feature point pairs in the curved regions and fit the surface distortion function using the least squares method. This correction equation accurately describes the spatial distortion characteristics of the curved parts of the first image, ensuring that subsequent correction operations on the curved images achieve pixel-level position correction and restore the true shape of the curved regions.

[0146] In this embodiment, the terminal performs a comprehensive and detailed frontal scan of the standard glass cover plate. Combined with the region division of the standard image, it accurately segments and matches the curved areas in the first image and the standard image. Multiple advanced image registration and distortion modeling methods are used to calculate precise correction equations, effectively correcting image distortion caused by the curved surface and improving the spatial consistency and clarity of the curved areas. This precise distortion correction greatly enhances the accuracy and efficiency of subsequent defect identification, ensuring the reliability and stability of the detection results.

[0147] Please see Figure 6 In some embodiments of this application, step 105 in the above embodiments, which matches the third image with the fourth image to determine the second suspicious region in the third image, may include the following steps:

[0148] 601. Calculate the second grayscale difference between the third and fourth images pixel by pixel;

[0149] The terminal calculates the grayscale value of each corresponding pixel position in the first and second images, and obtains the grayscale difference of each pair of pixels in the two images. This specifically reflects the change in pixel brightness of the target glass cover compared to the standard glass cover, ensuring that subtle abnormal changes can be captured.

[0150] 602. Compare the second grayscale difference with a preset second threshold to identify suspicious pixels;

[0151] The terminal compares the grayscale difference of each pixel obtained in step 201 with a preset first threshold. Only when the difference is greater than the threshold is the pixel determined as a suspicious pixel. This filters out low-amplitude grayscale differences caused by environmental noise or normal changes, thereby improving the accuracy of defect identification.

[0152] It should be noted that the preset first threshold and the preset second threshold are generally different values. Since the second suspicious area corresponds to the curved edge, the grayscale changes are more complex and are greatly affected by the surface distortion. The terminal selects a second threshold that is different from that of the first suspicious area (the straight area) for comparison.

[0153] 603. Connect adjacent suspicious pixels to obtain the second suspicious region.

[0154] The terminal connects spatially adjacent suspicious pixels, merging these discrete pixels into a continuous region, forming the first suspicious region. This region represents a set of continuous pixels in the target glass cover that differ significantly from the standard glass cover, and serves as the focus of subsequent defect detection.

[0155] In this embodiment, the terminal uses a different grayscale threshold for curved areas than for straight areas, fully considering the special characteristics of lighting and deformation in curved areas, thereby improving the accuracy and robustness of defect identification in the second suspicious area, effectively reducing false positives and false negatives, and improving overall detection efficiency and reliability.

[0156] Please see Figure 7 , Figure 7 One embodiment of the mobile phone curved glass cover detection device provided in this application includes:

[0157] Acquisition unit 701 is used to acquire a first image of the target glass cover plate;

[0158] The first matching unit 702 is used to match the first image with the second image to determine the first suspicious area in the first image, and the second image is the image corresponding to the standard glass cover.

[0159] The judgment unit 703 is used to determine whether there are curved parts distributed on the target glass cover in the first suspicious area;

[0160] The correction unit 704 is used to correct the distortion of the curved edge portion of the first image when the judgment unit determines that there is a portion of the curved edge distributed in the target glass cover in the first suspicious area, so as to obtain a third image.

[0161] The second matching unit 705 is used to match the third image with the fourth image to determine the second suspicious region in the third image, and the fourth image is the corrected image corresponding to the curved part of the second image;

[0162] Update unit 706 is used to update the first suspicious area based on the second suspicious area to obtain the target suspicious area;

[0163] The determination unit 707 is used to input the target suspicious area into the pre-trained defect recognition model in order to determine the real defect area.

[0164] Optionally, the first matching unit includes:

[0165] The calculation module is used to calculate the first grayscale difference between the first image and the second image pixel by pixel;

[0166] The determination module is used to determine the first suspicious area based on the first grayscale difference.

[0167] Optionally, determine the specific use of the module for:

[0168] The first grayscale difference is compared with a preset first threshold to identify suspicious pixels.

[0169] Connect adjacent suspicious pixels to obtain the first suspicious region.

[0170] Optionally, the decision unit is specifically used for:

[0171] The straight-face region and curved-edge region of the first image are determined based on the second image;

[0172] Determine whether the first suspicious region contains curved edge regions in the first image.

[0173] Optionally, the correction unit is specifically used for:

[0174] Retrieve the pre-stored correction equation;

[0175] The distortion of the curved parts of the first image is corrected according to the correction equation to obtain the third image.

[0176] Optionally, the device further includes a computing unit, which is used for:

[0177] Based on the shape of the standard glass cover, a full frontal scan of the standard glass cover is performed to obtain the fifth image;

[0178] The straight-face region and curved-edge region of the fifth image are determined based on the second image;

[0179] The curved edge regions of the first image and the fifth image are segmented to obtain the corresponding sixth image and second image;

[0180] The correction equation is calculated based on the sixth and second images.

[0181] Optionally, the second matching unit is specifically used for:

[0182] Calculate the second grayscale difference between the third and fourth images pixel by pixel;

[0183] The second grayscale difference is compared with a preset second threshold to identify suspicious pixels.

[0184] Connect adjacent suspicious pixels to obtain the second suspicious region.

[0185] In this implementation, the functions of each unit and module are as described above. Figures 1 to 6 The steps in the illustrated embodiments are the same and will not be repeated here.

[0186] Please see Figure 8 , Figure 8 One embodiment of the electronic device provided in this application includes:

[0187] Processor 801, memory 802, input / output unit 803, and bus 804;

[0188] The processor 801 is connected to the memory 802, the input / output unit 803, and the bus 804;

[0189] The memory 802 stores a program, which the processor 801 calls to execute. Figures 1 to 6 The steps in the illustrated embodiment.

[0190] In this embodiment, the function of processor 801 is the same as described above. Figures 1 to 6 The steps in the illustrated embodiments are the same and will not be repeated here.

[0191] This application also provides a computer-readable storage medium on which a program is stored. When the program is executed on a computer, it causes the computer to perform the aforementioned actions. Figures 1 to 6 The method in any possible implementation.

[0192] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0193] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.

[0194] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0195] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0196] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A method for detecting curved glass covers for mobile phones, characterized in that, include: Acquire the first image of the target glass cover; The first image is matched with the second image to determine the first suspicious area in the first image, and the second image is the image corresponding to the standard glass cover. Determine whether there are curved portions distributed along the edge of the target glass cover in the first suspicious area; If so, then the distortion of the curved parts of the first image is corrected to obtain the third image; The third image is matched with the fourth image to determine the second suspicious region in the third image, and the fourth image is the corrected image corresponding to the curved part of the second image; The first suspicious area is updated based on the second suspicious area to obtain the target suspicious area; The suspected target region is input into a pre-trained defect identification model to determine the real defect region; wherein, the defect identification model is a deep neural network based on multimodal feature fusion, which includes three core sub-networks, namely a multi-scale feature extraction backbone network, a fine-grained defect attention enhancement module, and a reflective interference adaptive suppression module; The process of correcting the distortion of the curved portion of the first image to obtain the third image includes: Retrieve the pre-stored correction equation; The distortion of the curved portion of the first image is corrected according to the correction equation to obtain the third image; Before obtaining the pre-stored correction equation, the method further includes: Based on the shape of the standard glass cover, a full frontal scan of the standard glass cover is performed to obtain a fifth image; The straight-face region and curved-edge region of the fifth image are determined based on the second image; The curved edge regions of the first image and the fifth image are segmented to obtain the corresponding sixth image and second image; Calculate the correction equation based on the sixth and second images; The step of matching the third image with the fourth image to determine the second suspicious region in the third image includes: Calculate the second grayscale difference between the third image and the fourth image pixel by pixel; The second grayscale difference is compared with a preset second threshold to identify suspicious pixels; Connect adjacent suspicious pixels to obtain the second suspicious region.

2. The method according to claim 1, characterized in that, The step of matching the first image with the second image to determine a first suspicious region in the first image includes: Calculate the first grayscale difference between the first image and the second image pixel by pixel; The first suspicious area is determined based on the first grayscale difference.

3. The method according to claim 2, characterized in that, The step of determining the first suspicious region based on the first grayscale difference includes: The first grayscale difference is compared with a preset first threshold to identify suspicious pixels; Connect adjacent suspicious pixels to obtain the first suspicious region.

4. The method according to claim 1, characterized in that, The determination of whether there is a curved portion distributed on the target glass cover in the first suspicious area includes: The straight-face region and curved-edge region of the first image are determined based on the second image; Determine whether the first suspicious region exists in the curved edge region of the first image.

5. A mobile phone curved glass cover detection device, characterized in that, include: The acquisition unit is used to acquire a first image of the target glass cover. The first matching unit is used to match the first image with the second image to determine a first suspicious area in the first image, wherein the second image is an image corresponding to a standard glass cover. The judgment unit is used to determine whether there is a portion distributed on the curved edge of the target glass cover in the first suspicious area; A correction unit is used to correct the distortion of the curved edge portion of the first image when the judgment unit determines that there is a portion of the curved edge distributed on the target glass cover in the first suspicious area, so as to obtain a third image; The second matching unit is used to match the third image with the fourth image to determine the second suspicious region in the third image, wherein the fourth image is the corrected image corresponding to the curved edge portion of the second image; An update unit is used to update the first suspicious area based on the second suspicious area to obtain the target suspicious area; The determination unit is used to input the target suspicious area into a pre-trained defect recognition model to determine the real defect area; wherein, the defect recognition model is a deep neural network based on multimodal feature fusion, which includes three core sub-networks, namely a multi-scale feature extraction backbone network, a fine-grained defect attention enhancement module, and a reflective interference adaptive suppression module; The correction unit is specifically used for: Retrieve the pre-stored correction equation; The distortion of the curved portion of the first image is corrected according to the correction equation to obtain the third image; The device further includes a computing unit, the computing unit being used for: Based on the shape of the standard glass cover, a full frontal scan of the standard glass cover is performed to obtain a fifth image; The straight-face region and curved-edge region of the fifth image are determined based on the second image; The curved edge regions of the first image and the fifth image are segmented to obtain the corresponding sixth image and second image; Calculate the correction equation based on the sixth and second images; The second matching unit is specifically used for: Calculate the second grayscale difference between the third image and the fourth image pixel by pixel; The second grayscale difference is compared with a preset second threshold to identify suspicious pixels; Connect adjacent suspicious pixels to obtain the second suspicious region.

6. An electronic device, characterized in that, include: Processor, memory, input / output units, and bus; The processor is connected to the memory, the input / output unit, and the bus; The memory stores a program, and the processor calls the program to execute the method as described in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium contains a program that, when executed on a computer, causes the computer to perform the method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Method for detecting edge visual defects of smartphone glass cover plate

    CN110567965A

  • Mobile phone glass cover plate defect detection method, system and equipment and storage medium

    CN119417836A