CN-121998966-A - SIM card surface defect detection analysis method
Abstract
The invention relates to the technical field of SIM card detection, in particular to a method for detecting and analyzing surface defects of an SIM card, which comprises the following steps of S1, constructing a template library, storing a multi-scale template in the template library, S2, collecting multi-view images of the SIM card, aligning the multi-view images to the same world coordinate standard after preprocessing, S3, extracting texture, color and shape characteristics from the aligned images, obtaining comprehensive defect characteristics through weighted fusion, S4, carrying out adaptation matching on the multi-scale template based on the template library and the comprehensive defect characteristics, determining a defect area through dynamic threshold segmentation, S5, carrying out classification recognition on the defect area, judging defect level according to a dynamic threshold, S6, realizing self-evolution optimization of the template library through increment updating and redundancy elimination, and realizing improvement of detection precision, efficiency, self-adaption capability and practicability.
Inventors
- YU SHENGWU
- LIU SHUAI
- WANG KUN
Assignees
- 新恒汇电子股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260305
Claims (10)
- The method for detecting and analyzing the surface defects of the SIM card is characterized by comprising the following steps: s1, constructing a template library, wherein the template library stores multi-scale templates and provides a matching reference and a characteristic comparison reference for SIM card defect detection; S2, acquiring multi-view images of the SIM card, and aligning the multi-view images to the same world coordinate reference through a homography matrix after preprocessing; s3, extracting texture, color and shape features from the aligned images, and obtaining comprehensive defect features through weighted fusion ; S4, multi-scale templates based on template library and comprehensive defect characteristics Performing adaptation matching, and determining a defect area through dynamic threshold segmentation; s5, classifying and identifying the defect area, and judging the defect level according to the dynamic threshold value; And S6, based on the characteristic drift quantization result of the detection data, realizing the self-evolution optimization of the template library through incremental updating and redundant elimination.
- 2. The SIM card surface defect detection analysis method according to claim 1, wherein in S2, the 3×3 homography matrix H is solved by RANSAC algorithm, multi-view image space mapping is completed based on homogeneous coordinate transformation relation, 2D pixel coordinates after registration are obtained through normalization reduction, and finally all view images are aligned to the same world coordinate reference.
- 3. The SIM card surface defect detection analysis method of claim 1, wherein S3 includes the sub-steps of: s3-1, extracting texture features T LBP by adopting an LBP algorithm; S3-2, extracting color features C HSV in an HSV color space; S3-3, constructing a Hu invariant moment extraction shape feature S Hu ; S3-4, adaptively solving and fusing optimal weight coefficients through a Bayes optimization algorithm, and performing weighted adaptive fusion on texture features T LBP , color features C HSV and shape features S Hu based on the optimal weight coefficients to obtain comprehensive defect features 。
- 4. The SIM card surface defect detection and analysis method of claim 1, wherein S4 includes the sub-steps of: S4-1, constructing a template pyramid according to a scale level based on multi-scale templates in a template library, wherein each layer of template corresponds to a preset defect size interval; s4-2, carrying out feature matching on the comprehensive defect feature map and each layer of templates of the template pyramid one by one, and calculating the matching confidence coefficient of each layer of templates; S4-3, calculating an initial segmentation threshold by adopting an improved OTSU algorithm, adjusting the initial threshold by combining Bayesian optimization to obtain an optimal defect segmentation threshold, performing binarization segmentation on the comprehensive defect feature map based on the optimal segmentation threshold, distinguishing a defect area from a background area, and determining the position, the outline and the pixel range of the defect area.
- 5. The SIM card surface defect detection analysis method of claim 4, wherein the step S4-1 includes the sub-steps of: S4-1-1, collecting equivalent diameters of defects of each sample based on a SIM card history defect sample to form a defect size set D= { D 1 ,d 2 ,…,d i ,…,d n }, wherein D i is the equivalent diameter of the ith defect in mu m; s4-1-2, solving defect size distribution function through nuclear density estimation Defining probability density distribution characteristics of defect sizes; s4-1-3 based on size distribution function Dividing the scale level by adopting a self-adaptive threshold segmentation method; s4-1-4, with original reference template Based on the scale level, a corresponding level template is generated, a template pyramid p= { T 1 ,T 2 ,…,T m ,…,T k }, m=1, 2,..k, Is an m-th layer template.
- 6. The method for detecting and analyzing surface defects of SIM card as recited in claim 5, wherein the defect size distribution function in S4-1-2 The expression is as follows: ; Wherein K is% ) As a function of the gaussian kernel, For core bandwidth, n is the total amount of historical defect samples.
- 7. The method of claim 6, wherein the number of scale layers is k in S4-1-3, and the m-th template scale is defined as a conditional mean of defect sizes in the corresponding size interval, which is expressed as follows: ; Wherein, the 、 And m is the boundary of the defect size interval corresponding to the m-th layer scale, and m is [1, k ].
- 8. The method for detecting and analyzing surface defects of SIM card as recited in claim 7, wherein the m-th layer template in S4-1-4 The generation formula of (2) is as follows: ; Wherein (x, y) is the template pixel coordinates; representing a two-dimensional convolution operation; is Gaussian smoothing kernel, its kernel variance 。
- 9. The SIM card surface defect detection and analysis method of claim 8, wherein the step S4-2 includes the sub-steps of: s4-2-1, constructing an image scale space I m corresponding to the template pyramid one by one according to the SIM card image I to be detected, wherein the image scale space I m is expressed as follows: ; S4-2-2, extracting template based on scale invariant feature points Screening the optimal matching characteristic points with the characteristic point set of the image, and carrying out space coordinate alignment to obtain an alignment transformation matrix M m ; s4-2-3, calculating the matching confidence coefficient C m of the template and the image area based on the aligned features, and taking the matching confidence coefficient C m as a defect identification basis.
- 10. The SIM card surface defect detection analysis method of claim 9, wherein the matching confidence Cm is calculated by the formula: ; Wherein, the For the confidence level determination threshold value, Representing the feature points of the image Mapping back to the template coordinate system through inverse transformation, when Cm is not less than And if the matching is judged to be successful, the corresponding area has defects.
Description
SIM card surface defect detection analysis method Technical Field The invention relates to the technical field of SIM card detection, in particular to a method for detecting and analyzing surface defects of an SIM card. Background The intelligent SIM card is used as an integrated circuit chip and an external interface, has wide application scene, and surface defect detection in the production process is a core link of SIM card production quality control. The surface of the SIM card is easy to have the defects of scratch, abrasion, dirt, leakage seal, tape connecting deviation and the like, and the defects not only affect the appearance consistency of products, but also can cause functional faults, and strict requirements are put on the detection precision, efficiency and adaptability. The conventional SIM card surface defect detection method has a plurality of technical pain points that a fixed-scale artificial template is adopted in traditional detection, scale deformation caused by shooting distance or angle change cannot be adapted, template quality is good and is low in manual updating efficiency, characteristic drift of production batches is difficult to deal with, a multi-view image lacks an accurate space alignment mechanism, defect characteristics are poor in fusion property, edge or front and back defects are easy to miss, a single characteristic extraction and a fixed segmentation threshold are adopted, sensitivity to noise and environmental change is high, detection omission and false detection rate are high, the static storage of a template library has no self-optimizing capability, manual frequent maintenance is required, and suitability and detection efficiency are difficult to meet the requirement of mass production. Disclosure of Invention The invention aims to solve the technical problems of overcoming the defects of the prior art and providing a method for detecting and analyzing the surface defects of the SIM card. The invention is realized by the following technical proposal that the method for detecting and analyzing the surface defects of the SIM card comprises the following steps: s1, constructing a template library, wherein the template library stores multi-scale templates and provides a matching reference and a characteristic comparison reference for SIM card defect detection; S2, acquiring multi-view images of the SIM card, and aligning the multi-view images to the same world coordinate reference through a homography matrix after preprocessing; s3, extracting texture, color and shape features from the aligned images, and obtaining comprehensive defect features through weighted fusion ; S4, multi-scale templates based on template library and comprehensive defect characteristicsPerforming adaptation matching, and determining a defect area through dynamic threshold segmentation; s5, classifying and identifying the defect area, and judging the defect level according to the dynamic threshold value; And S6, based on the characteristic drift quantization result of the detection data, realizing the self-evolution optimization of the template library through incremental updating and redundant elimination. And in the step S2, a3 multiplied by 3 homography matrix H is solved through a RANSAC algorithm, multi-view image space mapping is completed based on homogeneous coordinate transformation relation, registered 2D pixel coordinates are obtained through normalization reduction, and finally all view images are aligned to the same world coordinate reference. S3 comprises the following substeps: s3-1, extracting texture features T LBP by adopting an LBP algorithm; S3-2, extracting color features C HSV in an HSV color space; S3-3, constructing a Hu invariant moment extraction shape feature S Hu; S3-4, adaptively solving and fusing optimal weight coefficients through a Bayes optimization algorithm, and performing weighted adaptive fusion on texture features T LBP, color features C HSV and shape features S Hu based on the optimal weight coefficients to obtain comprehensive defect features 。 The step S4 comprises the following substeps: S4-1, constructing a template pyramid according to a scale level based on multi-scale templates in a template library, wherein each layer of template corresponds to a preset defect size interval; s4-2, carrying out feature matching on the comprehensive defect feature map and each layer of templates of the template pyramid one by one, and calculating the matching confidence coefficient of each layer of templates; S4-3, calculating an initial segmentation threshold by adopting an improved OTSU algorithm, carrying out fine adjustment on the initial threshold by combining Bayesian optimization to obtain an optimal defect segmentation threshold, carrying out binarization segmentation on the comprehensive defect feature map based on the optimal segmentation threshold, distinguishing a defect region from a background region, and determining the position, the contour and the