A mobile phone shell assembly defect detection method and system
By simultaneously processing global and local features within a single image acquisition cycle, efficient and accurate detection of assembly defects in mobile phone cases is achieved. This solves the problems of exceeding detection accuracy and time limits caused by multi-model compatibility and pose uncertainty, and adapts to the flexible production needs of high-speed production lines.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2026-03-24
AI Technical Summary
Existing mobile phone case assembly and inspection systems suffer from unstable inspection accuracy and processing time exceeding the production line cycle time when faced with multi-model compatibility, differences in optical characteristics, and uncertainties in position and orientation, making it difficult to achieve flexible production and efficient inspection.
Within a single image acquisition cycle, global contour features and local deformation features are extracted simultaneously. Through adaptive adjustment and removal, contrast adjustment and removal are achieved, as well as adaptive brightness and contrast adjustment. Optical feature interference is separated, and pose is calculated based on global contour features to determine the dynamic detection area and obtain gap data.
It improves detection efficiency, adapts to the cycle time of high-speed production lines, copes with positional uncertainties, reduces false detections and missed detections, and ensures detection accuracy and stability.
Smart Images

Figure CN120852371B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of machine vision inspection, and particularly to a method and system for detecting assembly defects of mobile phone cases. Background Art
[0002] In the end-of-line assembly quality inspection link of the mobile phone automated production line, a non-contact inspection system based on the principle of laser triangulation is widely used to detect the assembly gap between the middle frame and the back shell of the mobile phone. This system captures the laser line image through a laser emitter and an industrial camera, analyzes the bending and fracture morphology of the laser line, calculates the gap parameters, and determines whether the assembly is qualified. However, the existing technology faces multiple challenges.
[0003] First of all, modern mobile phone production lines need to be compatible with products of multiple models and configurations, and the back shell materials and surface treatment processes are diverse. The high-gloss glass back panel is prone to specular reflection, resulting in overexposed laser line images and blurred edges; while the matte or textured composite material back panel has low laser line image brightness and poor signal-to-noise ratio due to diffuse reflection and light energy absorption. This difference in the optical properties of materials leads to unstable image quality. The existing inspection system needs to manually adjust parameters when switching production part numbers, which is time-consuming and relies on the operator's experience, restricting the transformation of the flexible production mode.
[0004] Secondly, there are slight deviations in the position and posture of the mobile phone on the conveyor belt, and the existing system uses a fixed region of interest (ROI) for gap analysis. The pose deviation may cause the fixed ROI to fail to completely cover the detection area or wrongly include non-detection areas, resulting in false detection or missed detection. Although the pose deviation problem can be solved by first locating the mobile phone contour and then adjusting the ROI, this serial processing mode of "first locate, then measure" will increase the computational complexity, resulting in the total processing time exceeding the upper limit of the production line beat, affecting production efficiency and productivity.
[0005] Therefore, in a pipeline environment with high-speed operation, mixed production of multiple models, and pose uncertainty of the inspection target, how to integrate target positioning and laser scanning measurement without sacrificing detection accuracy and stability, and compress the total processing time within an extremely short beat cycle has become an urgent technical problem to be solved. Summary of the Invention
[0006] In view of the deficiencies of the above-mentioned existing technology, this application provides a method and system for detecting assembly defects of mobile phone cases, which has the advantages of improving detection efficiency, adapting to the beat of high-speed production lines, and being able to cope with the pose uncertainty of the mobile phone to be detected.
[0007] In a first aspect, a method for detecting assembly defects of mobile phone cases, the method includes the steps of:
[0008] S1: Within a single image acquisition cycle, acquire preliminary image data of the mobile phone to be tested, and preprocess the preliminary image data to obtain image data;
[0009] S2: Simultaneously extract the global contour features and local deformation features of the laser line from the image data of the mobile phone to be detected;
[0010] S3: Calculate the current pose of the mobile phone to be detected based on the global contour features;
[0011] S4: Determine the gap detection area based on the current position, and obtain gap data within the gap detection area based on the local deformation characteristics of the laser line;
[0012] S5: Determine the assembly quality of the mobile phone to be tested based on the gap data.
[0013] This application proposes a method for detecting assembly defects in mobile phone cases. By simultaneously processing global and local features within one image acquisition cycle, it achieves rapid and accurate determination of mobile phone pose and gap measurement, thereby effectively addressing pose deviation and time constraints in high-speed assembly line environments.
[0014] Furthermore, step S1 includes:
[0015] S11: Perform region analysis on the preliminary image data to identify the laser line region formed by the laser line and the background pattern region formed by non-uniform optical properties in the preliminary image data;
[0016] S12: Based on the recognition results of the laser line region and the background pattern region, the brightness and contrast of the preliminary image data are adaptively adjusted, and the interference of the background pattern region on the adaptive adjustment process is suppressed, thereby obtaining image data.
[0017] This application proposes a method for detecting assembly defects in mobile phone cases. Through adaptive adjustment and background suppression, it improves the preprocessing effect of back cover images of different materials and enhances the compatibility with materials with different optical properties.
[0018] Furthermore, step S12 includes:
[0019] S121: Based on the identification results of the laser line area and the background pattern area, isolate the laser line area;
[0020] S122: Using the pixel data within the isolated laser line area, calculate the brightness and contrast adjustment parameters;
[0021] S123: The calculated adjustment parameters are applied to the laser line region, and a low-pass filtering operation is performed on the background pattern region to smooth the pixel value changes in the background pattern region, thereby obtaining image data.
[0022] This application proposes a method for detecting assembly defects in mobile phone cases. By isolating the laser line area, calculating parameters, and filtering the background area, the adaptive adjustment effect is further optimized and background interference is reduced.
[0023] Furthermore, step S2 includes:
[0024] S21: From the image data, identify in parallel the edge features of the physical edge of the mobile phone to be detected and the optical features of the laser line;
[0025] S22: When the edge feature and the optical feature have overlapping or adjacent areas, the interference of the optical feature on the edge feature is separated;
[0026] S23: Obtain the global contour features based on the processed edge features;
[0027] S24: Obtain the local deformation characteristics of the laser line based on the optical characteristics.
[0028] This application proposes a method for detecting assembly defects in mobile phone cases. By processing in parallel and separating interference, it improves the accuracy and robustness of extracting global contour features and local deformation features of laser lines.
[0029] Furthermore, step S22 includes:
[0030] S221: Locate the pixel region of the optical feature based on the connectivity and linewidth attributes of the optical feature;
[0031] S222: Based on the pixel region, generate a dynamic mask covering the pixel region of the optical feature;
[0032] S223: When extracting the edge features, the dynamic mask is applied to shield the pixel data covered by the dynamic mask, thereby separating the interference of the optical features on the edge features.
[0033] Furthermore, step S3 includes:
[0034] S31: Calculate the geometric moments of the region enclosed by the global contour features;
[0035] S32: Based on the geometric moments, determine the translation and rotation components of the current pose of the mobile phone to be detected.
[0036] Furthermore, step S4 includes:
[0037] S41: A standardized three-dimensional model coordinate system for the mobile phone to be tested is pre-set, wherein the standardized three-dimensional model coordinate system defines and stores the geometric information of the assembly gap between the frame and the back cover of the mobile phone to be tested.
[0038] S42: Based on the current pose, transform the geometric information in the standardized 3D model coordinate system to the image coordinate system to determine the gap detection region;
[0039] S43: Within the gap detection area, the center line of the laser line is extracted based on the local deformation characteristics of the laser line;
[0040] S44: Calculate the deviation of the laser line centerline from the reference baseline based on the laser line centerline to obtain the gap data.
[0041] Furthermore, step S44 includes:
[0042] S441: Select multiple sampling points along the center line of the laser line;
[0043] S442: For each sampling point on the center line of the laser line, determine the corresponding point on the reference baseline;
[0044] S443: Calculate the distance between the sampling point and its corresponding point;
[0045] S444: Use the set of distances as the deviation to obtain the gap data.
[0046] Furthermore, step S5 includes:
[0047] S51: Compare the gap data with a preset acceptable threshold;
[0048] S52: If the gap data is within the preset qualified threshold range, it is judged as qualified; otherwise, it is judged as unqualified.
[0049] Secondly, a mobile phone case assembly defect detection system, characterized in that it is used to implement the method described in any one of the above claims, the system comprising:
[0050] Acquisition module: Within a single image acquisition cycle, acquires preliminary image data of the mobile phone to be tested, and preprocesses the preliminary image data to obtain image data;
[0051] Extraction module: Simultaneously extracts the global contour features and local deformation features of the laser line of the mobile phone to be detected from the image data;
[0052] First calculation module: Calculates the current pose of the mobile phone to be detected based on the global contour features;
[0053] The second calculation module determines the gap detection area based on the current position, and obtains gap data within the gap detection area based on the local deformation characteristics of the laser line.
[0054] Detection module: Determines the assembly quality of the mobile phone to be tested based on the gap data.
[0055] Beneficial effects: The mobile phone case assembly defect detection method and system proposed in this application solves the problems of unstable image quality, pose uncertainty and processing time exceeding the limit in the prior art by simultaneously extracting global contour features and local deformation features of laser lines in a single image acquisition cycle, and calculating the pose based on the global contour features to determine the dynamic detection area. It has the advantages of improving detection efficiency, adapting to the cycle time of high-speed production lines, and being able to deal with the pose uncertainty of the mobile phone to be inspected. Attached Figure Description
[0056] Figure 1 This is a flowchart of a method for detecting assembly defects in a mobile phone case proposed in this application.
[0057] Figure 2 This is a structural diagram of a mobile phone case assembly defect detection system proposed in this application.
[0058] Figure 3 This is an architecture diagram of a mobile phone case assembly defect detection system proposed in this application.
[0059] Labeling explanation: 201, Acquisition module; 202, Extraction module; 203, First calculation module; 204, Second calculation module; 205, Detection module. Detailed Implementation
[0060] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. The components of the embodiments of this application described and marked in the accompanying drawings can 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.
[0061] 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, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0062] Please refer to Figure 1 A method for detecting assembly defects in mobile phone cases, the method includes the following steps:
[0063] S1: Within a single image acquisition cycle, acquire preliminary image data of the mobile phone to be tested, and preprocess the preliminary image data to obtain image data;
[0064] S2: Simultaneously extract the global contour features and local deformation features of the laser line from the image data of the mobile phone to be detected;
[0065] S3: Calculate the current pose of the mobile phone to be detected based on global contour features;
[0066] S4: Determine the gap detection area based on the current position, and obtain gap data within the gap detection area based on the local deformation characteristics of the laser line;
[0067] S5: Determine the assembly quality of the mobile phone to be tested based on the gap data.
[0068] Among them, a single image acquisition cycle refers to the complete time window within which an image sensor is exposed and data is read once. This is mainly to meet the requirements of high-speed production lines for inspection time.
[0069] Preliminary image data refers to the raw image pixel information directly acquired by the camera.
[0070] Synchronous extraction refers to the identification and separation of different feature information from image data in the same processing stage or in parallel, mainly to shorten the total time spent on feature extraction.
[0071] Global contour features refer to image features that describe the overall external boundary of the mobile phone to be detected.
[0072] Local deformation characteristics of laser lines refer to the morphological changes such as bending, breakage, or positional shift of laser lines projected onto a specific area of the surface of a mobile phone to be tested due to surface undulations or gaps.
[0073] The current pose refers to the precise position and rotation angle of the mobile phone to be tested in the image coordinate system. It is mainly used to determine the specific area that needs to be measured locally.
[0074] The gap detection area refers to a specific range in the image that includes the assembly gap to be detected, defined based on the current pose of the mobile phone to be tested.
[0075] Gap data refers to numerical information that quantifies the geometric dimensions of assembly gaps by analyzing the local deformation characteristics of laser lines. It is mainly used to evaluate assembly quality.
[0076] Specifically, this scheme first completes image acquisition and preprocessing within a single image acquisition cycle. Preprocessing aims to improve image quality, providing a foundation for accurate feature extraction later. Then, from the preprocessed image data, global contour features for overall localization and local laser line deformation features for local measurement are extracted simultaneously. This simultaneous extraction method avoids the time-cumulative nature of traditional serial processing.
[0077] Then, the precise pose of the phone to be inspected in the current image is calculated using the extracted global contour features. Based on the calculated current pose, the specific image region for gap measurement, i.e., the gap detection region, is dynamically determined. This dynamic determination method ensures that even if the phone has pose deviations, the detection region can accurately cover the target gap. Finally, within the determined gap detection region, the local deformation features of the synchronously extracted laser line are analyzed to obtain quantified gap data, and the assembly quality of the phone is judged based on this data. The entire process is completed within one image acquisition cycle, achieving efficient and accurate detection.
[0078] As a preferred embodiment, the solution of this application is specifically implemented as follows:
[0079] A high-speed industrial camera captures images of the mobile phone under inspection during conveyor belt movement, acquiring preliminary image data. Adaptive brightness and contrast adjustment and background filtering are applied to the preliminary image data to obtain final image data. From the image data, an edge detection algorithm is run in parallel to extract the physical contour of the phone, while a light stripe centerline extraction algorithm identifies the laser line and obtains its centerline coordinates. The phone's two-dimensional pose is calculated using the physical contour. Based on the calculated pose, the standard position of the gap between the frame and the back cover of the pre-established 3D model of the phone is projected onto the current image plane to determine the gap detection area. Within the gap detection area, the deviation of the laser line centerline from the reference baseline is analyzed to calculate the gap width data. The calculated gap width data is compared with a preset acceptable gap range to determine whether the phone assembly is qualified.
[0080] Through the above solution, this application solves the problem in the prior art where the total processing time for serial processing of positioning and measurement exceeds the cycle time of a high-speed pipeline, enabling detection to be completed within one image acquisition cycle and improving detection efficiency. Simultaneously, by dynamically determining the gap detection area based on the current pose of the mobile phone, it effectively addresses random pose deviations of the mobile phone on the conveyor belt, avoiding false detections and missed detections, and improving the accuracy and stability of the detection.
[0081] Furthermore, step S1 includes:
[0082] S11: Perform region analysis on the preliminary image data to identify the laser line regions formed by laser lines and the background pattern regions formed by non-uniform optical properties in the preliminary image data;
[0083] S12: Based on the recognition results of the laser line area and the background pattern area, the brightness and contrast of the preliminary image data are adaptively adjusted, and the interference of the background pattern area on the adaptive adjustment process is suppressed, thereby obtaining the image data.
[0084] Region analysis refers to the process of grouping or labeling image pixels, which can be achieved using existing image segmentation, feature detection, and other techniques.
[0085] The laser line region refers to the set of pixels with specific optical characteristics formed by laser lines projected onto the surface of the mobile phone to be tested in the preliminary image data.
[0086] Non-uniform optical properties refer to the differences in the reflection, absorption, and scattering of light in different areas of the surface of the mobile phone being tested, resulting in inconsistent visual effects such as brightness, contrast, and texture in the image.
[0087] The background pattern area refers to the set of pixels in the preliminary image data that are non-laser line areas formed by the non-uniform optical properties of the surface of the mobile phone to be tested.
[0088] Brightness and contrast adaptive adjustment refers to dynamically calculating and applying the brightness and contrast adjustment parameters of an image based on the analysis results of the image content, in order to optimize the visual effect or information extractability of the image.
[0089] Suppressing the interference of background pattern areas on the adaptive adjustment process means reducing or eliminating the influence of pixel data from background pattern areas on the calculation of adjustment parameters or the adjustment effect when performing adaptive brightness and contrast adjustments, so as to ensure that the adjustment is mainly optimized for the laser line area or the key information area of the overall image.
[0090] Specifically, the preprocessing method of this application can be implemented as follows:
[0091] In step S11, laser line regions can be identified using a method based on grayscale thresholding and connected component analysis. For example, a high grayscale threshold is set, and pixels above this threshold are initially marked as potential laser line pixels. Then, connected component analysis is performed on these pixels to filter out connected components with too small an area or shapes that do not conform to the characteristics of laser lines, thus obtaining the laser line regions. Background pattern regions can be identified as non-laser line regions.
[0092] In step S12, a local histogram equalization method can be used for adaptive adjustment. When calculating the local histogram, pixels in the background pattern region can be assigned lower weights, or pixels in the background pattern region can be directly excluded, using only pixels in the laser line region or its vicinity to calculate the histogram or statistics for adjustment. Then, the brightness and contrast parameters are dynamically adjusted based on the calculated statistics, and the adjustment is applied to the entire image or only the laser line region. To suppress background pattern interference, the background pattern region can be smoothed after the adjustment is applied, for example, by using a Gaussian filter for low-pass filtering to reduce background pattern details and noise, further highlighting the laser line.
[0093] Furthermore, step S12 includes:
[0094] S121: Based on the recognition results of the laser line area and the background pattern area, isolate the laser line area;
[0095] S122: Calculate brightness and contrast adjustment parameters using pixel data within the isolated laser line area;
[0096] S123: The calculated adjustment parameters are applied to the laser line area, and a low-pass filter is performed on the background pattern area to smooth the pixel value changes in the background pattern area, thereby obtaining image data.
[0097] In the above method, based on the identification results of the laser line region and the background pattern region, the laser line region is isolated. This isolation operation can distinguish the region containing key measurement information from the background region, laying the foundation for subsequent accurate processing. Using the pixel data within the isolated laser line region, brightness and contrast adjustment parameters are calculated. This calculation process is based on the pixel characteristics of the laser line region itself, which can directly reflect the image quality under the current optical conditions, thereby calculating the adjustment parameters most suitable for optimizing the laser line image quality. A low-pass filtering operation is performed on the background pattern region. This operation can effectively smooth textures, noise, or uneven brightness changes in the background, reducing the interference of the background on subsequent feature extraction.
[0098] As a specific implementation, a binary mask can be generated based on the recognition results of the laser line region and the background pattern region, where the pixel value corresponding to the laser line region is 1, and the pixel value corresponding to other regions (including the background pattern region) is 0. Isolating the laser line region can be achieved by performing pixel-by-pixel multiplication of the preliminary image data with this binary mask, thereby obtaining an image copy containing only the pixel values of the laser line region, while the pixel values of other regions are set to zero.
[0099] Using pixel data within the isolated laser line region, the adjustment parameters for brightness and contrast can be calculated by analyzing the gray-level histogram of non-zero pixels in the image copy. For example, the average gray value and standard deviation of these pixels can be calculated, and then, based on these statistics, a pre-defined mapping function or lookup table can be used to determine the gamma correction value, brightness offset, and contrast scaling factor.
[0100] Applying the calculated adjustment parameters to the laser line region allows for pixel-by-pixel brightness and contrast transformation of the pixel values corresponding to the laser line region in the initial image data, based on the previously calculated parameters. Simultaneously, low-pass filtering is performed on the background pattern region by applying a two-dimensional convolution kernel (e.g., a 3x3 or 5x5 Gaussian kernel or mean kernel) to the pixels in the initial image data corresponding to the background pattern region, thus smoothing the pixel value variations in these areas. Finally, the processed laser line region and background pattern region are merged to form the final image data.
[0101] Furthermore, step S2 includes:
[0102] S21: From image data, identify the edge features of the physical edge of the mobile phone to be detected and the optical features of the laser line in parallel;
[0103] S22: When edge features and optical features overlap or are adjacent to each other, separate the interference of optical features on edge features;
[0104] S23: Obtain global contour features based on the processed edge features;
[0105] S24: Obtain local deformation characteristics of laser lines based on optical features.
[0106] Among them, the edge features of physical edges refer to the set of pixels in the image that correspond to the actual physical boundary of the mobile phone to be detected. These pixels usually show significant changes in grayscale or color values.
[0107] The optical characteristics of a laser line refer to the set of pixels in an image that have specific brightness, color, and shape, formed by a laser line projected onto the surface of the mobile phone to be tested.
[0108] Overlapping or adjacent regions refer to pixel areas where physical edge features and laser line optical features are close to or partially overlap each other in image space.
[0109] Separating the interference of optical features on edge features refers to using technical means to eliminate or reduce the influence of laser line optical features on physical edge recognition when extracting physical edge features.
[0110] Processed edge features refer to edge information that more accurately reflects the physical boundary of the mobile phone to be detected, obtained after separating optical feature interference operations.
[0111] This application proposes an improved feature extraction method to address the interference between physical edge features and laser line optical features in mobile phone detection. This method identifies both the physical edge features of the mobile phone and the optical features of the laser line in parallel during the image acquisition cycle; that is, the two feature extraction processes can be performed simultaneously or alternately to improve efficiency. During the identification process, the system determines whether there are overlapping or adjacent areas between the two. Once spatial proximity or overlap is detected, the system separates the interference of optical features on edge features, ensuring that edge information is not contaminated by the optical information of the laser line. For example, when the laser line is projected near the physical edge of the mobile phone, separating the interference can prevent the optical gradient of the laser line from being misidentified as a physical edge, thus more accurately reflecting the actual physical boundary of the mobile phone.
[0112] Based on the processed edge features, the system can acquire the global contour features of the mobile phone to calculate its precise pose in the image. Simultaneously, local deformation features are obtained based on the laser line optical characteristics, directly reflecting changes in the phone's surface contour and providing a basis for gap or step measurement. By parallel recognition, interference separation, and separate acquisition of global contour and local deformation features, this method efficiently and accurately acquires two key features within a single image acquisition cycle. This solves the problem of exceeding the cycle time due to time accumulation in the traditional "first locate, then measure" serial mode, achieving high-precision, high-stability real-time detection in high-speed pipeline environments.
[0113] Furthermore, step S22 includes:
[0114] S221: Locate the pixel region of the optical feature based on the connectivity and linewidth properties of the optical feature;
[0115] S222: Generate a dynamic mask covering the pixel region that covers the optical features based on the pixel region;
[0116] S223: When extracting edge features, a dynamic mask is applied to shield the pixel data covered by the dynamic mask, thereby separating the interference of optical features on edge features.
[0117] Among them, the connectivity of optical features refers to the spatial connection relationship of pixels belonging to optical features in an image. For example, adjacent pixels with similar grayscale or color values are considered connected.
[0118] Line width refers to the pixel width of a specific optical feature in an image in a direction perpendicular to its main orientation.
[0119] An optical feature pixel region refers to a set of pixels in an image that are identified as belonging to an optical feature. A dynamic mask is a binary image generated in real time based on specific regions (such as optical feature regions) identified in the current image, used to mark or isolate these regions.
[0120] Masking pixel data covered by a dynamic mask refers to ignoring or invalidating pixel data within the area marked by the dynamic mask in subsequent image processing steps, so that it is not involved in the calculation. This can be achieved by setting these pixel values to zero.
[0121] In one exemplary implementation, locating the pixel region of an optical feature based on its connectivity and linewidth attributes can be achieved in the following ways:
[0122] First, thresholding is performed on the image to extract sets of high-brightness pixels, which may contain laser lines and other bright areas. Next, connected component analysis is performed on these sets of bright pixels to identify different connected regions. Then, geometric property analysis is performed on each connected region, such as calculating its area, perimeter, and principal axis direction, and estimating its average width perpendicular to the principal axis, i.e., the linewidth attribute.
[0123] By setting reasonable thresholds for area and linewidth ranges, connected regions that match the characteristics of laser lines can be filtered out, thereby locating the pixel regions with optical features. Generating a dynamic mask covering these optical feature pixel regions can be achieved by creating a binary image of the same size as the original image, setting the pixel values at the locations corresponding to the identified optical feature pixel regions to 1, and setting the rest to 0. When extracting edge features, applying the dynamic mask and shielding the pixel data covered by the mask can be done by setting the grayscale values of pixels with a mask value of 1 in the original image to 0, or to the average grayscale value of the image's background, before performing edge detection (e.g., using the Canny operator), and then performing edge detection on the processed image. Alternatively, the edge detection algorithm can be modified to skip pixels with a mask value of 1 when calculating pixel gradients.
[0124] By employing the aforementioned technical methods, this solution can effectively identify and isolate laser line regions in images, preventing them from interfering with the extraction of the phone's physical edge features. This results in more accurate extracted edge features, thereby improving the precision of the global contour features calculated based on these edge features. The improved accuracy of the global contour features directly leads to increased precision in calculating the phone's current pose, ensuring accurate delineation of the subsequent gap detection area, and ultimately enhancing the overall precision and reliability of phone casing assembly defect detection.
[0125] Furthermore, step S3 includes:
[0126] S31: Calculate the geometric moments of the region enclosed by the global contour features;
[0127] S32: Determine the translation and rotation components of the current pose of the mobile phone to be detected based on the geometric moments.
[0128] Geometric moments are mathematical quantities used to describe the shape characteristics of an image region, including the zeroth moment (representing the area of the region), the first moment (used to calculate the centroid of the region), and the second moment (used to calculate the orientation and shape distribution of the region).
[0129] The translation component refers to the positional offset of the mobile phone under test in the image coordinate system, usually represented by the centroid coordinates of the region. The rotation component refers to the rotation angle of the mobile phone under test relative to a set reference direction, usually represented by the principal axis direction of the region.
[0130] This solution provides a specific implementation method for calculating the current pose of the mobile phone to be detected based on global contour features. Its core lies in using geometric moments to describe and extract the position and orientation information of the mobile phone contour region.
[0131] First, the geometric moments of the region enclosed by the global contour features are calculated. These global contour features reflect the overall boundary shape of the mobile phone being detected in the image. By defining the region enclosed by these contour features, it can be treated as a two-dimensional image region for analysis. Calculating the geometric moments of this region, such as the zeroth, first, and second moments, allows for a compact mathematical summary of the region's overall geometric characteristics, including its size, center location, and main orientation. This method effectively extracts stable and physically meaningful descriptors from contour features that may contain noise or local incompleteness.
[0132] Secondly, based on the calculated geometric moments, the translational and rotational components of the current pose of the mobile phone to be detected are determined. Typically, the centroid coordinates of the region calculated using the first-order moments can be used as the center position of the mobile phone in the image, directly corresponding to its translational component.
[0133] The principal axis direction of the region calculated using the second-order moment reflects the overall orientation of the phone, corresponding to its rotational components. By comparing the calculated centroid coordinates and principal axis directions with their corresponding values under the phone's standard pose, the current translational and rotational deviations can be calculated, thereby determining the phone's current pose.
[0134] This pose calculation method based on geometric moments is computationally efficient and insensitive to local changes in contour details. It can quickly and accurately obtain the overall pose information of the mobile phone, providing a precise positioning basis for subsequent steps and meeting the needs of high-speed detection. By utilizing global contour features and combining geometric moments to calculate pose, this solution can dynamically adjust the subsequent detection area according to the actual position and orientation of the mobile phone, effectively solving the problem that a fixed detection area cannot adapt to mobile phone pose deviations, thus improving the accuracy and robustness of detection.
[0135] Furthermore, step S4 includes:
[0136] S41: Pre-set the standardized three-dimensional model coordinate system of the mobile phone to be tested. The standardized three-dimensional model coordinate system defines and stores the geometric information of the assembly gap between the middle frame and the back shell of the mobile phone to be tested.
[0137] S42: Based on the current pose, transform the geometric information in the standardized 3D model coordinate system to the image coordinate system to determine the gap detection area;
[0138] S43: Within the gap detection area, extract the center line of the laser line based on the local deformation characteristics of the laser line;
[0139] S44: Calculate the deviation of the laser line centerline from the reference baseline based on the laser line centerline to obtain gap data.
[0140] The standardized 3D model coordinate system refers to a fixed 3D spatial reference frame that corresponds to the physical structure of the mobile phone to be tested. The origin and axis of this frame are usually aligned with a specific structural feature of the mobile phone, which is set in advance by technicians based on the shape characteristics of the mobile phone.
[0141] The geometric information of the assembly gap between the frame and the back cover of the mobile phone under test refers to the data describing the position, shape and range of the assembly gap between the frame and the back cover of the mobile phone under test in the standardized three-dimensional model coordinate system. For example, it may include the three-dimensional coordinates of the gap boundary line, the normal vector of the gap area or the coordinates of key points related to the gap.
[0142] The current pose refers to the actual position and orientation of the mobile phone under test in the image coordinate system. It can be represented by a translation vector and a rotation matrix, describing the transformation relationship between the normalized 3D model coordinate system and the image coordinate system. The image coordinate system is a two-dimensional planar reference frame used to describe the pixel positions in an image. Its origin is usually located at the upper left corner of the image, and its axes are aligned with the row and column directions of the image. The gap detection region refers to a specific image region in the image coordinate system, dynamically determined based on the current pose of the mobile phone under test, used for gap data acquisition. It can be one or more rectangular, polygonal, or arbitrary shaped sets of pixels.
[0143] A reference baseline is a geometric element in an image coordinate system used to measure the degree of deviation of the laser line centerline. It can be a straight line, a curve, or a series of reference points, and is usually consistent with the position of the laser line when there is no gap under ideal conditions.
[0144] The method described above in this application can be implemented in various ways. For example, in one specific embodiment, pre-setting the standardized three-dimensional model coordinate system of the mobile phone to be tested can be achieved by importing the computer-aided design model of the mobile phone into the testing system, and annotating and storing the key geometric features (such as boundary lines) of the assembly gap between the mid-frame and the back shell in the model coordinate system.
[0145] Based on the current pose, the geometric information in the standardized 3D model coordinate system is transformed to the image coordinate system to determine the gap detection area. By using camera calibration and extrinsic parameter calculation methods in computer vision, points in the 3D model coordinate system are projected onto the 2D image plane through rotation matrices and translation vectors, thereby obtaining the corresponding position and range of the gap area in the image.
[0146] Within the gap detection area, the laser line centerline is extracted based on the local deformation characteristics of the laser line. Image enhancement processing is first performed within the corresponding image sub-region of the defined gap detection area. Then, laser line pixel detection is performed using algorithms based on gray-level gradients or Hessian matrices. Finally, non-maximum suppression and curve fitting are used to extract the centerline with sub-pixel accuracy. Based on the laser line centerline, the deviation of the laser line centerline relative to a reference baseline is calculated to obtain gap data. The reference baseline can be the ideal position of the laser line corresponding to the gapless surface, defined in a standardized 3D model and mapped to the image coordinate system through pose transformation. The deviation can be calculated as the average or maximum vertical distance from each point on the laser line centerline to the mapped reference baseline, thus obtaining gap data for judging assembly quality.
[0147] Furthermore, step S44 includes:
[0148] S441: Select multiple sampling points along the center line of the laser line;
[0149] S442: For each sampling point on the center line of the laser line, determine the corresponding point on the reference baseline;
[0150] S443: Calculate the distance between a sampling point and its corresponding point;
[0151] S444: Use the set of distances as the deviation to obtain gap data.
[0152] The technical solution of this application ensures comprehensive capture of the overall deformation of the laser line by densely selecting multiple sampling points along the center line of the laser line. For each sampling point, a point precisely corresponding to it is determined on the reference baseline, establishing a one-to-one mapping relationship between the actual position and the ideal position of the laser line, which lays the foundation for subsequent accurate distance calculation.
[0153] Calculating the distance between a sampling point and its corresponding point directly quantifies the degree of laser line offset at each sampling position. These distance values are a direct measure of the gap or deviation. Integrating the distances calculated from all sampling points into a set as the deviation provides a richer and more detailed profile of the gap data than a single measurement point, and can more accurately reflect the local changes and overall characteristics of the gap.
[0154] This scheme, combined with a technique that transforms geometric information from the standardized 3D model coordinate system to the image coordinate system based on the current pose to determine the gap detection area, enables the reference baseline to be precisely aligned with the current phone pose. This ensures that even if the phone has pose deviations, the deviation of the laser line can be accurately calculated within the correct area based on the accurately aligned reference baseline, thereby obtaining reliable gap data and effectively addressing the challenges posed by the uncertainty of the phone pose.
[0155] For example, after obtaining the laser line centerline and the reference baseline, a sampling point can be selected at fixed pixel intervals along the laser line centerline, such as every 5 pixels. For each selected sampling point, the nearest point on the reference baseline can be searched as its corresponding point. Then, the Euclidean distance between each sampling point and its corresponding point is calculated. All these calculated distance values are stored in a list, which constitutes the deviation, serving as gap data for subsequent assessment of assembly quality.
[0156] Furthermore, step S5 includes:
[0157] S51: Compare the gap data with the preset acceptable threshold;
[0158] S52: If the gap data is within the preset qualified threshold range, it is judged as qualified; otherwise, it is judged as unqualified.
[0159] The preset pass threshold refers to a pre-defined quantitative range used to measure whether the gap data meets the quality standards.
[0160] By introducing preset acceptance thresholds, this method transforms assembly quality assessment from a subjective or vague approach to an objective, quantitative comparison. This ensures that each assessment is based on a consistent standard, improving consistency and repeatability. The threshold-based automated assessment process requires no human intervention, significantly enhancing inspection efficiency and enabling it to meet the demands of automated production lines for high-speed, stable, and accurate quality judgment.
[0161] Please refer to Figure 2 , Figure 3 A mobile phone case assembly defect detection system, characterized in that it is used to implement any of the above methods, and the system includes:
[0162] Acquisition module 201: Within a single image acquisition cycle, acquires preliminary image data of the mobile phone to be detected, and preprocesses the preliminary image data to obtain image data;
[0163] Extraction module 202: Simultaneously extracts the global contour features and local deformation features of the laser line from the image data of the mobile phone to be detected;
[0164] First calculation module 203: Calculates the current pose of the mobile phone to be detected based on global contour features;
[0165] Second calculation module 204: Determines the gap detection area based on the current position, and obtains gap data within the gap detection area based on the local deformation characteristics of the laser line;
[0166] Detection module 205: Determines the assembly quality of the mobile phone to be tested based on the gap data.
[0167] The acquisition module 201 acquires preliminary image data of the mobile phone under test within a single image acquisition cycle and preprocesses this preliminary image data to obtain the final image data. Specifically, a high-resolution industrial camera with a synchronous laser emitter can be used for image acquisition. Preprocessing may involve adaptive brightness and contrast adjustment. For example, region analysis can be performed on the preliminary image data to identify laser line regions and background pattern regions formed by non-uniform optical properties. Laser line regions can be isolated, and pixel data within these isolated regions can be used to calculate brightness and contrast adjustment parameters. These calculated adjustment parameters can be applied to the laser line regions and low-pass filtering can be performed on the background pattern regions to smooth pixel value variations, thereby obtaining the final image data. This processing effectively addresses the image quality instability caused by different mobile phone back cover materials and surface treatment processes, ensuring the consistency and reliability of the input images for subsequent feature extraction and analysis.
[0168] The extraction module 202 involves simultaneously extracting the global contour features and local deformation features of the laser line from the image data of the mobile phone under test. Specifically, an edge detection algorithm (such as Canny) combined with contour tracking and fitting can be used to extract the global contour features. The local deformation features of the laser line can be extracted by identifying the brightest pixel on the laser line and performing sub-pixel interpolation. Furthermore, the edge features of the physical edge of the mobile phone under test and the optical features of the laser line can be identified in parallel. When the edge features and optical features overlap or are adjacent, the pixel region of the optical feature can be located based on the connectivity and linewidth attributes of the optical feature, and a dynamic mask covering the pixel region of the optical feature can be generated based on this pixel region. When extracting edge features, this dynamic mask is applied to shield the pixel data covered by the mask, thereby separating the interference of the optical feature on the edge features. The global contour features are obtained based on the processed edge features, and the local deformation features of the laser line are obtained based on the optical features. This synchronous extraction method enables the parallel acquisition of global features for positioning and local features for measurement, significantly improving processing efficiency and solving the problems of large computational load and long processing time caused by the traditional "positioning first, then measurement" serial processing mode, thus enabling it to meet the cycle time requirements of high-speed production lines.
[0169] The first calculation module 203 calculates the current pose of the mobile phone to be detected based on global contour features. Specifically, this can be achieved by calculating the geometric moments of the region enclosed by the global contour features. For example, the zeroth, first, and second moments of the region can be calculated, and the translational and rotational components of the current pose of the mobile phone to be detected can be determined based on these geometric moments. Thus, the system can accurately determine the actual pose of the mobile phone in real time, eliminating reliance on a fixed region of interest, providing a precise reference for subsequent gap detection, and avoiding false detections or missed detections due to pose deviations.
[0170] The second calculation module 204 determines the gap detection area based on the current position and acquires gap data within this area based on the local deformation characteristics of the laser line. Specifically, a standardized 3D model coordinate system for the phone to be inspected can be pre-set, defining and storing the geometric information of the assembly gap between the phone's frame and back cover. Based on the current pose, the geometric information in the standardized 3D model coordinate system is transformed to the image coordinate system to determine the gap detection area. Within this gap detection area, the laser line centerline is extracted based on the local deformation characteristics of the laser line. Subsequently, the deviation of the laser line centerline from the reference baseline is calculated to obtain the gap data. For example, multiple sampling points can be selected on the laser line centerline. For each sampling point, a corresponding point on the reference baseline is determined, and the distance between the sampling point and its corresponding point is calculated. The set of these distances serves as the deviation, which is the gap data. This ability to dynamically adjust the detection area ensures that the inspection always occurs within the correct assembly gap area of the phone, guaranteeing the accuracy and validity of the acquired gap data.
[0171] The detection module 205 determines the assembly quality of the mobile phone under inspection based on gap data. This can be achieved by comparing the gap data with a preset acceptable threshold. If the gap data falls within the preset acceptable threshold range, it is considered acceptable; otherwise, it is considered unacceptable. By using robust processing and precise measurement of gap data for judgment, the system can provide reliable assembly quality assessment results and effectively identify unacceptable products.
[0172] Specifically, this system aims to solve the problems in automated mobile phone production lines, such as unstable image quality caused by the diversity of mobile phone back cover materials and surface treatment processes, and inaccurate detection areas caused by slight deviations in the position and posture of the mobile phone on the conveyor belt, which affect detection accuracy, stability and production efficiency. It integrates target positioning and laser scanning measurement, while compressing the total processing time into an extremely short cycle time.
[0173] Initially, the system acquisition module 201 acquires preliminary image data of the mobile phone under test within a single image acquisition cycle. To address the issue of unstable image quality caused by different mobile phone back cover materials and surface treatment processes (such as overexposure of high-gloss glass or low brightness of matte materials), the acquisition module preprocesses the preliminary image data to obtain high-quality image data. This preprocessing step ensures the consistency and reliability of the input images for subsequent feature extraction and analysis, avoiding the tedious and time-consuming process of manually adjusting parameters when switching product models.
[0174] Subsequently, the extraction module 202 simultaneously extracts the global contour features and local deformation features of the laser line from the preprocessed image data. This simultaneous extraction is key to the solution, directly addressing the problems of high computational load and long processing time inherent in the traditional "first locate, then measure" serial processing mode. By acquiring global features for positioning and local features for measurement in parallel, the system significantly improves processing efficiency, enabling it to meet the cycle time requirements of high-speed production lines. The global contour features provide the overall shape and position information of the phone, while the local deformation features of the laser line contain precise gap measurement data.
[0175] Next, the first calculation module 203 uses the extracted global contour features to calculate the current pose of the mobile phone to be detected, including translation and rotation components. This step is crucial for addressing the slight positional and orientation deviations that the mobile phone may have on the conveyor belt. By accurately determining the actual pose of the mobile phone in real time, the system can break free from its dependence on a fixed region of interest, providing a precise reference benchmark for subsequent gap detection, thereby avoiding false detections or missed detections caused by pose deviations.
[0176] Then, the second calculation module 204 dynamically determines the gap detection area based on the current pose determined by the first calculation module 203. This ability to dynamically adjust the detection area is an effective means of solving the problem of a fixed region of interest not being fully covered or being incorrectly included in non-detection areas. It ensures that detection is always performed within the correct assembly gap area of the phone. Within this dynamically determined gap detection area, the module further utilizes the local deformation characteristics of the laser line to acquire gap data. This method of combining dynamic positioning with precise local measurement ensures the accuracy and effectiveness of the acquired gap data.
[0177] Finally, the inspection module 205 is the final stage of the entire system. It compares the acquired gap data with a preset acceptance threshold to determine the assembly quality of the phone under inspection. By using robust processing and precise measurement of gap data for judgment, the system can provide reliable assembly quality assessment results and effectively identify defective products.
[0178] Through the collaborative work of the aforementioned modules, this system effectively solves core technical challenges in mobile phone case assembly defect detection, such as unstable image quality, pose uncertainty, and low efficiency. Compared to existing technologies, this system eliminates the need for manual parameter adjustments when switching product models, improving flexible production capabilities; by dynamically adjusting the detection area, it avoids false or missed detections caused by pose deviations; and through synchronous feature extraction, it compresses the total processing time into an extremely short cycle time, significantly improving production efficiency and capacity.
[0179] In this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying any such actual relationship or order between these entities or operations.
[0180] 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 detecting assembly defects in mobile phone cases, characterized in that, The method includes the following steps: S1: Within a single image acquisition cycle, acquire preliminary image data of the mobile phone to be tested, and preprocess the preliminary image data to obtain image data; S2: Simultaneously extract the global contour features and local deformation features of the laser line from the image data of the mobile phone to be detected; S3: Calculate the current pose of the mobile phone to be detected based on the global contour features; S4: Determine the gap detection area based on the current pose, and obtain gap data within the gap detection area based on the local deformation characteristics of the laser line; S5: Determine the assembly quality of the mobile phone to be tested based on the gap data.
2. The method for detecting assembly defects in a mobile phone case according to claim 1, characterized in that, Step S1 includes: S11: Perform region analysis on the preliminary image data to identify the laser line region formed by the laser line and the background pattern region formed by non-uniform optical properties in the preliminary image data; S12: Based on the recognition results of the laser line region and the background pattern region, the brightness and contrast of the preliminary image data are adaptively adjusted, and the interference of the background pattern region on the adaptive adjustment process is suppressed, thereby obtaining image data.
3. The method for detecting assembly defects in a mobile phone case according to claim 2, characterized in that, Step S12 includes: S121: Based on the identification results of the laser line area and the background pattern area, isolate the laser line area; S122: Using the pixel data within the isolated laser line area, calculate the brightness and contrast adjustment parameters; S123: The calculated adjustment parameters are applied to the laser line region, and a low-pass filtering operation is performed on the background pattern region to smooth the pixel value changes in the background pattern region, thereby obtaining image data.
4. The method for detecting assembly defects in a mobile phone case according to claim 1, characterized in that, Step S2 includes: S21: From the image data, identify in parallel the edge features of the physical edge of the mobile phone to be detected and the optical features of the laser line; S22: When the edge feature and the optical feature have overlapping or adjacent areas, the interference of the optical feature on the edge feature is separated; S23: Obtain the global contour features based on the processed edge features; S24: Obtain the local deformation characteristics of the laser line based on the optical characteristics.
5. The method for detecting assembly defects in a mobile phone case according to claim 4, characterized in that, Step S22 includes: S221: Locate the pixel region of the optical feature based on the connectivity and linewidth attributes of the optical feature; S222: Based on the pixel region, generate a dynamic mask covering the pixel region of the optical feature; S223: When extracting the edge features, the dynamic mask is applied to shield the pixel data covered by the dynamic mask, thereby separating the interference of the optical features on the edge features.
6. The method for detecting assembly defects in a mobile phone case according to claim 1, characterized in that, Step S3 includes: S31: Calculate the geometric moments of the region enclosed by the global contour features; S32: Based on the geometric moments, determine the translation and rotation components of the current pose of the mobile phone to be detected.
7. The method for detecting assembly defects in a mobile phone case according to claim 1, characterized in that, Step S4 includes: S41: A standardized three-dimensional model coordinate system for the mobile phone to be tested is pre-set, wherein the standardized three-dimensional model coordinate system defines and stores the geometric information of the assembly gap between the frame and the back cover of the mobile phone to be tested. S42: Based on the current pose, transform the geometric information in the standardized 3D model coordinate system to the image coordinate system to determine the gap detection region; S43: Within the gap detection area, the center line of the laser line is extracted based on the local deformation characteristics of the laser line; S44: Calculate the deviation of the laser line centerline from the reference baseline based on the laser line centerline to obtain the gap data.
8. The method for detecting assembly defects in a mobile phone case according to claim 7, characterized in that, Step S44 includes: S441: Select multiple sampling points along the center line of the laser line; S442: For each sampling point on the center line of the laser line, determine the corresponding point on the reference baseline; S443: Calculate the distance between the sampling point and its corresponding point; S444: Use the set of distances as the deviation to obtain the gap data.
9. The method for detecting assembly defects in a mobile phone case according to claim 1, characterized in that, Step S5 includes: S51: Compare the gap data with a preset acceptable threshold; S52: If the gap data is within the preset qualified threshold range, it is judged as qualified; otherwise, it is judged as unqualified.
10. A mobile phone case assembly defect detection system, characterized in that, The system for implementing the method according to any one of claims 1-9 comprises: Acquisition module: Within a single image acquisition cycle, acquires preliminary image data of the mobile phone to be tested, and preprocesses the preliminary image data to obtain image data; Extraction module: Simultaneously extracts the global contour features and local deformation features of the laser line of the mobile phone to be detected from the image data; First calculation module: Calculates the current pose of the mobile phone to be detected based on the global contour features; The second calculation module determines the gap detection area based on the current pose, and obtains gap data within the gap detection area based on the local deformation characteristics of the laser line. Detection module: Determines the assembly quality of the mobile phone to be tested based on the gap data.
Citation Information
Patent Citations
Visual detection method and system for abrasion of pantograph slide plate
CN117611525A
Device and method for identifying and locating surface defects
DE102020000581A1