Electronic carrier tape box defect optical detection method based on multistage feature region registration
By employing multi-level feature region registration and matrix difference operations, the error problem caused by deformation in carrier box inspection is solved, achieving efficient and accurate defect detection that is adaptable to boxes of various materials and structures.
Patent Information
- Application Number
- CN202510854044.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2045-06-24
AI Technical Summary
Existing carrier box defect detection methods rely on a single template or fixed feature point registration, which cannot effectively compensate for registration errors caused by vibration or elastic deformation, resulting in a high false positive rate and low detection efficiency, and cannot meet the needs of real-time detection.
A multi-level feature region registration method is adopted, which extracts the secondary registration region through the main feature points of the primary reference region, dynamically captures deformation, and combines vectorization and matrix difference operations to reduce algorithm complexity and adapt to the diversity of box structures.
It significantly improves the robustness and accuracy of detection, reduces the false detection rate, and increases the detection speed, meeting the detection needs of high-speed production lines and is compatible with various materials and irregularly shaped box structures.
Smart Images

Figure CN120876366A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of optical inspection technology, and in particular to an optical inspection method for defects in electronic tape carrier boxes based on multi-level feature region registration. Background Technology
[0002] Electronic carrier tapes are crucial transport tools in semiconductor packaging, testing, and surface mount processes. Their internal, continuously spaced boxes (also known as pockets) store and transport miniature components such as chips, integrated circuits, and discrete devices. In use, electronic components are placed into the boxes of the carrier tape, and then a cover tape is sealed on top to form a closed package, protecting the components from contamination and damage during transport. During automated placement, the automated placement equipment uses precise positioning via the carrier tape index holes to peel off the cover tape segment by segment and pick up the components for placement on the PCB board.
[0003] If there are defects in the carrier tape box structure, serious issues can lead to component displacement, damage, or pick-up failure, resulting in poor placement or even production line shutdown, causing significant losses. Therefore, detecting defects in the carrier tape box is essential. Statistics show that the main defects in carrier tape boxes include: box deformation, poor molding, duplicate drilling, misaligned holes, foreign objects inside the box, box breakage, blind holes, and burrs. Furthermore, due to differences in material, component size, and manufacturer specifications, the box structure of carrier tapes exhibits a high degree of diversity. This diversity in defect types and box shapes presents a challenge in defect detection at the box level.
[0004] Existing detection solutions often rely on a single template or fixed feature point registration, lacking a compensation mechanism for registration errors caused by vibration or elastic deformation during carrier tape production. This leads to a significant increase in the false positive rate. In addition, the algorithms often use full-image scanning or complex feature extraction, resulting in decreased detection efficiency and even missed detections, failing to meet the requirements of real-time detection on the production line.
[0005] For example, a dual-station carrier image inspection system (CN106839986A) based on machine vision and machine learning includes the following steps: First, the carrier image is divided into small rectangular regions. Then, the grayscale value and gradient value of each small rectangular region are detected independently. Next, the quality of the pixels is judged based on the radian scale and gradient value of the pixels. Finally, the presence of defects is determined based on the number of bad pixels. This system has a high computational load and slow detection speed.
[0006] A visual inspection method for semiconductor carrier tape production quality based on image filtering (CN117522875A) includes the following steps: acquiring a grayscale image of semiconductor carrier tape production; acquiring all target image blocks of the grayscale image of semiconductor carrier tape production based on the detail richness of each image block; acquiring the feature participation degree and carrier tape evaluation feature degree of each target image block; acquiring a filtered grayscale image of semiconductor carrier tape production based on the filtering weight of each high detail feature pixel of the grayscale image of semiconductor carrier tape production, thereby obtaining the evaluation result of semiconductor carrier tape quality. However, this method cannot calculate the area of defects and cannot determine the acceptable severity of defects by setting an area threshold.
[0007] A machine vision-based carrier tape inspection method (CN116309383A) includes the following steps: building a hardware platform, acquiring a predetermined number of qualified hole pattern images, and obtaining standard hole pattern images after preprocessing; performing area segmentation for hole pattern positioning and obtaining the position coordinates of each hole pattern; matching the hole pattern to be tested with a standard template, and judging whether the hole pattern is abnormal based on the degree of matching. This method judges the quality of the carrier tape by judging the hole pattern, but in actual production, abnormalities are often not limited to hole pattern. Judging only the hole pattern cannot identify defects such as box deformation, poor forming, repeated punching, round hole misalignment, foreign objects inside the box, box damage, blind holes, and burrs. Summary of the Invention
[0008] To address the aforementioned technical problems, this invention proposes an automated optical detection method for defects in electronic carrier boxes based on multi-level feature region registration. The method extracts the secondary registration region by locating the principal feature points of the primary reference region. This mechanism enables dynamic capture and compensates for registration errors. Furthermore, by vectorizing the reference region and the registration region and performing simple difference operations on them using matrices, the algorithm's time complexity is significantly reduced, enabling it to meet the requirements of real-time detection. Moreover, the structural features of the box are not utilized in defining the reference region and generating the registration region, allowing the algorithm to be compatible with diverse box structures.
[0009] The present invention is achieved by at least one of the following technical solutions.
[0010] An optical inspection method for defects in electronic tape carrier boxes based on multi-level feature region registration includes the following steps:
[0011] A. Construct a reference region in the acquired standard carrier image and obtain the local coordinates of the main feature points;
[0012] B. Select a sub-region containing N consecutive box center holes in the image of the carrier tape to be tested, and mark the local coordinate set and global coordinate set of each sub-feature point;
[0013] C. Extract the dynamic registration region in the global coordinate system;
[0014] D. The dynamic registration area and the reference area are differentially processed. If there is a defect, the defect location is located and the defect area is calculated.
[0015] Furthermore, in step A, the reference area R ref The standard carrier image is constructed by slicing it using the following formula:
[0016] R ref =Origin_Img[y ref :y ref +H ref ,x ref :x ref +W ref (1) In the formula (x) ref ,y ref ) indicates the reference area R ref The top left corner of the image is located at global coordinates (H) in a standard carrier image. ref W ref ) indicates the reference area R ref Height and width.
[0017] Furthermore, the principal feature point in step A is the center of the circle at the center of the box. The coordinates of the center are obtained through a center fitting algorithm. The specific steps are as follows:
[0018] a. For the reference area R ref Perform grayscale thresholding to generate a binary image;
[0019] b. Obtain the contour point set of the center hole of the box using the Canny edge detection algorithm;
[0020] c. Using the least squares method based on the random sampling consensus algorithm to fit the contour point set, the coordinates of the center of the box's central hole are obtained, which are the coordinates of the principal feature points in the local coordinate system (Cx). ref Cy ref ).
[0021] Furthermore, in step B, the number N of the center holes in the box and the number of holes punched in a single batch during the carrier tape production process should satisfy the following formula:
[0022] N = M + 1 (2)
[0023] Where M represents the number of holes punched in a single process during the carrier tape production process.
[0024] Furthermore, in step B, the local coordinate system is based on the sub-region R. subThe global coordinate system is established with the top left corner of the carrier image to be tested as the origin. The steps to obtain the global coordinates of N sub-feature points are as follows:
[0025] 1) Subregion R sub Divide the holes evenly into N parts along the direction of hole distribution;
[0026] 2) In each of the constructed local coordinate systems, the local coordinate set of each feature point is calculated using a circle center fitting algorithm. (Cx i Cy i () represents the local coordinates of the i-th sub-feature point;
[0027] 3) In the global coordinate system, the global coordinate set of each sub-feature point is recursively calculated using the following formula.
[0028]
[0029] In the formula (x sub ,y sub) For subregion R sub The coordinates of the top-left corner in the global coordinate system, (Cx ia Cy ia ) represents the global coordinates of the i-th sub-feature point.
[0030] Furthermore, in step C, in the global coordinate system, with R... i =Img[y Ri :y Ri +H ref ,x Ri :x Ri +W ref Get the dynamic registration region Img represents the image of the carrier tape to be tested, (H) ref W ref ) indicates the reference area R ref Height and width, R i Represents the i-th dynamic registration region, (x Ri ,y Ri ) represents the coordinates of the top-left corner of the i-th dynamic registration region in the global coordinate system.
[0031] Furthermore, in step D, the difference processing steps are as follows:
[0032] (I) Calculate R for each dynamic registration region i and reference area R ref Difference:
[0033] Res i (x,y)=|R ref (x,y)-R i(x,y)| (4)
[0034] In the formula Res i (x,y) represents the difference result of the i-th dynamic registration region; R ref (x,y) is a functional representation of the reference region, R i (x,y) is a function for the i-th dynamic registration region; x and y represent the coordinates of the pixel in the x-th row and y-th column of the image;
[0035] (ii) Regarding Res i Bin is generated by performing grayscale thresholding on (x,y). i (x,y):
[0036]
[0037] In the formula, TH(x,y) is the set grayscale threshold matrix, and the dimension of the grayscale threshold matrix is the same as that of Res. i (x,y) are the same;
[0038] (III) Statistics Bin i The number of pixels with a value of 255 in (x,y) is denoted as suspected defective pixels, and Bin is used to further analyze these pixels. i (x,y) is filtered and morphological opening is performed to remove isolated noise points. Then, the defect contour is extracted by Canny and its minimum bounding rectangle is constructed to realize defect localization. The defect area is calculated based on the number of pixels in the defect area.
[0039] Furthermore, the following steps are used to calculate the difference between the dynamically registered region and the reference region:
[0040] a) Region vectorization:
[0041] Reference area R ref Expanded into a dimension of 1×(H) ref ×W ref The reference vector v) ref , where H ref W ref The reference area R is the reference area. ref Height and width;
[0042] For each dynamic registration region R i Expanding the vectors i = 1, 2, ..., N, we obtain the registration vector v. i The dimension is also 1×(H) ref ×W ref );
[0043] b) Construct the region matrix:
[0044] Stack the N registration vectors to construct a structure with dimension N×(H).ref ×M ref The matrix V:
[0045]
[0046] Where v N R represents the Nth dynamic registration region. N The registration vector obtained by expansion;
[0047] c) Matrix difference operation:
[0048] Calculate the difference between each row in V and the reference vector to generate the difference matrix D:
[0049] D = |V-1 N×1 ·v ref | (7)
[0050] The difference matrix D is binary-segmented according to the reference region, and then each row is restored to its original dimension.
[0051] A computer device according to the present invention includes a memory and a processor, the memory being electrically connected to the processor, the memory storing a computer program, which, when executed by the processor, causes the processor to implement the method described herein.
[0052] The present invention provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor implements the method described herein.
[0053] Compared with existing technologies, the beneficial effects of the present invention are as follows:
[0054] This invention employs a multi-level feature region dynamic registration mechanism to adaptively eliminate local positional deviations in the carrier tape caused by material deformation and stamping vibration, thereby improving the pixel-level alignment accuracy of differential operations. Compared to traditional global registration methods, this method significantly improves robustness to local deformations and reduces the false detection rate. Furthermore, this invention utilizes region vectorization and matrix batch processing to greatly reduce time complexity, thus increasing processing speed and meeting the inspection requirements of high-speed production lines. Simultaneously, this invention is compatible with electronic carrier tapes of various materials and various irregularly shaped box structures. Using this invention has significant practical engineering application value in reducing the workload of defect detection at electronic carrier tape boxes, ensuring quality control in complex high-speed stamping scenarios, and improving defect detection efficiency and accuracy. Attached Figure Description
[0055] Figure 1 This is a flowchart of an automated optical inspection method for defects at the electronic carrier box based on multi-level feature region registration;
[0056] Figure 2This is a schematic diagram of the global and local coordinates of an automated optical inspection method for defects at the electronic carrier box based on multi-level feature region registration.
[0057] Figure 3 This is a schematic diagram of the dynamic registration region generated by an automated optical inspection method for defects at the electronic carrier box based on multi-level feature region registration.
[0058] Figure 4 This is a schematic diagram of the differential calculation and post-processing flow of an automatic optical inspection method for defects at the electronic carrier box based on multi-level feature region registration. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be described in further detail below with reference to the embodiments and accompanying drawings.
[0060] like Figure 1 As shown, the optical detection method for electronic tape carrier box defects based on multi-level feature region registration in this embodiment includes:
[0061] Step 10: Construct a reference region and obtain the local coordinates of the main feature points, specifically including:
[0062] Select a suitable camera and lens based on the required detection accuracy and range, and adjust the brightness of the appropriate light source until the image is clear. To directly obtain a grayscale image and avoid the step of image grayscale conversion, and to make the image acquisition lightweight, this invention uses a monochrome camera. Before acquiring the image, the Region of Interest (ROI) is set for the camera acquisition, and the carrier tape portion is extracted as the raw image. The acquisition of both the standard carrier tape image and the carrier tape image to be tested is performed under the set ROI of the camera. After acquiring the raw image, Gaussian filtering is performed on the raw image using a (7,7) Gaussian kernel to eliminate image noise, and then subsequent steps are performed.
[0063] Acquire standard carrier tape images, and define a reference region R containing the complete box structure within the standard carrier tape images. ref Extract the reference region R ref Boundary dimension (H) ref W ref ) and the coordinates of the principal feature points in the local coordinate system (Cx ref Cy ref ), H ref W ref Representing the reference area R respectively ref Height and width.
[0064] Specifically, a reference region R containing the complete box structure is defined by slicing the standard carrier image using the following formula.ref :
[0065] R ref =Origin_Img[y ref :y ref +H ref ,x ref :x ref +W ref (1)
[0066] In the formula (x ref ,y ref ) indicates the reference area R ref The top left corner of the image is located at global coordinates (H) in a standard carrier image. ref W ref ) indicates the reference area R ref Height and width.
[0067] Reference area R ref The main feature point is the center hole of the box (the box is a feature area on the electron carrier tape with a hole in the center; this area is located based on this hole). Figure 2 The diagram includes a structural schematic of the carrier tape (although the actual box shape can vary, all holes inside the box are located at the center of a circle). The coordinates of this circle are obtained using a center-fitting algorithm. The specific steps are as follows:
[0068] 1) For the reference area R ref Perform grayscale thresholding to generate a binary image;
[0069] 2) Obtain the contour point set of the center hole of the box using the Canny edge detection algorithm;
[0070] 3) The least squares method based on the Random Sampling Consensus (RANSAC) algorithm is used to fit the contour point set, and the coordinates of the center of the box's central hole are obtained, which are the coordinates of the principal feature points in the local coordinate system (Cx). ref Cy ref ).
[0071] Step 20: Construct the feature sampling region: Select a sub-region R in the carrier image to be tested that contains N consecutive box center holes. sub As a feature sampling region, a global coordinate set of N sub-feature points is obtained, specifically including:
[0072] Select a sub-region R in the image of the carrier tape to be tested, which contains N consecutive complete box center holes. sub (subregion R) sub It is a rectangular area, and the top and bottom edges of this rectangle must be close to the center of the pillars to facilitate the subsequent calculation of R. subDivide the box into N equal parts (where a pillar refers to the area between two boxes, and the left and right sides should be as symmetrical as possible about the center hole of the box), and mark the local coordinate set of each sub-feature point (the center of the center hole of the box). and global coordinate set (Cx i Cy i (Cx) represents the local coordinates of the i-th sub-feature point. ia Cy ia () represents the global coordinates of the i-th sub-feature point;
[0073] The number of center holes N in the box and the number of holes M punched in a single batch during the carrier tape manufacturing process should satisfy the following formula:
[0074] N = M + 1 (2)
[0075] The local coordinate system of the sub-feature points is based on the sub-region R. sub The origin is at the top left corner, such as Figure 2 In the x′O′y′ coordinate system, the global coordinate system of the sub-feature points has its origin at the top left corner of the carrier image to be tested, such as... Figure 2 The xOy coordinate system.
[0076] The steps to obtain the global coordinates of N sub-feature points are as follows:
[0077] a. Subregion R sub Divide the holes evenly into N parts along the direction of hole distribution;
[0078] b. In each of the constructed local coordinate systems, calculate the coordinate set of each sub-feature point using the circle center fitting algorithm in step 10.
[0079] c. In the global coordinate system, the global coordinate set of each sub-feature point is recursively calculated using the following formula:
[0080]
[0081] In the formula (x sub ,y sub) For subregion R sub The coordinates of the top left corner in the global coordinate system.
[0082] Step 30: Generate dynamic registration regions and obtain N dynamic registration regions, specifically including:
[0083] In the global coordinate system, with R i =Img[y Ri :y Ri +H ref ,x Ri :x Ri +W refGet the dynamic registration region Img represents the image of the carrier tape to be tested, (H) ref W ref ) indicates the reference area R ref Height and width, R i Represents the i-th dynamic registration region, (x Ri ,y Ri ) represents the coordinates of the top-left corner of the i-th dynamic registration region in the global coordinate system.
[0084] Step 40: Calculate the dynamic registration region With reference area R ref Difference operations: Batch matrix operations: Vectorize the N dynamically registered regions to obtain N registration vectors, then construct a region matrix from the N registration vectors and perform matrix difference operations. This is used to perform batch operations on the N dynamically registered regions, specifically including:
[0085] For the reference area R ref and a single dynamic registration region R i The specific steps for processing are as follows:
[0086] a) Calculate R for each dynamic registration region i and reference area R ref Difference:
[0087] Res i (x,y)=|R ref (x,y)-R i (x,y)| (4)
[0088] In the formula Res i (x,y) represents the difference result of the i-th dynamic registration region; R ref (x,y) is a functional representation of the reference region, R i (x,y) is the function representation of the i-th dynamic registration region, where x and y are the two independent variables of a two-dimensional function of the image, representing the coordinates of the pixel in the x-th row and y-th column of the image.
[0089] b) Regarding Res i Bin is generated by performing grayscale thresholding on (x,y). i (x,y):
[0090]
[0091] In the formula, TH(x,y) is a predefined grayscale threshold matrix, and the dimension of the grayscale threshold matrix is the same as that of Res. i (x,y) are the same;
[0092] As one embodiment, the predefined grayscale threshold matrix is a set threshold. The value of each element in the TH(x,y) matrix can be arbitrarily set; for example, all elements can be set to 5. The specific value needs to be adjusted according to the actual situation. The smaller the value, the higher the sensitivity, but the higher the false alarm rate. Based on practical experience, the value of the elements in the TH(x,y) matrix is more suitable between 10 and 15. The predefined method can be randomly generated and matched with Res... i A matrix of the same dimensions as (x,y) such that the values of the matrix elements are between 10 and 15.
[0093] c) Statistical binary image Bin i The number of pixels with a value of 255 in (x,y) is denoted as suspected defective pixels, and Bin is used to further analyze these pixels. i (x,y) is filtered and morphological opening is performed to remove isolated noise points. Then, the defect contour is extracted by Canny and its minimum bounding rectangle is constructed (such as by using the minAreaRect algorithm in OpenCV) to realize defect localization. The defect area S is calculated based on the number of pixels in the defect area.
[0094] The following steps are used to calculate the difference between the dynamic registration region and N reference regions:
[0095] 1. Region vectorization:
[0096] Reference area R ref Expanded into a dimension of 1×(H) ref ×W ref The reference vector v) ref , where H ref W ref R respectively ref Height and width;
[0097] For each dynamic registration region R i Perform the same operation on (i = 1, 2, ..., N) to obtain the registration vector v i The dimension is also 1×(H) ref ×W ref ).
[0098] Construct the region matrix:
[0099] Stack the N registration vectors to construct a structure with dimension N×(H). ref ×W ref The matrix V:
[0100]
[0101] Where v N R represents the Nth dynamic registration region. N The registration vector obtained by expansion.
[0102] 2. Matrix difference operation:
[0103] Calculate the difference between each row of matrix V and the reference vector, and take the absolute value to generate the difference matrix D:
[0104] D = |V-1 N×1 ·v ref | (7)
[0105] The difference matrix D is binary segmented according to a gray-level threshold, and then each row is restored to its original dimension to obtain N binary images Bin. i (x,y), statistical binary image Bin i The number of pixels with a value of 255 in (x,y) is denoted as suspected defective pixels, and Bin is used to further analyze these pixels. i (x,y) is filtered and morphological opening is performed to remove isolated noise points. Then, the defect contour is extracted by Canny and its minimum bounding rectangle is constructed (using the minAreaRect algorithm in OpenCV) to realize defect localization. The defect area S is calculated based on the number of pixels in the defect area.
[0106] Figure 3 This is a schematic diagram of generating the dynamic registration region. Figure 3 (a) Defines a reference region in the original image of the standard carrier tape. Figure 3 (b) The registration region is extracted from the carrier image under test using key elements of the reference region.
[0107] Figure 4 This is a flowchart of the difference operation between the reference region and the registration region, and subsequent processing. Matrix operations greatly reduce time complexity and improve computation speed. Subsequent processing identifies minor defects with areas smaller than a specified threshold.
[0108] The following is a brief description of the implementation steps of the present invention, based on N=3 (i.e., 3 consecutive center holes of the box) as a specific embodiment:
[0109] Step A: Construct a benchmark reference area, such as Figure 3 (a)
[0110] A1. Acquire a standard carrier image and select a rectangular region containing a complete box structure as the reference region R. ref ;
[0111] A2. Extract the coordinates (Cx) of the center hole of the box using a center-fitting algorithm. ref Cy ref (Local coordinate system);
[0112] A3. Recording area size: (H) refW ref ).
[0113] Step B: Construct the feature sampling region.
[0114] B1. Select a rectangle containing three consecutive box center holes in the image of the carrier tape to be tested within region R. sub (like Figure 3 (b) long dashed box);
[0115] B2, R sub Divide the holes into three equal parts along the direction of hole distribution;
[0116] B3. For each sample, use the circle center fitting algorithm to obtain the local coordinate set of three sub-feature points {(Cx1,Cy1),(Cx2,Cy2),(Cx3,Cy3)};
[0117] B4, according to R sub The global coordinates of the three sub-feature points are calculated using the global coordinates of the top left corner and the global coordinates of the two trisection points on the left.
[0118] Step C: Generate the dynamic registration region.
[0119] Based on the global coordinates of the three sub-feature points, the local coordinates of the main feature point, and the size of the reference region, three dynamically registered regions R1, R2, and R3 are generated on the carrier image to be detected. Figure 3 (b) short dashed box.
[0120] Step D: Differential operation and defect detection.
[0121] D1. Matrix-based batch processing: such as Figure 4 The process involves setting the reference area R as the baseline. ref Expand into vector x ref The three dynamically registered regions R1, R2, and R3 are expanded into vectors v1, v2, and v3, respectively. A matrix is constructed and a difference operation is performed to obtain the difference matrix D. Gray-scale thresholding is then performed on D.
[0122] D2. Defect Identification: The three rows d1, d2, and d3 of the difference matrix D are restored to their original dimensions, and then filtering and morphological operations are performed to eliminate small noise points. Subsequently, Canny is used to extract the defect contour, and the minimum bounding rectangle is constructed to locate the defect. Finally, the number of pixels with a pixel value of 255 is counted, and the area of the defect is calculated based on the number of pixels with a pixel value of 255.
[0123] The method of the present invention is applicable to electronic carrier tapes made of plastic or paper, and is suitable for various box structures. It includes, but is not limited to, the identification of defects such as foreign objects, repeated punching, round hole misalignment, poor molding, blind holes, edge burrs, and granulation bubbles. It also supports online production and offline rewinding.
[0124] While the embodiments disclosed in this invention are as described above, the content is merely for the purpose of facilitating understanding of the invention and is not intended to limit the invention. Any person skilled in the art to which this invention pertains may make any modifications and variations in form and detail of the implementation without departing from the spirit and scope disclosed herein; however, the scope of patent protection for this invention shall still be determined by the scope defined in the appended claims.
Claims
1. An optical detection method for defects in electronic tape carrier boxes based on multi-level feature region registration, characterized in that, Includes the following steps: A. Construct a reference region in the acquired standard carrier image and obtain the local coordinates of the main feature points; B. Select a sub-region containing N consecutive box center holes in the image of the carrier tape to be tested, and mark the local coordinate set and global coordinate set of each sub-feature point; C. Extract the dynamic registration region in the global coordinate system; D. The dynamic registration area and the reference area are differentially processed. If there is a defect, the defect location is located and the defect area is calculated.
2. The optical detection method for electronic tape carrier box defects based on multi-level feature region registration as described in claim 1, characterized in that, In step A, the reference area R ref The standard carrier image is constructed by slicing it using the following formula: R ref =Origin_Img[y ref :y ref +H ref ,x ref :x ref +W ref ] (1) In the formula (x ref ,y ref ) indicates the reference area R ref The top left corner of the image is located at global coordinates (H) in a standard carrier image. ref W ref ) indicates the reference area R ref Height and width.
3. The optical detection method for electronic tape carrier box defects based on multi-level feature region registration as described in claim 1, characterized in that, The principal feature point in step A is the center of the hole in the center of the box. The coordinates of the center are obtained through a center fitting algorithm. The specific steps are as follows: a. For the reference area R ref Perform grayscale thresholding to generate a binary image; b. Obtain the contour point set of the center hole of the box using the Canny edge detection algorithm; c. Using the least squares method based on the random sampling consensus algorithm to fit the contour point set, the coordinates of the center of the box's central hole are obtained, which are the coordinates of the principal feature points in the local coordinate system (Cx). ref Cy ref ).
4. The optical detection method for electronic tape carrier box defects based on multi-level feature region registration as described in claim 1, characterized in that, In step B, the number N of the center holes in the box and the number of holes punched in a single batch during the carrier tape production process should satisfy the following formula: N = M + 1 (2) Where M represents the number of holes punched in a single process during the carrier tape production process.
5. The optical detection method for electronic tape carrier box defects based on multi-level feature region registration as described in claim 1, characterized in that, In step B, the local coordinate system is based on the sub-region R. sub The global coordinate system is established with the top left corner of the carrier image to be tested as the origin. The steps to obtain the global coordinates of N sub-feature points are as follows: 1) Subregion R sub Divide the holes evenly into N parts along the direction of hole distribution; 2) In each of the constructed local coordinate systems, the local coordinate set of each feature point is calculated using a circle center fitting algorithm. (Cx i Cy i () represents the local coordinates of the i-th sub-feature point; 3) In the global coordinate system, the global coordinate set of each sub-feature point is recursively calculated using the following formula. In the formula (x sub ,y sub) For subregion R sub The coordinates of the top-left corner in the global coordinate system, (Cx ia Cy ia ) represents the global coordinates of the i-th sub-feature point.
6. The optical detection method for electronic tape carrier box defects based on multi-level feature region registration as described in claim 1, characterized in that, In step C, in the global coordinate system, with R... i =Img[y Ri :y Ri +H ref ,x Ri :x Ri +W ref Get the dynamic registration region Img represents the image of the carrier tape to be tested, (H) ref W ref ) indicates the reference area R ref Height and width, R i Represents the i-th dynamic registration region, (x Ri ,y Ri ) represents the coordinates of the top-left corner of the i-th dynamic registration region in the global coordinate system.
7. The optical detection method for electronic tape carrier box defects based on multi-level feature region registration as described in claim 1, characterized in that, In step D, the difference processing steps are as follows: (I) Calculate R for each dynamic registration region i and reference area R ref Difference: Beef i (x,y)=|R ref (x,y)-R i (x,y)| (4) In the formula Res i (x,y) represents the difference result of the i-th dynamic registration region; R ref (x,y) is a functional representation of the reference region, R i (x,y) is a function for the i-th dynamic registration region; x and y represent the coordinates of the pixel in the x-th row and y-th column of the image; (ii) Regarding Res i Bin is generated by performing grayscale thresholding on (x,y). i (x,y): In the formula, TH(x,y) is the set grayscale threshold matrix, and the dimension of the grayscale threshold matrix is the same as that of Res. i (x,y) are the same; (III) Statistics Bin i The number of pixels with a value of 255 in (x,y) is denoted as suspected defective pixels, and Bin is used to further analyze these pixels. i (x,y) is filtered and morphological opening is performed to remove isolated noise points. Then, the defect contour is extracted by Canny and its minimum bounding rectangle is constructed to realize defect localization. The defect area is calculated based on the number of pixels in the defect area.
8. The optical detection method for electronic tape carrier box defects based on multi-level feature region registration as described in claim 7, characterized in that, The following steps are used to calculate the difference between the dynamic registration region and the reference region: a) Region vectorization: Reference area R ref Expanded into a dimension of 1×(H) ref ×W ref The reference vector v) ref , where H ref W ref The reference area R is the reference area. ref Height and width; For each dynamic registration region R i Expanding the vectors i = 1, 2, ..., N, we obtain the registration vector v. i The dimension is also 1×(H) ref ×W ref ); b) Construct the region matrix: Stack the N registration vectors to construct a structure with dimension N×(H). ref ×M ref The matrix V: Where v N R represents the Nth dynamic registration region. N The registration vector obtained by expansion; c) Matrix difference operation: Calculate the difference between each row in V and the reference vector to generate the difference matrix D: D=|V-1 N×1 ·v ref | (7) The difference matrix D is binary-segmented according to the reference region, and then each row is restored to its original dimension.
9. A computer device comprising a memory and a processor, the memory being electrically connected to the processor, the memory storing a computer program, characterized in that: When the computer program is executed by the processor, it causes the processor to implement the method as described in any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor implements the method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Double-station carrier tape detection system based on machine vision and machine learning
CN106839986A
Semiconductor carrier tape production quality visual inspection method based on image filtering
CN117522875A
Electronic component carrier tape detection device and automatic disc inspection machine
CN116008293A
Carrier tape detection method based on machine vision
CN116309383A
Defect detection method for printed characters of milk packaging box
CN116309573A