Mobile phone card holder multi-dimensional visual detection method and system
By using a multi-dimensional visual inspection method that synchronously acquires and establishes pixel-level spatial correspondences, the contradiction between inspection accuracy and production cycle time in the mobile phone SIM card tray inspection system is resolved, achieving efficient and accurate defect identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DONGGUAN DINGPING PRECISION HARDWARE TECH CO LTD
- Filing Date
- 2026-01-28
- Publication Date
- 2026-05-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing mobile phone SIM card tray visual inspection systems face a trade-off between inspection accuracy and production cycle time when dealing with complex surface characteristics, as well as blind spots caused by single illumination methods and inefficiencies resulting from multiple exposure schemes.
When the SIM card tray moves to the detection area, the system simultaneously acquires first-type image information highlighting inherent design features and second-type image information highlighting potential surface defects, establishes pixel-level spatial correspondence, performs local information comparison, and distinguishes between inherent design features and actual surface defects.
It significantly improves inspection efficiency, meets production line cycle requirements, and enhances the accuracy and reliability of inspection, overcoming problems such as overexposure, underexposure, or insufficient contrast caused by complex surface characteristics under a single fixed lighting method.
Smart Images

Figure CN121998952A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of visual inspection technology, and more specifically, to a multi-dimensional visual inspection method and system for mobile phone SIM card trays. Background Technology
[0002] On intelligent manufacturing production lines, the quality inspection of SIM card trays is a crucial step in ensuring product quality and production efficiency. Traditional inspection methods are insufficient to meet the demands for high-precision, real-time quality control in large-scale production.
[0003] Specifically, in automated production workshops for mobile phone components, a fully automated vision inspection system is typically deployed. This system uses multiple industrial cameras at fixed positions to acquire image information. Image processing programs within a computer analyze these images to check for surface defects and simultaneously measure the overall dimensional accuracy of the SIM card tray.
[0004] This complex surface characteristic presents a significant challenge to existing visual inspection systems. When a card holder with a mirror-like finish enters the inspection station, the ring-shaped LED light source above the camera causes large areas of overexposed white patches in the image, making it impossible to detect any minute scratches or dents.
[0005] To overcome the limitations of a single fixed lighting method, an upgrade to the inspection station was attempted using multiple exposure. Although this multiple exposure solution performed well during the technical verification phase, after being implemented on the production line, the inspection time significantly exceeded the limit. This increased the image acquisition time for a single cassette several times, causing the total inspection time for a single cassette to far exceed the production line's set cycle time, creating a production bottleneck and severely impacting overall production efficiency. Summary of the Invention
[0006] This application discloses a multi-dimensional visual inspection method and system for mobile phone SIM card trays, aiming to solve the contradiction between inspection accuracy and production cycle when facing complex surface characteristics in existing mobile phone SIM card tray visual inspection systems, as well as the inspection blind spots caused by single illumination methods and the low efficiency caused by multiple exposure schemes.
[0007] The technical solution of this application is as follows: Firstly, this application discloses a multi-dimensional visual inspection method for mobile phone SIM card trays, specifically including: When the SIM card tray moves to the detection area, a first type of image information and a second type of image information of the SIM card tray are acquired; wherein, the first type of image information is obtained by configuring an illumination method to highlight the inherent design features of the SIM card tray, and the second type of image information is obtained by configuring an illumination method to highlight potential surface defects of the SIM card tray. The first type of image information and the second type of image information are processed to establish a pixel-level spatial correspondence between the first type of image information and the second type of image information; Based on pixel-level spatial correspondence, local information comparison is performed on the first type of image information and the second type of image information. The local information comparison includes obtaining texture differences, brightness changes and edge structure information of local areas. Based on the texture differences, brightness changes and edge structure information, the inherent design features and actual surface defects of the mobile phone card tray are judged, and the local information comparison results are obtained.
[0008] Secondly, this application also discloses a multi-dimensional visual inspection system for mobile phone SIM card trays, the system comprising: The image information acquisition module is used to acquire a first type of image information and a second type of image information of the SIM card tray when the SIM card tray moves to the detection area. The first type of image information is obtained by configuring an illumination method to highlight the inherent design features of the SIM card tray, and the second type of image information is obtained by configuring an illumination method to highlight potential surface defects of the SIM card tray. The spatial correspondence establishment module is used to process the first type of image information and the second type of image information to establish a pixel-level spatial correspondence between the first type of image information and the second type of image information. The local information comparison module is used to compare the local information of the first type of image information and the second type of image information based on the pixel-level spatial correspondence. The local information comparison includes obtaining the texture difference, brightness change and edge structure information of the local area, and judging the inherent design features and actual surface defects of the mobile phone card tray based on the texture difference, brightness change and edge structure information, and obtaining the local information comparison result. Beneficial effects
[0009] This application discloses a multi-dimensional visual inspection method for mobile phone SIM card trays. By simultaneously acquiring first-type image information highlighting inherent design features and second-type image information highlighting potential surface defects when the SIM card tray moves to the inspection area, it avoids the time consumption caused by light source switching and multiple photography in traditional multi-exposure schemes, significantly improving inspection efficiency and meeting production line cycle requirements. Simultaneously, by establishing a pixel-level spatial correspondence between the two types of image information and comparing local information based on this correspondence, it can accurately distinguish between the inherent design features of the SIM card tray (such as specular highlights, gradient colors, and fine textures) and actual surface defects (such as scratches, burrs, and dirt). This method overcomes problems such as overexposure, underexposure, or insufficient contrast caused by complex surface characteristics under a single fixed lighting method, effectively solving the dilemma between inspection accuracy and production cycle in existing technologies, and significantly improving the accuracy and reliability of SIM card tray defect detection. Attached Figure Description
[0010] Figure 1 This is a schematic diagram of a multi-dimensional visual inspection method for a mobile phone SIM card tray provided in this application.
[0011] Figure 2 This is a schematic diagram of a multi-dimensional visual inspection system for a mobile phone SIM card tray provided in this application. Detailed Implementation
[0012] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments. The components of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0013] Reference Figure 1 The diagram illustrates an embodiment of a multi-dimensional visual inspection method for a mobile phone SIM card tray according to the present invention, which may specifically include the following steps: S101, when the SIM card tray moves to the detection area, acquire first type image information and second type image information of the SIM card tray; wherein, the first type image information is obtained by configuring an illumination method to highlight the inherent design features of the SIM card tray, and the second type image information is obtained by configuring an illumination method to highlight potential surface defects of the SIM card tray. S102, process the first type of image information and the second type of image information to establish a pixel-level spatial correspondence between the first type of image information and the second type of image information; S103, based on pixel-level spatial correspondence, performs local information comparison on the first type of image information and the second type of image information. The local information comparison includes obtaining texture differences, brightness changes and edge structure information of local areas, and judging the inherent design features and actual surface defects of the mobile phone card tray based on texture differences, brightness changes and edge structure information, and obtaining the local information comparison result.
[0014] This application acquires two types of image information formed under different lighting conditions simultaneously, establishes their pixel-level spatial correspondence, and then compares local information. This effectively distinguishes the inherent design features of the mobile phone SIM card tray from actual surface defects, thereby significantly improving detection efficiency while ensuring detection accuracy and solving the dilemma between detection accuracy and production cycle in the prior art.
[0015] To make the technical solution of this application easier and clearer to understand, some key terms involved will be explained first.
[0016] A "SIM card tray" is a holder used to hold a mobile phone SIM card or memory card. Its surface may have various optical properties, such as mirror, matte, gradient color, or fine texture.
[0017] "Category I image information" refers to images acquired through specific lighting methods designed to highlight the inherent design features of a SIM card tray, such as its overall outline, structural lines, and brand logo. This type of lighting typically uses a uniform, diffused light source to reduce highlights and shadows, making the design features clearly visible.
[0018] "Second type of image information" refers to images acquired through a different specific lighting method designed to highlight potential surface defects in the SIM card tray, such as scratches, dents, dirt, and burrs. This lighting may employ directional light sources, dark-field illumination, or polarized light to enhance the contrast between the defects and the background.
[0019] "Pixel-level spatial correspondence" refers to the precise alignment of the first type of image information and the second type of image information at the pixel level, so that feature points at the same physical location in the two images can be accurately mapped to the same pixel coordinates.
[0020] "Local information comparison" refers to comparing and analyzing the texture, brightness, edge structure, and other information of corresponding local areas in two types of image information after establishing pixel-level spatial correspondence, in order to identify and distinguish inherent design features and actual surface defects.
[0021] Specifically, when the SIM card tray moves to the detection area, it is necessary to acquire both first-type and second-type image information. The first-type image information is obtained by configuring an illumination method to highlight the inherent design features of the SIM card tray. For example, a ring-shaped diffused light source or integrating sphere illumination can be used to uniformly illuminate the surface of the SIM card tray, clearly revealing its overall outline, structural lines, brand logo, and other inherent design features, while minimizing high-gloss reflections and shadow interference. The second-type image information is obtained by configuring an illumination method to highlight potential surface defects of the SIM card tray. For example, a low-angle directional light source, dark-field illumination, or polarized light illumination can be used. A low-angle directional light source can create shadows on minor scratches or dents on the surface, resulting in high-contrast lines or spots in the image. Dark-field illumination blocks direct light, receiving only light scattered by surface defects, making the defects appear bright against a dark background. Polarized light illumination can be used to detect changes in internal material stress or surface microstructure. Both types of image information can be acquired synchronously during a single movement of the SIM card tray using different cameras or by switching illumination methods within a very short time interval using the same camera, ensuring detection efficiency.
[0022] Subsequently, the first and second types of image information are processed to establish a pixel-level spatial correspondence between them. This step is fundamental to subsequent local information comparison. For example, a feature point matching-based method can be used. First, scale-invariant and rotation-invariant local feature points, such as SIFT or SURF feature points, are extracted from the two images. Then, initial matching point pairs are generated using feature descriptor matching algorithms (such as FLANN or Brute-Force matching). Next, iterative optimization algorithms such as RANSAC are used to filter the initial matching point pairs, removing outlier matching points to obtain interior point matching. Finally, the geometric transformation matrix (such as affine or perspective transformation) between the two images is calculated based on the interior point matching, and this matrix is used to geometrically correct one image, making it precisely aligned with the other image at the pixel level. Another implementation method is based on image registration algorithms. For example, methods based on cross-correlation or phase correlation can be used to achieve precise image alignment by calculating translation, rotation, and scaling parameters between the two images.
[0023] After establishing pixel-level spatial correspondence, local information comparison is performed on the first and second types of image information based on this correspondence. Local information comparison includes acquiring texture differences, brightness variations, and edge structure information of local regions. Based on these information, the inherent design features and actual surface defects of the SIM card tray are determined, yielding the local information comparison results. For example, for a specific local region, its average brightness value in the first and second types of image information can be calculated, along with its brightness ratio. Simultaneously, the edge intensity of this local region in the second type of image information is detected. If the average brightness value of this local region in the second type of image information is higher than a first preset brightness threshold, and the brightness ratio is lower than a first preset ratio threshold, while the edge intensity is higher than a first preset edge threshold, then it can be determined that the local region has an actual surface defect. Conversely, if the local region exhibits a smooth color gradient or continuous texture pattern in the first type of image information, and its average brightness value in the second type of image information is lower than a second preset brightness threshold, or its brightness ratio is higher than a second preset ratio threshold, then it can be determined that the local region is a region with normal optical performance. By comparing information from multiple dimensions, it is possible to effectively distinguish between the inherent design features of a SIM card tray (such as texture and gradient color) and actual surface defects (such as scratches and dirt), thus avoiding misjudgment.
[0024] The multi-dimensional visual inspection method for SIM card trays in this application solves the problem that traditional single-illumination methods cannot simultaneously detect inherent design features and potential surface defects by simultaneously acquiring first-type and second-type image information when the SIM card tray moves to the detection area. The first-type image information is obtained through an illumination method that highlights inherent design features, ensuring accurate identification of the normal appearance of the SIM card tray; the second-type image information is obtained through an illumination method that highlights potential surface defects, enhancing the contrast between defects and the background.
[0025] Subsequently, by processing these two types of image information, a pixel-level spatial correspondence was established, ensuring the accuracy of subsequent local information comparison. This step is crucial, as it enables precise alignment of two images acquired under different lighting conditions, laying the foundation for subsequent pixel-level comparison.
[0026] Finally, based on the established pixel-level spatial correspondence, local information comparison is performed on the two types of image information. By acquiring texture differences, brightness variations, and edge structure information of local regions and comprehensively analyzing this information, this method can effectively distinguish between the inherent design features of a SIM card tray and actual surface defects. For example, the fine texture of the SIM card tray surface may appear as a clear pattern in the first type of image information, while in the second type of image information, if scratches are present, abnormal brightness or edge variations will be superimposed on the texture. By comparing these differences, the system can accurately determine whether it is a design feature or a defect. This multi-dimensional, pixel-level comparison mechanism enables this method to overcome the limitations of traditional methods in complex surface detection, avoiding misjudging normal design features as defects or missing real defects.
[0027] Compared to multiple exposure methods, this application has a significant advantage in efficiency. Multiple exposure methods require multiple shots and light source switching for each SIM card tray, resulting in severely excessive inspection time and creating a production bottleneck. This application, by acquiring two types of image information simultaneously when the SIM card tray moves to the inspection area, avoids the time consumption of multiple exposures and light source switching, thereby greatly improving inspection efficiency and enabling it to meet the stringent cycle requirements of mobile phone production lines.
[0028] Furthermore, by establishing pixel-level spatial correspondences and comparing local information, this application can more precisely and accurately identify and distinguish inherent design features from actual surface defects. For example, a brand logo or decorative texture on a SIM card tray will be clearly presented in the first type of image information, while in the second type of image information, due to differences in lighting, these inherent features may exhibit different brightness or texture. However, through pixel-level correspondence and comparison, the system can identify these as normal design features rather than defects. Genuine scratches or dirt will exhibit significantly different textures, brightness, or edge structures from the surrounding area in both types of image information, thus being accurately identified. This refined comparison mechanism significantly improves the accuracy and robustness of detection, reducing false positives and false negatives.
[0029] This application further proposes that the steps for comparing the aforementioned local information include: Obtain the average brightness value of a local region in the first type of image information; Obtain the average brightness value of a local region in the second type of image information; The ratio of the local region's average brightness value in the second type of image information to the average brightness value of the local region in the first type of image information is calculated to obtain the brightness ratio. Detect the edge intensity of the local region in the second type of image information; When the average brightness value of the local region in the second type of image information is higher than the first preset brightness threshold, and the brightness ratio is lower than the first preset ratio threshold, and the edge intensity of the local region in the second type of image information is higher than the first preset edge threshold, then it is determined that there is an actual surface defect in the local region. When the local area presents a smooth color gradient or continuous texture pattern in the first type of image information, and the average brightness value of the local area in the second type of image information is lower than a second preset brightness threshold, or the brightness ratio is higher than a second preset ratio threshold, then the local area is determined to be a normal optical performance area.
[0030] Specifically, obtaining the average brightness value of a local area in both the first and second types of image information refers to summing the brightness values of all pixels in a specific local area of the image and dividing by the number of pixels to obtain the overall brightness level of that area. The first type of image information is obtained by configuring lighting methods to highlight the inherent design features of the SIM card tray, such as using diffuse or uniform lighting, making inherent features like lettering and grooves clearly visible while surface defects are less noticeable. The second type of image information is obtained by configuring lighting methods to highlight potential surface defects of the SIM card tray, such as using low-angle or high-contrast lighting, making minor scratches, dents, and other defects appear as obvious shadows or highlighted areas.
[0031] Furthermore, the calculation of the luminance ratio aims to quantify the difference in luminance response of the same local area under two different lighting conditions. This ratio can effectively reflect the sensitivity of the area to different lighting conditions, thereby helping to distinguish between inherent features and defects. For example, inherent features may not show significant luminance changes under two different lighting conditions, while defects will show significant luminance changes under lighting that highlights the defects.
[0032] Furthermore, edge detection operators such as Sobel and Canny can be used to detect the edge intensity of local regions in the second type of image information. Edge intensity reflects the degree of structural change in a local region; defects usually produce sharp edges, while smooth, inherent features have lower edge intensity.
[0033] In a preferred embodiment, a local area is identified as having an actual surface defect when the average brightness value of the second type of image information is higher than a first preset brightness threshold, the brightness ratio is lower than a first preset ratio threshold, and the edge intensity of the local area in the second type of image information is higher than a first preset edge threshold. This set of conditions comprehensively considers the high brightness performance of the defect under specific lighting, the difference in brightness response with inherent features, and the sharpness of its structure. For example, a scratch will appear very bright under lighting that highlights the defect (high average brightness value), but due to its material properties, the brightness difference under the two types of lighting may not be particularly large or may decrease slightly (brightness ratio lower than the preset threshold, indicating that there is a certain brightness under both types of lighting, but the defect is more prominent under the defect lighting), and the scratch edge will be very clear (high edge intensity).
[0034] On the other hand, when a local area exhibits a smooth color gradient or continuous texture pattern in the first type of image information, and the average brightness value of the local area in the second type of image information is lower than a second preset brightness threshold, or the brightness ratio is higher than a second preset ratio threshold, it is determined to be a normal optical performance area. This set of conditions aims to identify normal surface areas or inherent design features of a mobile phone SIM card tray. For example, a smooth surface area may have lower brightness (low average brightness value) under illumination of a prominent defect, or its brightness may vary significantly relative to the brightness under illumination of a prominent inherent feature (high brightness ratio, indicating high brightness under inherent feature illumination and low brightness under defect illumination), which is usually characteristic of a normal surface.
[0035] In some preferred embodiments, a specific example is given below. Suppose it is necessary to detect whether there are scratches on the surface of a mobile phone SIM card tray.
[0036] First, when the SIM card tray moves into the detection area, diffuse illumination is used to acquire first-type image information, which clearly shows the overall structure and inherent markings of the SIM card tray. Simultaneously, low-angle oblique illumination is used to acquire second-type image information, which makes even minor scratches on the surface appear as bright lines or shadows.
[0037] Next, an analysis is performed on a local area in the image, such as an area where scratches may exist.
[0038] 1. Obtain the average brightness value of the local region in the first type of image information, assuming it to be L1.
[0039] 2. Obtain the average brightness value of the local area in the second type of image information, assuming it to be L2.
[0040] 3. Calculate the luminance ratio R = L2 / L1.
[0041] 4. Detect the edge intensity of the local area in the second type of image information, assumed to be E2.
[0042] Set a first preset brightness threshold T_L1, a first preset ratio threshold T_R1, and a first preset edge threshold T_E1.
[0043] If L2 > T_L1, and R < T_R1, and at the same time E2 > T_E1, then the local area is determined to have an actual surface defect, that is, a scratch. For example, a scratch will be very bright (L2 is high) under low-angle illumination, but due to its own material characteristics, the brightness difference under the two illuminations may not be particularly large (the R value is relatively low), and the scratch edge is clear (E2 is high).
[0044] On the other hand, set a second preset brightness threshold T_L2 and a second preset ratio threshold T_R2.
[0045] If the local area shows a smooth color gradient in the first type of image information, and L2 < T_L2, or R > T_R2, then the local area is determined to be a normal optical performance area. For example, the smooth surface of a phone SIM card tray may have a low brightness (L2 is low) under low-angle illumination, or the brightness difference under the two illuminations is large (the R value is high, because it is bright under diffuse reflection and dark under low-angle illumination), which indicates that this area is a normal surface.
[0046] Through this quantization and threshold judgment mechanism, the scratches on the surface of the phone SIM card tray can be effectively distinguished from normal surface textures or design features, thus achieving high-precision automated detection.
[0047] The above-mentioned local information comparison of the first type of image information and the second type of image information based on pixel-level spatial correspondence, the local information comparison includes obtaining the texture difference, brightness change, and edge structure information of the local area, and judging the inherent design features and actual surface defects of the phone SIM card tray according to the texture difference, brightness change, and edge structure information. The steps of obtaining the local information comparison result include: Identify the transient foreign object features in the local area by analyzing whether there are high-frequency, discrete, and irregularly shaped brightness or texture abnormalities in the local area in the second type of image information, and the area corresponding to the brightness or texture abnormality in the first type of image information shows relatively smooth or low-contrast characteristics; According to the transient foreign object features, during the movement of the phone SIM card tray, perform continuous and short-time-interval multiple synchronous image acquisitions on the local area, and compare the position and morphological changes of the transient foreign object features in the consecutive images, and evaluate the persistence of the transient foreign object features through the position and morphological changes to obtain a persistence evaluation result; Based on the persistence evaluation results of the transient foreign object feature, the judgment of the local information comparison is corrected, wherein the correction includes: when the transient foreign object feature is determined to be a transient environmental anomaly, the texture difference, brightness change and edge structure information caused by the transient foreign object anomaly are ignored, and the transient foreign object feature is determined to be a normal actual surface; when the transient foreign object feature shows stability in position and shape, the transient foreign object feature is determined to be a potential permanent surface defect.
[0048] Specifically, identifying transient foreign object features within a local area involves cross-analyzing first-class and second-class image information to discover high-frequency, discrete, and irregularly shaped brightness or texture anomalies in the second-class image information, while the corresponding areas of these anomalies exhibit relatively smooth or low-contrast characteristics in the first-class image information. This difference is key to distinguishing transient foreign objects from inherent design features of the SIM card tray. For example, a tiny dust particle might appear as a bright or high-contrast discrete point under illumination highlighting a defect, but under illumination highlighting the inherent design, its impact on the overall design features would be negligible, and therefore it might be inconspicuous or appear as a smooth background in the first-class image information. Assessing the persistence of transient foreign object features can be achieved by continuously capturing multiple synchronous images of the same local area at short time intervals during the movement of the SIM card tray. By comparing the position and morphological changes of the transient foreign object features in these continuous images, it can be determined whether they are permanent defects that remain relatively stationary as the SIM card tray moves, or transient anomalies that disappear or move with time or environmental changes. For example, a scratch on a SIM card tray will maintain a relatively fixed position and shape as the tray moves, while a passing dust particle will show rapid changes in position or disappearance in consecutive images. In practical applications, the purpose of correcting the judgment of local information comparison is to adjust the initial local information comparison results based on the persistent evaluation results of transient foreign object features. Specifically, when a transient foreign object feature is judged as a transient environmental anomaly, such as exhibiting instability or disappearance in consecutive images, the resulting texture differences, brightness changes, and edge structure information are ignored, and it is identified as a normal actual surface to avoid false alarms. Conversely, when a transient foreign object feature exhibits stability in position and shape, such as consistently existing in consecutive images and having a relatively fixed position, it is identified as a potential permanent surface defect, requiring further processing or marking.
[0049] This application's solution effectively addresses the problem of misjudgment caused by transient environmental anomalies in traditional methods by introducing a mechanism for identifying and continuously evaluating transient foreign object features. Firstly, by comparing the differences between the first and second types of image information in local areas, transient foreign object features that are significant under prominent defect illumination but not obvious under prominent inherent design illumination can be preliminarily identified. This avoids misjudging transient environmental anomalies as actual surface defects, significantly improving the accuracy and reliability of detection.
[0050] In some preferred embodiments, a specific example is given below. Suppose that a tiny dust particle temporarily lands on the surface of the SIM card tray as it moves to the detection area. When acquiring the first type of image information, the dust particle may not be noticeable in the image because it has little impact on the inherent design features of the SIM card tray. However, when acquiring the second type of image information, due to the lighting scheme that highlights potential surface defects, the dust particle will appear as a bright or high-contrast discrete point, initially identified as a transient foreign object feature in a local area. To assess the persistence of this feature, the system continuously acquires multiple images of this local area within a very short period of time while the SIM card tray continues to move. For example, five frames are acquired continuously within 0.1 seconds. By comparing the position and shape of the "foreign object feature" in these five frames, if the feature is found to move rapidly, change drastically in shape, or disappear completely in subsequent frames, the system determines it to be a transient environmental anomaly (i.e., a dust particle). At this point, based on the continuous evaluation results, the system will correct the judgment of local information comparison, ignoring the texture differences, brightness changes, and edge structure information caused by the dust particle, and classifying it as a normal actual surface. Conversely, if the "foreign object feature" exists consistently in five consecutive frames of images, and its position and shape remain stable relative to the surface of the SIM card tray, the system will determine that it exhibits stability in position and shape, classifying it as a potential permanent surface defect (e.g., a tiny scratch or dent), and including it in the final defect report. In this way, the solution of this application can effectively avoid misjudging transient dust particles as permanent defects, thereby improving the accuracy of detection.
[0051] In some embodiments described above, this application proposes processing first-type and second-type image information to establish a pixel-level spatial correspondence between them. However, in practical applications, directly aligning the original image at the pixel level may result in high computational cost, sensitivity to noise, and difficulty in handling large translational deviations, thus affecting the accuracy and efficiency of subsequent local information comparison. To address this, this application further proposes a method for establishing a pixel-level spatial correspondence between the first-type and second-type image information, which effectively solves the aforementioned problems through multi-scale processing and refined alignment.
[0052] The steps described above for processing the first type of image information and the second type of image information to establish a pixel-level spatial correspondence between the first type of image information and the second type of image information include: Construct an image pyramid using the first type of image information and the second type of image information; In the coarsest layer of the image pyramid, the translational deviation between the first type of image information and the second type of image information is calculated using the phase correlation method; Based on the translation deviation, the translation deviation is refined layer by layer, and sub-pixel interpolation is performed on the original image layer to obtain the sub-pixel level translation amount. Based on the subpixel level translation, a geometric transformation is performed on the second type of image information so that the second type of image information overlaps with the first type of image information at the pixel level; Once it is determined that the second type of image information is aligned with the first type of image information, an alignment quality assessment is performed on the aligned image to obtain the alignment quality assessment result.
[0053] Specifically, constructing an image pyramid involves continuously downsampling and filtering the original image to generate a series of image layers with decreasing resolution. The bottom layer represents the original image, and the top layer represents the image with the lowest resolution. This multi-scale representation method can effectively handle image features at different scales and provides a foundation for subsequent coarse-to-fine alignment strategies. Specifically, in the coarsest layer of the image pyramid, the phase correlation method is used to calculate the translational deviation between the first type of image information and the second type of image information. The phase correlation method is an image registration technique based on Fourier transform, which determines the translational amount between two images by calculating the phase of their cross-power spectrum. This method is robust to changes in image content (such as brightness and contrast) and is particularly suitable for estimating pure translational motion. Calculating this at the coarsest layer allows for a fast and efficient estimation of large translational deviations, providing a good initial value for subsequent fine alignment and avoiding getting trapped in local optima.
[0054] Furthermore, based on the translation deviation, the translation deviation is refined layer by layer, and sub-pixel interpolation is performed on the original image layer to obtain the sub-pixel level translation amount. After obtaining the translation deviation of the coarsest layer, this deviation is passed down and refined layer by layer. Specifically, the translation deviation calculated in the previous layer is used as the initial estimate for the current layer, and a more accurate calculation is performed in the current layer. When processing the original image layer, in order to achieve higher alignment accuracy, sub-pixel interpolation techniques (e.g., bilinear interpolation, bicubic interpolation, or Gaussian fitting-based interpolation methods) are used to further accurately estimate the translation amount, thereby obtaining the sub-pixel level translation amount. This ensures the accuracy of image alignment and can capture minute spatial misalignments.
[0055] Therefore, based on the sub-pixel level translation, a geometric transformation is performed on the second type of image information, making the second type of image information coincide with the first type of image information at the pixel level. Once the precise sub-pixel level translation is obtained, a geometric transformation matrix (usually a translation matrix) can be constructed and applied to the second type of image information. Through this geometric transformation, the second type of image information is precisely moved in space, making it highly coincide with the first type of image information at the pixel level, thereby establishing a pixel-level spatial correspondence between the two.
[0056] In a preferred embodiment, after determining that the second type of image information is aligned with the first type of image information, an alignment quality assessment is performed on the aligned image to obtain an alignment quality assessment result. To verify the effectiveness and accuracy of the alignment operation, a quality assessment of the aligned image is required after the geometric transformation is completed. Assessment methods may include calculating the cross-correlation coefficient, mean square error (MSE), structural similarity index (SSIM), or pixel differences in a specific region between the two images. These assessment metrics can quantify the accuracy of the alignment and generate alignment quality assessment results, facilitating monitoring and adjustment of the alignment process and ensuring the reliability of subsequent defect detection.
[0057] In some preferred embodiments, it is assumed that on a SIM card tray production line, the tray moves to the inspection station via a conveyor belt. Due to slight vibrations of the conveyor belt or minor deviations in camera mounting, each captured image of the SIM card tray (first type image information and second type image information) may have a slight translational misalignment. To accurately compare these two types of images to identify defects, an image pyramid is first constructed. At the top layer of the pyramid (the lowest resolution layer), a coarse translation amount is quickly calculated using phase correlation; for example, it is found that the second type image information is shifted to the right by approximately 10 pixels relative to the first type image information. Subsequently, using this 10-pixel translation amount as the initial value, a more refined calculation is performed on the next layer of the pyramid (slightly higher resolution), possibly yielding a translation amount of 9.8 pixels. This process is iterated layer by layer until the original image layer is reached. At the original image layer, a translation amount accurate to 0.1 pixels or even 0.01 pixels, such as 9.75 pixels, is finally determined through subpixel interpolation. Based on this subpixel-level translation, a precise geometric transformation (translation) is performed on the second type of image information to perfectly overlap with the first type of image information at the pixel level. Finally, the system calculates the cross-correlation coefficient between the two aligned images; for example, a high score of 0.99 indicates excellent alignment quality. In this way, the subsequent local information comparison module can confidently perform local information comparisons. Any detected texture differences, brightness variations, or edge structure information will accurately reflect the inherent design features or actual surface defects of the SIM card tray, rather than being caused by image misalignment.
[0058] In this regard, this application further proposes that the above-mentioned alignment quality assessment steps include: The alignment quality score is continuously recorded; the trend of the alignment quality score is calculated; when a downward trend of the alignment quality score is detected, an alignment quality decline warning is generated; representative image pairs are selected for high-precision alignment to obtain high-precision alignment parameters; the deviation of the high-precision alignment parameters from historical stable parameters is compared; and an alignment deviation accumulation warning is generated based on the cumulative increasing trend of the alignment parameter deviation.
[0059] Specifically, "continuously recording the alignment quality score" means that after each image alignment operation is completed, the system calculates a quantified alignment quality score and stores it in a database or log file for historical tracking and trend analysis. This alignment quality score can be calculated based on various indicators, such as the mutual information, correlation coefficient, mean square error, or inlier ratio of feature point matching in the aligned images. Its purpose is to quantify the accuracy and reliability of the current image alignment.
[0060] "Calculating the trend of alignment quality score changes" refers to identifying patterns in alignment quality scores over time through statistical analysis of historical alignment quality scores, such as using moving averages, exponential smoothing, or regression analysis. The aim is to discover potential signs of alignment performance degradation, rather than focusing solely on the results of a single alignment.
[0061] "Generate an alignment quality decline warning when a downward trend in the alignment quality score is detected" means that when the calculated trend of the alignment quality score indicates that the alignment performance is continuously deteriorating, such as when the alignment score is below a certain threshold for several consecutive periods, or when the rate of decline exceeds a preset value, the system will automatically trigger a warning signal. This warning signal can notify operators or maintenance systems, indicating that equipment inspection or calibration may be necessary. Its purpose is to achieve early warning and intervention for alignment problems.
[0062] "Selecting representative image pairs for high-precision alignment to obtain high-precision alignment parameters" refers to the system selecting representative image pairs from historical image data after an alignment quality degradation warning is triggered, or within a preset maintenance cycle. These pairs are typically image pairs containing rich textures, clear edges, or specific defect features. The system then uses more time-consuming but higher-precision methods (such as deep learning-based feature matching or more refined sub-pixel registration algorithms) to align these image pairs, obtaining more accurate alignment parameters. The purpose is to obtain baseline-level alignment parameters for subsequent deviation comparisons.
[0063] "Comparing the deviation between the high-precision alignment parameters and the historical stable parameters" refers to comparing the current alignment parameters (such as translation, rotation angle, scaling factor, etc.) obtained through high-precision alignment with the historical stable parameters established by the system under stable operating conditions. The historical stable parameters can be ideal alignment parameters that have been verified over a long period after the system's initial installation or most recent calibration. The purpose is to quantify the degree of deviation between the current alignment state and the ideal state.
[0064] "Generate an alignment deviation cumulative warning based on the cumulative increasing trend of the alignment parameter deviation" means that when the alignment parameter deviation not only exists but also shows a continuous increasing or accumulating trend, the system will generate a higher-level warning. This cumulative increasing trend may indicate deeper problems such as mechanical wear, structural deformation, or permanent misalignment of the optical system. Its purpose is to prompt for more in-depth fault diagnosis and maintenance to prevent further deterioration of system performance.
[0065] The steps described above for processing the first type of image information and the second type of image information to establish a pixel-level spatial correspondence between them include: The first type of image information and the second type of image information are preprocessed to enhance image features and suppress noise, resulting in preprocessed first type of image information and second type of image information; Local feature points with scale invariance and rotation invariance are extracted from the preprocessed first-class image information and second-class image information; Based on the local feature points, a feature point matching strategy is applied to generate initial matching point pairs; The initial matching point pairs are filtered by an iterative optimization method to remove abnormal matching points and obtain interior point matching. Based on the inlier matching, a geometric transformation matrix is calculated between the first type of image information and the second type of image information. The geometric transformation matrix can describe translation, rotation, scaling and minor perspective distortion. Based on the geometric transformation matrix, the second type of image information is geometrically corrected to make it coincide with the first type of image information at the pixel level, thereby establishing a pixel-level spatial correspondence between the first type of image information and the second type of image information.
[0066] Specifically, preprocessing can be understood as performing a series of operations on the original image data to improve image quality and make it more suitable for subsequent feature extraction and matching. For example, methods such as Gaussian filtering and median filtering can be used to suppress random noise in the image, or histogram equalization and gamma correction can be used to enhance image contrast, thereby making key features in the image more prominent. Its purpose is to provide a high-quality input image for subsequent feature point extraction.
[0067] Local feature points refer to unique, repeatable pixel regions or points in an image that are robust to image transformations (such as scale changes, rotation, and illumination changes). For example, algorithms such as Scale Invariant Feature Transform (SIFT), Speed-Up Robust Feature Transform (SURF), or Oriented Fast and Rotationally Shortened (ORB) can be used to extract these feature points. These algorithms can identify points with significant local structure, such as corners and freckles, and generate descriptors to characterize the surrounding texture information. Scale invariance and rotation invariance mean that even if the SIM card tray is slightly enlarged, reduced, or rotated during detection, these feature points and their descriptors can still be accurately identified and matched.
[0068] In practical applications, feature point matching strategies refer to establishing correspondences by comparing the descriptor similarity of feature points in different images. For example, the nearest neighbor matching algorithm can be used, which finds the feature point with the closest descriptor distance in the second type of image information for each feature point in the first type of image information as a candidate match. To improve the accuracy of matching, a ratio test (such as Lowe's ratio test) can be further used, which requires that the distance ratio between the nearest neighbor and the second nearest neighbor be less than a certain preset threshold to exclude fuzzy matches. The purpose is to initially establish the association between corresponding feature points in two images.
[0069] Furthermore, iterative optimization methods aim to identify and eliminate erroneous matches (i.e., outlier matches) from the initial matched point pairs, thereby obtaining a set of highly reliable matched point pairs (i.e., interior point matches). For example, the Random Sample Consensus (RANSAC) algorithm can be used. This algorithm estimates the geometric transformation model by randomly selecting a minimum number of matched point pairs, then calculates the error of all other matched point pairs under that model, and considers point pairs with errors less than a preset threshold as interior points. This process iterates multiple times, selecting a new random subset in each iteration, and ultimately choosing the model that can explain the most interior points. The goal is to ensure that the matched point pairs used to calculate the geometric transformation matrix have high accuracy and consistency.
[0070] Therefore, the geometric transformation matrix can be understood as a mathematical model used to describe the geometric relationship between two images. For example, when only translation and rotation exist between the images, a Euclidean transformation matrix can be used; when translation, rotation, and uniform scaling exist, a similarity transformation matrix can be used; when translation, rotation, scaling, and shearing exist, an affine transformation matrix can be used; and when there is slight perspective distortion, a homography matrix can be used. This matrix is calculated through interior point matching and can accurately quantify the geometric deviation of the second type of image information relative to the first type of image information. Its purpose is to provide accurate transformation parameters for subsequent image correction.
[0071] Finally, geometric correction is performed on the second type of image information based on the geometric transformation matrix. This means mapping each pixel in the second type of image information to a new position according to the calculated geometric transformation matrix. For example, bilinear interpolation or bicubic interpolation can be used to calculate the corresponding pixel value at the new pixel position, thereby generating a corrected image. After geometric correction, the feature points and structures in the second type of image information will achieve high-precision overlap with the corresponding feature points and structures in the first type of image information at the pixel level, thus establishing a precise pixel-level spatial correspondence.
[0072] In some preferred embodiments, a specific example is given below. Suppose that on a SIM card tray production line, multi-dimensional visual inspection of the SIM card trays is required. First, when the SIM card tray moves to the inspection area, different lighting methods are configured to acquire a first type of image information highlighting the inherent design features of the SIM card tray and a second type of image information highlighting potential surface defects. Due to vibrations on the production line or minor deviations in the placement of the SIM card tray, there may be slight translation and rotation between these two types of image information.
[0073] To establish accurate pixel-level spatial correspondences, the acquired first and second types of image information are first preprocessed. For example, Gaussian filtering is applied to remove image noise, and contrast enhancement is performed to highlight image details. Then, scale-invariant and rotation-invariant local feature points are extracted from the preprocessed image information. For example, the SIFT algorithm can be used to detect and describe these feature points. Next, based on the descriptors of these SIFT feature points, an initial matching point pair is generated using a FLANN matcher. Since the initial matching point pairs may contain a large number of incorrect matches, the RANSAC algorithm is used to iteratively optimize and filter these initial matching point pairs, removing abnormal matches to obtain a set of highly reliable interior point matches.
[0074] Based on these interior point matches, an affine transformation matrix is calculated, which accurately describes the translation, rotation, and scaling relationships between the first and second types of image information. Finally, this affine transformation matrix is used to perform geometric correction on the second type of image information, ensuring precise pixel-level overlap with the first type. In this way, even with minor geometric deviations, accurate alignment of the two types of image information is guaranteed, providing a reliable basis for subsequent local information comparison and enabling accurate judgment of inherent design features and actual surface defects of the SIM card tray.
[0075] This application further proposes the following steps for obtaining interior point matches by filtering initial matching point pairs and removing abnormal matching points through the above-mentioned iterative optimization method: Based on the descriptor similarity of local feature points, the initial matching point pairs are initially screened to remove point pairs with similarity below a preset threshold, thus obtaining the initially screened matching point pairs. The pre-selected matching point pairs are projected into the image space, and a geometric consistency constraint is set for a certain local area based on the geometry of the SIM card tray. The geometric consistency constraint of the local area takes into account the local geometric features of the repetitive texture or gradient color area on the surface of the SIM card tray. In each iteration, a subset of matching point pairs is randomly selected, and a geometric transformation model is generated based on the subset of matching point pairs. Calculate the reprojection error of all matching point pairs under the geometric transformation model, and weight the reprojection error according to the geometric consistency constraint of the local region to obtain the first weighted reprojection error; Based on the first weighted reprojection error, identify and remove abnormal matching points whose error is greater than a preset threshold, repeat the iteration until convergence, and obtain a set of in-point matching.
[0076] Specifically, preliminary screening of initial matching point pairs based on the descriptor similarity of local feature points refers to evaluating the reliability of the match by comparing the distance or similarity between the feature descriptors (such as SIFT, SURF, ORB, etc.) of the matching point pairs. Point pairs with similarity below a preset threshold are considered low-quality matches or potentially abnormal matches and are thus eliminated in an early stage to reduce the computational burden and improve efficiency in subsequent iterations.
[0077] The process involves projecting the initially selected matching point pairs into image space and setting geometric consistency constraints for local regions based on the geometry of the SIM card tray. The aim is to leverage the known geometric characteristics of the SIM card tray to guide the selection of matching points. For example, corresponding geometric constraints can be defined for straight edges, arcs, or repetitive textures in specific areas on the SIM card tray. These constraints help distinguish between true matches and ambiguous matches caused by repetitive textures or gradient areas. For instance, if the relative positions of two matching points in image space do not conform to the known geometry of the SIM card tray, they may be considered outliers.
[0078] In practical applications, in each iteration, a subset of matching point pairs is randomly selected, and a geometric transformation model is generated based on these matching point pairs. This typically employs RANSAC (Random Sample Consensus) or its variants. By randomly selecting the minimum number of matching point pairs to estimate the geometric transformation model, interference from outlier point pairs in the model estimation can be effectively avoided.
[0079] Furthermore, the reprojection error of all matching point pairs under this geometric transformation model is calculated, and the reprojection error is weighted according to the geometric consistency constraints of the local region to obtain the first weighted reprojection error. This means that for matching points located in regions with strong geometric constraints (e.g., known straight lines or arcs), their reprojection errors may be given higher weights, or their error thresholds may be more strictly limited. This weighting process enables the algorithm to more accurately identify true interior points when dealing with challenging regions.
[0080] Therefore, based on the first weighted reprojection error, abnormal matching points with errors greater than a preset threshold are identified and removed. This process is repeated iteratively until convergence, resulting in a set of interior point matches. This process continues until the model parameters stabilize or the preset number of iterations is reached, thereby ensuring that the final set of interior point matches has high geometric consistency and reliability.
[0081] As a specific implementation, suppose that when detecting a SIM card tray, its surface contains a region with a repetitive, finely mesh-like texture and a gradient region of colors from dark to light. In traditional iterative optimization methods, due to the repetitiveness of the mesh texture, multiple similar matching point pairs may be generated. This makes the RANSAC algorithm susceptible to interference from these ambiguous matches when selecting a subset to fit the model, resulting in an inaccurate geometric transformation model. Similarly, the gradient region, due to the lack of obvious local features, may also lead to low descriptor similarity of matching point pairs or unstable matches at the edges.
[0082] This application further proposes the following steps for processing the first type of image information and the second type of image information to establish a pixel-level spatial correspondence between the first type of image information and the second type of image information: The first type of image information and the second type of image information are preprocessed to enhance image features and suppress noise, resulting in preprocessed first type of image information and second type of image information; Local feature points are extracted from the preprocessed first-type and second-type image information; Based on the local feature points, an initial pair of matching points is generated; The initial matching point pairs are filtered to obtain interior point matches; Based on the in-point matching, a non-rigid deformation field is calculated between the first type of image information and the second type of image information. The non-rigid deformation field can describe the local bending or twisting of the mobile phone card tray. Based on the non-rigid deformation field, local deformation correction is performed on the second type of image information to make it coincide with the first type of image information at the pixel level, thereby establishing a pixel-level spatial correspondence between the first type of image information and the second type of image information.
[0083] Specifically, preprocessing can be understood as performing a series of operations on the original image to optimize its quality, making it more suitable for subsequent feature extraction and matching. For example, methods such as Gaussian filtering and median filtering can be used to suppress random noise in the image, while contrast enhancement algorithms (such as histogram equalization or adaptive histogram equalization) can improve the visibility of features in the image. The goal is to provide a clear, high-quality input image for subsequent feature extraction.
[0084] Local feature points refer to unique and repeatable pixel regions in an image, such as corner points, spots, or edge points. These feature points remain relatively stable under image transformations (such as rotation, scaling, and brightness changes). In practical applications, algorithms such as SIFT (Scale Invariant Feature Transform), SURF (Speed-Up Robust Feature Transform), and ORB (Oriented Fast and Rotation Invariant BRIEF) can be used to extract these local feature points. The purpose is to provide a foundation for establishing reliable correspondences between different images.
[0085] Initial matching point pairs refer to the preliminary correspondence established by comparing the similarity of descriptors of local feature points extracted from the first type of image information and the second type of image information. For example, Euclidean distance or Hamming distance can be used to measure the similarity between feature descriptors, and feature point pairs with a distance less than a preset threshold are used as initial matches. The purpose is to initially identify potentially corresponding regions in two images.
[0086] Filtering initial matching point pairs to obtain interior point matching involves using iterative optimization methods to remove outlier matching points (outside points) that do not conform to the overall geometric transformation model, while retaining reliable matching points (inside points) that conform to the model. For example, the RANSAC (Random Sample Consensus) algorithm or its variants can be used to gradually eliminate outliers by randomly selecting a subset to fit the model and iteratively verifying it. The purpose is to ensure the accuracy of subsequent deformation field calculations and avoid errors introduced by outlier matching points.
[0087] A non-rigid deformation field can be understood as a mathematical model describing the local non-uniform deformation of an image. It can capture non-rigid changes such as local bending, twisting, or stretching that may exist on the surface of a SIM card tray. Unlike rigid transformations (which only involve translation, rotation, and scaling), a non-rigid deformation field allows different regions of an image to deform in different ways. For example, non-rigid deformation fields can be calculated and represented using thin-plate splines (TPS), free-form deformation (FFD), or mesh-based deformation models. Its purpose is to accurately quantify and describe the local non-rigid deformation of a SIM card tray between two images.
[0088] Local deformation correction refers to pixel-level geometric adjustments to second-type image information based on a calculated non-rigid deformation field, ensuring that the shape and position of local regions are precisely aligned with first-type image information. For example, interpolation algorithms (such as bilinear or bicubic interpolation) can be used to resample and reposition each pixel of the second-type image information according to the deformation field. The aim is to eliminate image misalignment caused by local bending or twisting of the SIM card tray, achieving high-precision pixel-level spatial correspondence.
[0089] In some preferred embodiments, a specific example is given below. Suppose that on a SIM card tray production line, after a SIM card tray undergoes a stamping process, its edge area may experience slight local warping or distortion, causing a non-rigid local misalignment between the first type of image information and the second type of image information when it is captured by the camera in the detection area.
[0090] Specifically, the first and second types of image information are first sent to the preprocessing module. In this module, the image may be subjected to Gaussian blur to smooth noise, and local contrast may be enhanced through adaptive histogram equalization, making the edges and texture features of the SIM card tray clearer.
[0091] Subsequently, SIFT feature points are extracted from the two preprocessed images. These feature points, due to their scale and rotation invariance, can effectively handle minor viewpoint changes that may occur during image acquisition. Based on the descriptors of these SIFT feature points, initial matching point pairs are generated using a nearest neighbor matching algorithm.
[0092] Next, to remove erroneous matches from the initial matching point pairs, the RANSAC algorithm is used for filtering. During the RANSAC iteration, a small number of matching point pairs are randomly selected to estimate a non-rigid geometric transformation model (e.g., a thin plate spline model), and then the reprojection error of all other matching point pairs under this model is calculated. Points with errors less than a preset threshold are considered interior points and used to optimize the model. After multiple iterations, a highly reliable set of interior point matches is finally obtained.
[0093] Based on this set of interior point matching, a non-rigid deformation field is calculated between the first and second types of image information. This deformation field is represented as a two-dimensional vector field, where each vector indicates the direction and distance that a corresponding pixel in the second type of image information needs to move to align with its corresponding point in the first type of image information. For example, for a warped edge region of a SIM card tray, the deformation field would indicate that the pixels in that region need to undergo specific local displacements.
[0094] Finally, based on the calculated non-rigid deformation field, local deformation correction is performed on the second type of image information. This is typically achieved through image resampling techniques, such as bicubic interpolation, to remap the pixels of the second type of image information to new locations according to the deformation field. After correction, the edges and textures of the SIM card tray in the second type of image information will achieve high-precision pixel-level overlap with the corresponding areas in the first type of image information, effectively compensating for any local warping. This establishes a precise pixel-level spatial correspondence, providing accurate input for subsequent local information comparison.
[0095] In some of the above embodiments, filtering initial matching point pairs to obtain interior point matching is a key step in establishing pixel-level spatial correspondence. However, in practical applications, SIM card trays may exhibit non-rigid deformations such as local bending or twisting, and their surfaces may possess complex optical characteristics such as repetitive textures, gradient color areas, high-gloss reflections, shadows, or local occlusions. These factors may lead to a large number of abnormal matching points in the initial matching point pairs, and traditional filtering methods based on rigid geometric consistency are difficult to effectively distinguish between true and abnormal matches, thus affecting the calculation accuracy of the non-rigid deformation field and the final alignment effect. If the above problems are not addressed, subsequent local information comparison results may be inaccurate, thereby affecting the defect detection accuracy of the SIM card tray. To address this, this application further proposes a more robust and accurate initial matching point pair filtering method. This method introduces non-rigid geometric consistency constraints and a non-rigid geometric transformation model to adapt to the complex deformation and surface characteristics of the SIM card tray, thereby improving the accuracy of interior point matching.
[0096] The steps described above for filtering the initial matching point pairs to obtain interior point matches include: Based on the descriptor similarity of local feature points, the initial matching point pairs are initially screened to remove point pairs with similarity below a preset threshold, thus obtaining the initially screened matching point pairs. The pre-selected matching point pairs are projected into the image space, and a non-rigid geometric consistency constraint is set for a certain local area based on the geometry of the SIM card tray and the preset deformation range. The non-rigid geometric consistency constraint considers the local geometric features of the repetitive texture or gradient color area on the surface of the SIM card tray, as well as the geometric characteristics of the high-light reflection, shadow or local occlusion area. In each iteration, a subset of matching point pairs is randomly selected, and a non-rigid geometric transformation model is generated based on the subset of matching point pairs. The non-rigid geometric transformation model can describe the local bending or twisting of the mobile phone card tray. Calculate the reprojection error of all matching point pairs under the non-rigid geometric transformation model, and weight the reprojection error according to the non-rigid geometric consistency constraint of the local region to obtain the second weighted reprojection error. Based on the second weighted reprojection error, identify and remove abnormal matching points with errors greater than a preset threshold, and repeat the iteration until convergence to obtain interior point matching.
[0097] Specifically, preliminary screening based on the descriptor similarity of local feature points involves comparing the distance or similarity between the descriptors (e.g., SIFT, SURF, or ORB descriptors) of two feature points in a matching point pair, and discarding point pairs with similarity below a preset threshold as mismatches. The aim is to quickly remove a large number of obviously erroneous matches, reducing the computational burden of subsequent iterations.
[0098] The process involves projecting the initially selected matching point pairs into the image space and setting a non-rigid geometric consistency constraint for a local region based on the phone SIM card tray's geometry and a preset deformation range. This can be understood as introducing prior knowledge of the phone SIM card tray's local deformation characteristics into the matching point pair selection process. This non-rigid geometric consistency constraint not only considers the potential ambiguity of local geometric features caused by repetitive textures or gradient color areas on the phone SIM card tray surface but also pays special attention to image distortions caused by specular reflections, shadows, or partial occlusion, thus enabling the selection process to better adapt to these complex situations. For example, for regions with repetitive textures, the constraint can relax the requirements for precise point pair positions, focusing more on matching the overall texture pattern; for specular areas, lower weight can be given to matching errors caused by brightness variations.
[0099] In practical applications, in each iteration, a subset of matching point pairs is randomly selected, and a non-rigid geometric transformation model is generated based on these matching point pairs. The purpose is to gradually construct a non-rigid deformation model that can accurately describe the local bending or twisting of the phone card holder through iterative optimization methods such as Random Sample Consensus (RANSAC). This model can be a Thin-Plate Spline (TPS) model, a Radial Basis Function (RBF) model, or other models that can capture local nonlinear deformation.
[0100] Furthermore, the reprojection error of all matching point pairs under this non-rigid geometric transformation model is calculated, and the reprojection error is weighted according to the non-rigid geometric consistency constraints of the local region to obtain the second weighted reprojection error. This means that for matching points located in complex regions (such as specular highlights, shadows, or areas with repeated textures), their reprojection errors will be assigned different weights to reflect the inherent uncertainty of matching in these regions. For example, under non-rigid geometric consistency constraints, matching points in specular regions may be considered interior points even if their reprojection errors are slightly larger, because specular highlights themselves can cause instability in local image features.
[0101] Finally, based on the second weighted reprojection error, outlier matching points with errors exceeding a preset threshold are identified and removed. This process is repeated iteratively until convergence, yielding interior point matching. This process continuously optimizes the non-rigid geometric transformation model and eliminates outliers, ensuring that the final interior point matching set accurately reflects the true non-rigid deformation of the SIM card tray.
[0102] Secondly, referring to Figure 2 This application further proposes a multi-dimensional visual inspection system for mobile phone SIM card trays, the system comprising: The image information acquisition module 201 is used to acquire a first type of image information and a second type of image information of the mobile phone card tray when the mobile phone card tray moves to the detection area. The first type of image information is obtained by configuring an illumination method to highlight the inherent design features of the mobile phone card tray, and the second type of image information is obtained by configuring an illumination method to highlight potential surface defects of the mobile phone card tray. The spatial correspondence establishment module 202 is used to process the first type of image information and the second type of image information to establish a pixel-level spatial correspondence between the first type of image information and the second type of image information. The local information comparison module 203 is used to compare the local information of the first type of image information and the second type of image information based on the pixel-level spatial correspondence. The local information comparison includes obtaining the texture difference, brightness change and edge structure information of the local area, and judging the inherent design features and actual surface defects of the mobile phone card tray based on the texture difference, brightness change and edge structure information, and obtaining the local information comparison result.
[0103] 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 multi-dimensional visual inspection method for mobile phone SIM card trays, characterized in that, include: When the SIM card tray moves to the detection area, a first type of image information and a second type of image information of the SIM card tray are acquired; wherein, the first type of image information is obtained by configuring an illumination method to highlight the inherent design features of the SIM card tray, and the second type of image information is obtained by configuring an illumination method to highlight potential surface defects of the SIM card tray; The first type of image information and the second type of image information are processed to establish a pixel-level spatial correspondence between the first type of image information and the second type of image information; Based on the pixel-level spatial correspondence, local information comparison is performed on the first type of image information and the second type of image information. The local information comparison includes obtaining texture differences, brightness changes and edge structure information of local areas, and judging the inherent design features and actual surface defects of the mobile phone card tray based on the texture differences, brightness changes and edge structure information, so as to obtain the local information comparison result.
2. The multi-dimensional visual inspection method for a mobile phone SIM card tray according to claim 1, characterized in that, The step of comparing local information of the first type of image information and the second type of image information based on the pixel-level spatial correspondence, wherein the local information comparison includes obtaining texture differences, brightness changes and edge structure information of local regions, and judging the inherent design features and actual surface defects of the mobile phone card tray based on the texture differences, brightness changes and edge structure information, and obtaining the local information comparison result includes: Obtain the average brightness value of the local region in the first type of image information; Obtain the average brightness value of the local region in the second type of image information; The ratio of the average brightness value of the local region in the second type of image information to the average brightness value of the local region in the first type of image information is calculated to obtain the brightness ratio. Detect the edge intensity of the local region in the second type of image information; When the average brightness value of the local area in the second type of image information is higher than the first preset brightness threshold, and the brightness ratio is lower than the first preset ratio threshold, and the edge intensity of the local area in the second type of image information is higher than the first preset edge threshold, then it is determined that there is an actual surface defect in the local area. When the local area presents a smooth color gradient or continuous texture pattern in the first type of image information, and the average brightness value of the local area in the second type of image information is lower than a second preset brightness threshold, or the brightness ratio is higher than a second preset ratio threshold, then the local area is determined to be a normal optical performance area.
3. The multi-dimensional visual inspection method for a mobile phone SIM card tray according to claim 1, characterized in that, The step of comparing local information of the first type of image information and the second type of image information based on the pixel-level spatial correspondence, wherein the local information comparison includes obtaining texture differences, brightness changes and edge structure information of local regions, and judging the inherent design features and actual surface defects of the mobile phone card tray based on the texture differences, brightness changes and edge structure information, and obtaining the local information comparison result includes: Transient foreign object features in the local area are identified by analyzing whether the local area has high-frequency, discrete and irregularly shaped brightness or texture anomalies in the second type of image information, and the corresponding area of the brightness or texture anomalies in the first type of image information exhibits relatively smooth or low-contrast features. Based on the transient foreign object characteristics, during the movement of the SIM card tray, multiple synchronous image acquisitions of the local area are performed continuously with short time intervals. The position and morphological changes of the transient foreign object characteristics in the continuous images are compared, and the persistence of the transient foreign object characteristics is evaluated by the position and morphological changes to obtain a persistence evaluation result. Based on the continuous evaluation results of the transient foreign object feature, the judgment of local information comparison is corrected. The correction includes: when the transient foreign object feature is determined to be a transient environmental anomaly, the texture difference, brightness change and edge structure information caused by the transient foreign object anomaly are ignored, and the transient foreign object feature is determined to be a normal actual surface; when the transient foreign object feature shows stability in position and shape, the transient foreign object feature is determined to be a potential permanent surface defect.
4. The multi-dimensional visual inspection method for a mobile phone SIM card tray according to claim 1, characterized in that, The step of processing the first type of image information and the second type of image information to establish a pixel-level spatial correspondence between the first type of image information and the second type of image information includes: Construct an image pyramid using the first type of image information and the second type of image information; In the coarsest layer of the image pyramid, the translational deviation between the first type of image information and the second type of image information is calculated using the phase correlation method; Based on the translation deviation, the translation deviation is refined layer by layer, and sub-pixel interpolation is performed on the original image layer to obtain the sub-pixel level translation amount. Based on the subpixel level translation, a geometric transformation is performed on the second type of image information so that the second type of image information overlaps with the first type of image information at the pixel level; Once it is determined that the second type of image information is aligned with the first type of image information, an alignment quality assessment is performed on the aligned image to obtain the alignment quality assessment result.
5. The multi-dimensional visual inspection method for a mobile phone SIM card tray according to claim 4, characterized in that, The step of evaluating the alignment quality of the aligned image after determining that the second type of image information is aligned with the first type of image information, and obtaining the alignment quality evaluation result, includes: Continuously record alignment quality scores; Calculate the trend of the alignment quality score; When a downward trend in alignment quality score is detected, an alert for declining alignment quality is generated. Representative image pairs are selected and aligned with high precision to obtain high precision alignment parameters. Compare the deviations between the high-precision alignment parameters and the historical stable parameters; Based on the cumulative increasing trend of alignment parameter deviation, an early warning of cumulative alignment deviation is generated.
6. The multi-dimensional visual inspection method for a mobile phone SIM card tray according to claim 1, characterized in that, The step of processing the first type of image information and the second type of image information to establish a pixel-level spatial correspondence between the first type of image information and the second type of image information includes: The first type of image information and the second type of image information are preprocessed to enhance image features and suppress noise, resulting in preprocessed first type of image information and second type of image information. Extract scale-invariant and rotation-invariant local feature points from the preprocessed first-class and second-class image information; Based on the local feature points, a feature point matching strategy is applied to generate initial matching point pairs; The initial matching point pairs are filtered by an iterative optimization method to remove abnormal matching points and obtain interior point matching. Based on the inlier matching, a geometric transformation matrix is calculated between the first type of image information and the second type of image information. The geometric transformation matrix can describe translation, rotation, scaling and minor perspective distortion. Based on the geometric transformation matrix, the second type of image information is geometrically corrected so that it coincides with the first type of image information at the pixel level, thereby establishing a pixel-level spatial correspondence between the first type of image information and the second type of image information.
7. The multi-dimensional visual inspection method for a mobile phone SIM card tray according to claim 6, characterized in that, The step of filtering the initial matching point pairs and removing abnormal matching points through an iterative optimization method to obtain interior point matches includes: Based on the descriptor similarity of local feature points, the initial matching point pairs are initially screened to remove point pairs with similarity below a preset threshold, thus obtaining the initially screened matching point pairs. The pre-selected matching point pairs are projected into the image space, and a geometric consistency constraint is set for a certain local area based on the geometry of the SIM card tray. The geometric consistency constraint of the local area takes into account the local geometric features of the repetitive texture or gradient color area on the surface of the SIM card tray. In each iteration, a subset of matching point pairs is randomly selected, and a geometric transformation model is generated based on the subset of matching point pairs. Calculate the reprojection error of all matching point pairs under the geometric transformation model, and weight the reprojection error according to the geometric consistency constraint of the local region to obtain the first weighted reprojection error; Based on the first weighted reprojection error, identify and remove abnormal matching points whose error is greater than a preset threshold, repeat the iteration until convergence, and obtain a set of in-point matching.
8. The multi-dimensional visual inspection method for a mobile phone SIM card tray according to claim 1, characterized in that, The step of processing the first type of image information and the second type of image information to establish a pixel-level spatial correspondence between the first type of image information and the second type of image information includes: The first type of image information and the second type of image information are preprocessed to enhance image features and suppress noise, resulting in preprocessed first type of image information and second type of image information. Local feature points are extracted from the preprocessed first-class and second-class image information; Based on the local feature points, an initial pair of matching points is generated; The initial matching point pairs are filtered to obtain interior point matches; Based on the in-point matching, a non-rigid deformation field is calculated between the first type of image information and the second type of image information. The non-rigid deformation field can describe the local bending or twisting of the mobile phone card tray. Based on the non-rigid deformation field, local deformation correction is performed on the second type of image information to make it coincide with the first type of image information at the pixel level, thus establishing a pixel-level spatial correspondence between the first type of image information and the second type of image information.
9. A multi-dimensional visual inspection method for a mobile phone SIM card tray according to claim 8, characterized in that, The step of filtering the initial matching point pairs to obtain interior point matches includes: Based on the descriptor similarity of local feature points, the initial matching point pairs are initially screened to remove point pairs with similarity below a preset threshold, thus obtaining the initially screened matching point pairs. The pre-selected matching point pairs are projected into the image space, and a non-rigid geometric consistency constraint is set for a certain local area based on the geometry of the SIM card tray and the preset deformation range. The non-rigid geometric consistency constraint considers the local geometric features of the repetitive texture or gradient color area on the surface of the SIM card tray, as well as the geometric characteristics of the high-light reflection, shadow or local occlusion area. In each iteration, a subset of matching point pairs is randomly selected, and a non-rigid geometric transformation model is generated based on the subset of matching point pairs. The non-rigid geometric transformation model can describe the local bending or twisting of the mobile phone card tray. Calculate the reprojection error of all matching point pairs under the non-rigid geometric transformation model, and weight the reprojection error according to the non-rigid geometric consistency constraint of the local region to obtain the second weighted reprojection error. Based on the second weighted reprojection error, identify and remove abnormal matching points with errors greater than a preset threshold, and repeat the iteration until convergence to obtain interior point matching.
10. A multi-dimensional visual inspection system for mobile phone SIM card trays, characterized in that, The system includes: The image information acquisition module is used to acquire a first type of image information and a second type of image information of the SIM card tray when the SIM card tray moves to the detection area. The first type of image information is obtained by configuring an illumination method to highlight the inherent design features of the SIM card tray, and the second type of image information is obtained by configuring an illumination method to highlight potential surface defects of the SIM card tray. The spatial correspondence establishment module is used to process the first type of image information and the second type of image information to establish a pixel-level spatial correspondence between the first type of image information and the second type of image information; The local information comparison module is used to compare the first type of image information and the second type of image information based on the pixel-level spatial correspondence. The local information comparison includes acquiring the texture difference, brightness change and edge structure information of the local area, and judging the inherent design features and actual surface defects of the mobile phone card tray based on the texture difference, brightness change and edge structure information to obtain the local information comparison result.