Mobile phone rear cover defect automatic detection method and system based on machine vision
Through machine vision technology, gradient prior separation and image fusion of background layer and reflective layer are used, combined with defect detection model, the detection stagnation problem caused by reflection of glass back cover is solved, and efficient automatic detection is achieved.
Patent Information
- Application Number
- CN202510637603.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-08-15
AI Technical Summary
In the prior art, the reflective characteristics of the back cover of the mobile phone glass lead to low defect detection efficiency and serious detection stagnation.
Through a machine vision-based method, multiple images are taken and pre-processed, and different gradient priors are separated by the edges of the background layer and the reflective layer. Combined with image fusion and a pre-established defect detection model, automated detection of the back cover of the mobile phone is achieved.
It effectively reduces the reflection effect of the mobile phone glass back cover, improves detection efficiency and accuracy, and realizes automatic detection of the mobile phone back cover.
Smart Images

Figure CN120495260A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of mobile phone back cover detection, and more particularly, to a method and system for automatically detecting defects in mobile phone back covers based on machine vision. Background Art
[0002] There are many types of mobile phone back covers. Back covers made of different materials have their own characteristics in texture, performance, appearance, etc. The following are some common types of mobile phone back covers: glass back cover, metal back cover, plastic back cover and plain leather back cover, etc.
[0003] Among them, because the glass back cover has excellent transparency and glossiness, it can reflect different colors, has a crystal clear appearance, and has a high-end visual effect; it has high hardness, is wear-resistant and scratch-resistant; it has no interference with mobile phone signals and wireless charging magnetic fields, and can support wireless charging functions. For this reason, it is also favored by the market and is also the mainstream material for mobile phone back covers in the current market.
[0004] For example, the Chinese invention patent with the patent number 201810586372.5, entitled "A method for manufacturing a mobile phone glass back cover," discloses the following steps: coating and curing a layer of transparent resin that completely covers the plain glass on the upper surface of the plain glass to obtain a protective photoresist layer; depositing a metal film on the upper surface of the protective photoresist layer by vacuum sputtering; forming a transition photoresist layer on the upper surface of the metal film; etching away the portion of the metal film exposed outside the transition photoresist layer using an etching solution; peeling off the transition photoresist layer; and printing and curing an ink that completely covers the protective photoresist layer and the metal film to obtain a substrate. Before vacuum sputtering on the plain glass, a layer of transparent resin is first cured on the plain glass to obtain a protective photoresist layer, which greatly improves the strength of the glass back cover. The metal film is firmly attached to the protective photoresist layer to avoid interlayer separation. The transition photoresist layer is then used to assist in etching the metal film vacuum-sputtered on the glass back cover, so that the coating appearance can be designed in any shape. This greatly improves the strength of the mobile phone glass back cover, making the glass less likely to break when dropped.
[0005] Although mobile phone glass back covers are highly favored by the market due to their product strength, due to the characteristics of the glass inside the mobile phone glass back covers, during the defect detection process, the reflection characteristics of the glass often cause the inspection of mobile phone glass back covers to fail, resulting in low inspection efficiency. Summary of the Invention
[0006] In view of the above-mentioned deficiencies in the prior art, the first object of the present invention is to provide a method and system for automatic detection of defects in the back cover of a mobile phone based on machine vision, so as to realize automated detection of the back cover of the mobile phone and reduce the impact of detection delays caused by the reflection effect when shooting the glass back cover of the mobile phone.
[0007] The first object of the present invention is achieved by the following technical solution: a method and system for automatically detecting defects in a mobile phone back cover based on machine vision, comprising the following steps:
[0008] S1: Take multiple images of the mobile phone's glass back cover and pre-process the images;
[0009] S2: Through the preprocessed image, the background layer and the reflective layer of the image are marked by using the different gradient priors of the edges of the background layer and the reflective layer, and the background layer and the reflective layer in the image are separated;
[0010] S3: Based on the background layer in the image, the images taken from multiple angles are superimposed and fused to obtain the real object picture;
[0011] S4: Based on the actual picture, the pre-established mobile phone back cover defect detection model is used to identify and detect defects in the actual picture to determine the quality of the mobile phone back cover.
[0012] Preferably, in a single image, multiple images are taken based on the same angle and different camera focal length depths. In the multiple images obtained, the background layer and the reflective layer show obvious differences. The background layer is separated and a new real-object photo is formed by superimposing the separated background layers.
[0013] Preferably, pre-processing the image comprises the following steps:
[0014] S101: Denoising, using a median filter algorithm to remove salt and pepper noise from the image by replacing the value of each pixel with the median value of its neighboring pixels;
[0015] S102: Improving image contrast: using histogram equalization technology to enhance the contrast of the image and redistributing the grayscale values of the image pixels to make the image details clearer.
[0016] Preferably, the further processing based on step S3 includes:
[0017] S201: Image registration. Before image fusion, background layer images taken at different angles or with different focal depths must be accurately registered to ensure that the same objects in the images are accurately aligned in space.
[0018] S202: Weight determination, using the clarity and stability of each background layer image as weight. Images that clearly present details of the phone's back cover are given a higher weight, so that they occupy a larger proportion in the fusion result. Stability is evaluated by calculating the motion vector of the pixel using an optical flow algorithm. A smaller motion vector indicates that the image was relatively stable during capture and is therefore given a higher weight.
[0019] S203: Image fusion. After completing image registration and weight determination, weighted average calculation is performed on the corresponding pixel points of the registered images to fuse the information of different images together to obtain new pixel values, and finally generate a complete real-object picture.
[0020] Preferably, based on a pre-established mobile phone back cover defect detection model, an image data set is built by taking images of the mobile phone glass back cover, and a large number of images of mobile phone glass back covers of different brands, models, and batches are collected, covering normal and various defective states. By adjusting the shooting angle, lighting conditions, and focal length, diverse image data is obtained.
[0021] Preferably, defect annotation is performed on the acquired image dataset, and the defect type and location in the image are marked with a rectangular frame or a polygonal frame, and assigned corresponding labels to form an annotated dataset for training a mobile phone back cover defect detection model.
[0022] Preferably, the defect types of the mobile phone glass back cover include scratches, cracks, bubbles, impurities and chipped corners, and classification statistics are performed based on different types of defect types.
[0023] The second object of the present invention is achieved through the following technical solutions: a method and system for automatically detecting defects of mobile phone back cover based on machine vision, comprising:
[0024] The image acquisition module captures multiple images of the phone's glass back cover under different lighting, focal lengths, and angles.
[0025] The image processing module pre-processes the multiple images obtained and marks the background layer and the reflective layer of the image by using the different gradient priors of the edges of the background layer and the reflective layer to obtain the background layer in the image;
[0026] The fusion module performs weighted fusion on the background layers obtained from multiple images to obtain a real-object image;
[0027] The mobile phone back cover defect detection module, based on the acquisition of physical images, uses the mobile phone back cover defect detection model to identify and mark defects in the physical images;
[0028] To realize the above-mentioned detection method based on the back cover of the mobile phone.
[0029] In summary, the present invention has the beneficial effects of: placing the glass back cover of the mobile phone, taking multiple images of the glass back cover of the mobile phone, and preprocessing the images; through the preprocessed images, using the different gradient priors of the edges of the background layer and the reflective layer, marking the background layer and the reflective layer of the image, separating the background layer and the reflective layer in the image; based on the background layer in the image, superimposing and fusion of images taken from multiple angles to obtain a real picture; based on the real picture, through a pre-established mobile phone back cover defect detection model, identifying and detecting defects in the real picture, judging the quality of the mobile phone back cover, thereby realizing automatic detection of the mobile phone back cover, and reducing the impact of detection stagnation caused by the reflection effect when shooting the mobile phone glass back cover. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 This is a schematic diagram of the overall process steps of Example 1 of the present invention;
[0031] Figure 2 1 is a schematic diagram of the image preprocessing process according to the first embodiment of the present invention;
[0032] Figure 3 This is a schematic diagram of the image fusion process according to the first embodiment of the present invention;
[0033] Figure 4 It is a structural diagram of the system of embodiment 2 of the present invention.
[0034] Figure numerals: 1. Image acquisition module; 2. Image processing module; 3. Fusion module; 4. Mobile phone back cover defect detection module. DETAILED DESCRIPTION
[0035] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0036] It should be noted that when a component is referred to as being “fixed to” or “disposed on” another component, it can be directly on the other component or indirectly on the other component. When a component is referred to as being “connected to” another component, it can be directly or indirectly connected to the other component.
[0037] It should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as limiting the present invention.
[0038] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature identified as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, "plurality" means two or more, unless otherwise specifically defined.
[0039] Example 1: A method for automatically detecting defects in a mobile phone back cover based on machine vision, see Figure 1-Figure 3 , including the following steps:
[0040] S1: Take multiple images of the mobile phone's glass back cover and pre-process the images;
[0041] S2: Through the preprocessed image, the background layer and the reflective layer of the image are marked by using the different gradient priors of the edges of the background layer and the reflective layer, and the background layer and the reflective layer in the image are separated;
[0042] S3: Based on the background layer in the image, the images taken from multiple angles are superimposed and fused to obtain the real object picture;
[0043] S4: Based on the actual picture, the pre-established mobile phone back cover defect detection model is used to identify and detect defects in the actual picture to determine the quality of the mobile phone back cover.
[0044] Due to the characteristics of the glass inside the glass back cover of the mobile phone, the reflection characteristics of the glass often cause the detection of the glass back cover of the mobile phone to fail during the defect detection process. Therefore, after the glass back cover of the mobile phone is placed, multiple images of the glass back cover of the mobile phone are taken and the images are preprocessed. Through the preprocessed images, the background layer and the reflective layer of the image are marked by using the different gradient priors of the edges of the background layer and the reflective layer, and the background layer and the reflective layer in the image are separated. Based on the background layer in the image, the images taken from multiple angles are superimposed and fused to obtain the actual picture. According to the actual picture, the defects in the actual picture are identified and detected through the pre-established defect detection model for the mobile phone back cover, and the quality of the mobile phone back cover is judged, thereby realizing the automatic detection of the mobile phone back cover and reducing the impact of the reflection effect when shooting the mobile phone glass back cover causing the detection delay.
[0045] To differentiate the background layer and the reflective layer, the best way is to take multiple images in a single image based on the same angle and different camera focal lengths and depths. In the multiple images obtained, the background layer and the reflective layer show obvious differences, so as to obtain the separated background layer and form a new real-life photo by superimposing and fusing the separated background layers.
[0046] The acquired images need to be preprocessed before image fusion.
[0047] Image preprocessing includes the following steps:
[0048] S101: Denoising, using a median filter algorithm to remove salt and pepper noise from the image by replacing the value of each pixel with the median value of its neighboring pixels;
[0049] S102: Improving image contrast: using histogram equalization technology to enhance the contrast of the image and redistributing the grayscale values of the image pixels to make the image details clearer.
[0050] After the background layer images are acquired, the images taken for the same product need to be fused. The fusion process includes: S201: Image registration. Before image fusion, the background layer images taken at different angles or different focal lengths and depths need to be accurately registered to ensure that the same objects in the images are accurately aligned in space.
[0051] S202: Weight determination, using the clarity and stability of each background layer image as weight. Images that clearly present details of the phone's back cover are given a higher weight, so that they occupy a larger proportion in the fusion result. Stability is evaluated by calculating the motion vector of the pixel using an optical flow algorithm. A smaller motion vector indicates that the image was relatively stable during capture and is therefore given a higher weight.
[0052] S203: Image fusion. After completing image registration and weight determination, weighted average calculation is performed on the corresponding pixel points of the registered images to fuse the information of different images together to obtain new pixel values, and finally generate a complete real-object picture.
[0053] The weight calculation based on clarity is to evaluate the clarity by calculating the information entropy of the image.
[0054] The calculation formula of information entropy is: Where L is the total number of gray levels in the image, and p(i) is the probability of a pixel with gray value i appearing.
[0055] The higher the information entropy, the richer the information contained in the image and the better the clarity, and it is given a higher weight.
[0056] Stability-based weighting: Stability is assessed by analyzing the motion vectors of pixels within an image. In a sequence of consecutive images, an optical flow algorithm is used to calculate the motion vector of each pixel between adjacent images. The magnitude and direction of the motion vector reflect the pixel's motion; smaller motion vectors indicate more stable images.
[0057] After completing the image registration and weight determination, the weighted average calculation is performed on the corresponding pixels of the registered image. Assuming that there are n background layer images, for a certain pixel (x, y) of the fused image, the calculation formula for its grayscale value I(x, y) is Where Wi is the weight of the i-th image, and Ii(x,y) is the grayscale value of the i-th image at the pixel (x,y).
[0058] By traversing all the pixels of the image and calculating according to the above formula, the information of different images is fused together to obtain new pixel values, and finally a complete picture of the real object is generated.
[0059] This physical image effectively combines the advantages of multiple background layer images, reduces interference factors such as reflections, and more realistically and accurately reflects the actual appearance of the phone's back cover, providing high-quality image data for subsequent defect identification and detection.
[0060] Pre-established models for detecting defects in mobile phone back covers, such as Faster R-CNN and the YOLO series of models based on convolutional neural networks (CNNs), identify and detect defects in images of physical objects. Taking Faster R-CNN as an example, the model first uses a region proposal network (RPN) to generate candidate regions in the physical image that may contain defects. These candidate regions are then fed into subsequent convolutional, pooling, and fully connected layers for feature extraction and classification, determining the presence and type of defects in the candidate regions. Defect types for mobile phone back covers include scratches, cracks, bubbles, and impurities.
[0061] During the model training phase, a large number of images of mobile phone back covers containing various types of defects, as well as images of normal, defect-free devices, are collected as training samples. The model undergoes supervised training, and the back-propagation algorithm continuously adjusts the model parameters to enable the model to learn the differences between defect and normal features, improving detection accuracy and reliability. Ultimately, the model's detection results are used to determine the quality of the mobile phone back cover, completing the entire defect detection process.
[0062] Among them, in the training samples, an image dataset is built by taking images of the glass back covers of mobile phones. A large number of images of mobile phone glass back covers of different brands, models, and batches are collected, covering normal and various defective states. By adjusting the shooting angle, lighting conditions, and focal length, diverse image data is obtained, and defects are annotated in the acquired image dataset. The defect type and location in the image are marked with rectangular boxes or polygonal boxes, and corresponding labels are assigned to form a labeled dataset for training the mobile phone back cover defect detection model, thereby constructing training samples.
[0063] Example 2: A mobile phone back cover defect automatic detection system based on machine vision, see Figure 4 ,include:
[0064] Image acquisition module 1, which captures multiple images of the mobile phone's glass back cover under different lighting, focal lengths, and angles;
[0065] Image processing module 2 pre-processes the multiple images obtained and marks the background layer and the reflective layer of the image by using the different gradient priors of the edges of the background layer and the reflective layer to obtain the background layer in the image;
[0066] Fusion module 3 performs weighted fusion on the background layers obtained from multiple images to obtain a real-object image;
[0067] The mobile phone back cover defect detection module 4, based on the acquisition of the physical image, identifies and marks the defects in the physical image through the mobile phone back cover defect detection model.
[0068] By building upon the above modules, the present embodiment 1 is used to implement defect detection for the glass back cover of a mobile phone, and has the beneficial effects of the corresponding method embodiments, which will not be described in detail here.
[0069] The above embodiments are merely explanations of the present invention and are not limitations of the present invention. After reading this specification, those skilled in the art may make non-creative modifications to the embodiments as needed. However, as long as they are within the scope of the claims of the present invention, they are protected by patent law.
Claims
1. A method for detecting defects in mobile phone back covers based on machine vision, characterized by: The following steps are involved: S1: Take multiple images of the mobile phone's glass back cover and pre-process the images; S2: Through the preprocessed image, the background layer and the reflective layer of the image are marked by using the different gradient priors of the edges of the background layer and the reflective layer, and the background layer and the reflective layer in the image are separated; S3: Based on the background layer in the image, the images taken from multiple angles are superimposed and fused to obtain the real object picture; S4: Based on the actual picture, the pre-established mobile phone back cover defect detection model is used to identify and detect defects in the actual picture to determine the quality of the mobile phone back cover.
2. The method for automatically detecting defects in a mobile phone back cover based on machine vision according to claim 1, wherein: In a single image, multiple images are taken at the same angle and different camera focal lengths and depths. In the multiple images obtained, the background layer and the reflective layer appear significantly different. The background layer is separated and then superimposed to form a new photo of the object.
3. The method for automatically detecting defects in a mobile phone back cover based on machine vision according to claim 1, wherein: Preprocessing the image involves the following steps: S101: Noise reduction, using the median filter algorithm to remove the salt and pepper noise in the image by replacing the value of each pixel with the median value of its neighboring pixels. S102: Improving image contrast: using histogram equalization technology to enhance the contrast of the image and redistributing the grayscale values of the image pixels to make the image details clearer.
4. The method for automatically detecting defects in a mobile phone back cover based on machine vision according to claim 1, wherein: Further processing based on step S3 includes: S201: Image registration. Before image fusion, background layer images taken at different angles or with different focal depths must be accurately registered to ensure that the same objects in the images are accurately aligned in space. S202: Weight determination, using the clarity and stability of each background layer image as weight. Images that clearly present details of the phone's back cover are given a higher weight, so that they occupy a larger proportion in the fusion result. Stability is evaluated by calculating the motion vector of the pixel using an optical flow algorithm. A smaller motion vector indicates that the image was relatively stable during capture and is therefore given a higher weight. S203: Image fusion. After completing image registration and weight determination, weighted average calculation is performed on the corresponding pixel points of the registered images to fuse the information of different images together to obtain new pixel values, and finally generate a complete real-object picture.
5. The method for automatically detecting defects in a mobile phone back cover based on machine vision according to claim 1, wherein: Based on the pre-established mobile phone back cover defect detection model, an image dataset was built by taking images of mobile phone glass back covers. A large number of images of mobile phone glass back covers of different brands, models, and batches were collected, covering normal and various defective states. By adjusting the shooting angle, lighting conditions, and focal length, diverse image data was obtained.
6. The method for automatically detecting defects in a mobile phone back cover based on machine vision according to claim 5, wherein: Defects are annotated for the acquired image dataset, and the defect type and location in the image are marked with rectangular or polygonal boxes, and assigned corresponding labels to form an annotated dataset for training the mobile phone back cover defect detection model.
7. The method for automatically detecting defects in a mobile phone back cover based on machine vision according to claim 6, wherein: The defect types of mobile phone glass back covers include scratches, cracks, bubbles, impurities and chipped corners, which are classified and counted based on different types of defects.
8. A mobile phone back cover defect automatic detection system based on machine vision, characterized by: include The image acquisition module captures multiple images of the phone's glass back cover under different lighting, focal lengths, and angles. The image processing module pre-processes the multiple images obtained and marks the background layer and the reflective layer of the image by using the different gradient priors of the edges of the background layer and the reflective layer to obtain the background layer in the image; The fusion module performs weighted fusion on the background layers obtained from multiple images to obtain a real-object image; The mobile phone back cover defect detection module, based on the acquisition of physical images, uses the mobile phone back cover defect detection model to identify and mark defects in the physical images; To realize the detection method based on the back cover of a mobile phone as described in any one of claims 1-7.
Citation Information
Patent Citations
How to make a glass back cover for mobile phones
CN108545964B
Method for removing edge reflection light spots in electroplated workpiece surface defect visual inspection
CN112927189A
Mobile phone glass cover plate defect detection method based on machine vision
CN114486916A
Metal surface defect detection method and system based on multi-angle image exposure fusion
CN117115610A
Image splicing method and system based on multi-view fusion of track camera
CN117853329A