Calculation method for deviation angle of ceramic packaging chip cover plate

By pre-processing and contour merging the image of the ceramic package chip, the offset angle of the cover plate is calculated, which solves the problem of lack of effective calculation methods in the prior art, and achieves fast and accurate detection.

CN119887918APending Publication Date: 2025-04-25CHONGQING SAIBAO IND TECH RES INST CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411963710.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The prior art lacks effective methods to calculate the offset angle of the ceramic packaging chip cover, resulting in a lack of fast and accurate detection methods in chip production.

Method used

By preprocessing the chip images collected by the industrial control machine, including grayscale, bilateral filtering and adaptive binarization, the chip rotation angle is calculated and the image is rotated, the outline is found and combined, and the cover plate offset angle is finally calculated.

Benefits of technology

The accurate calculation of the offset angle of the ceramic packaging chip cover plate is realized, and the unqualified products can be automatically identified, improving the efficiency of defect visual detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119887918A_ABST
    Figure CN119887918A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of ceramic packaging processes, and particularly discloses a ceramic packaging chip cover plate deviation angle calculation method, which comprises the following steps: S01, preprocessing a chip image acquired by an industrial personal computer, and finally realizing image adaptive binaryzation; s02, calculating the rotation angle of the chip, rotating the image, searching all contours of the binary image, screening out smaller contours, combining the contours, finally calculating the minimum enclosing rectangle of the combined contours, obtaining the angle theta between the minimum enclosing rectangle and the X axis, and rotating the original image by theta; s03, sorting standard data and to-be-detected data images: selecting a cover plate area image of a standard chip and performing image pyramid downsampling; and S04, performing regional correlation matching on the to-be-detected image, calculating correlation by using a sliding window and a rotating window, and finally calculating the offset degree of the cover plate. The invention aims to solve the problem that a calculation method for the offset angle of the ceramic packaging chip cover plate is lacked at present.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of ceramic packaging technology, and specifically discloses a method for calculating the offset angle of a ceramic packaging chip cover. Background Art

[0002] Ceramic packaging technology refers to a type of semiconductor assembly process that uses a ceramic shell or ceramic substrate as a packaging carrier, adheres or welds the chip to the core cavity of the ceramic shell or the chip mounting area of ​​the ceramic substrate, then interconnects the chip and the shell or substrate through wire bonding or flip-chip welding, and then seals the chip in the cavity with a metal or ceramic cover plate or cap;

[0003] Due to process problems, when the chip and the ceramic substrate are interconnected by flip-chip welding, the cover plate may be offset from the substrate due to inadequate welding. This method can calculate the specific offset angle of the cover plate, so that it can be automatically classified as a defective product in the appearance inspection process.

[0004] For ceramic packaged chips, common measurement contents include pin offset angle, pin length, pin area, etc. There is currently no known method to calculate the offset angle of the cover of ceramic packaged chips. At the same time, due to the small size of the chip, the low-precision manual detection and identification method can no longer meet the requirements of current chip production. Developing an effective technology that can quickly and accurately measure the offset angle of the ceramic chip cover is an urgent problem to be solved. Filling the gap in existing research in this area is particularly important for improving the efficiency of visual inspection of defects in ceramic packaged chips. Summary of the invention

[0005] The purpose of the present invention is to solve the problem that there is currently a lack of a calculation method for the offset angle of a ceramic package chip cover.

[0006] In order to achieve the above object, the present invention provides the following basic scheme:

[0007] A method for calculating an offset angle of a ceramic package chip cover, comprising the following steps:

[0008] S01: Preprocess the chip image collected by the industrial computer. The preprocessing methods include grayscale, bilateral filtering and adaptive binarization, and finally realize image adaptive binarization;

[0009] S02: Calculate the chip rotation angle and rotate the image, find all the contours of the binary image, then filter out the smaller contours, then merge the contours, and finally calculate the minimum bounding rectangle of the merged contours, and obtain the angle θ between the minimum bounding rectangle and the X-axis, and rotate the original image by θ;

[0010] S03: Arrangement of standard data and test data images: including selection of cover plate area images of standard chips and image pyramid down sampling;

[0011] S04: performing regional correlation matching on the image to be tested, calculating the correlation using a sliding window and a rotating window, and finally calculating the cover plate offset to obtain the cover plate offset angle of the ceramic package chip.

[0012] The principles and effects of this basic solution are:

[0013] 1. Compared with the prior art, this method can calculate the specific offset angle of the cover plate, thereby automatically classifying it as a defective product in the appearance inspection process.

[0014] Further, in step S01, grayscale: convert the BGR image into a grayscale image using the formula: GrayScale=0.299*R+0.587*G+0.114*B;

[0015] Among them, R, G, and B are the corresponding brightness values ​​of the color image in the three components, GrayScale is the brightness of the grayscale image channel, and the three color channels R, G, and B are merged.

[0016] Further, in step S01, bilateral filtering is to apply a combination of Gaussian kernel functions of spatial weights and range weights to remove noise while retaining edge details. The core of the bilateral filter lies in the combination of two Gaussian kernel functions:

[0017]

[0018] The front is the spatial weight, (ik) 2 +(jl) 2 is the spatial distance between pixels, σ s is the standard deviation of the spatial Gaussian kernel, followed by the range weight, ||I(i,j)-I(k,l)|| is the grayscale value difference between pixels, σ r is the standard deviation of the range Gaussian kernel, and the range weight is determined by the similarity between the center point and the surrounding pixels.

[0019] Furthermore, the adaptive binarization uses the Otsu algorithm to calculate the segmentation threshold T of the foreground and background, and uses the threshold to perform binarization processing.

[0020] Furthermore, in step S03, in the step of organizing the standard data and the test data images, the cover area image of the standard chip is selected in accordance with the principles of clarity, uniqueness, moderate size and robustness, and the image pyramid is constructed using the 2x2 mean downsampling method.

[0021] Further, in step S04, in the regional correlation matching step of the image to be tested, the rotating window calculates the correlation: all matching results whose matching similarities at all positions of the top image of the image pyramid to be matched are screened and are greater than a preset similarity threshold, and the matching angle with the highest similarity is retained as the first candidate matching angle.

[0022] Furthermore, in the region correlation matching step of the image to be tested, the cover plate offset is calculated to obtain the rotation angle of the highest correlation region, and the absolute value of the difference between the angle and the original image rotation angle θ is calculated, and the result is the cover plate offset angle.

[0023] Furthermore, in the regional correlation matching step of the image to be tested, on the image to be tested at the top layer of the image pyramid, the correlation in the window area is calculated starting from the upper left corner, from left to right, and from top to bottom. The calculation formula is as follows:

[0024]

[0025] T represents the template, ∑ x′,y′ T(x′,y′) and ∑ x′,y′ T 2 (x′,y′) is a constant.

[0026] Furthermore, for the first candidate matching angle, after mapping all coordinates in the first candidate point set to the lower pyramid, each rotated template is used to perform a traversal search on the image to be matched, so that the matching angle corresponding to the matching result that meets the requirements at all positions of the image pyramid of the image to be matched is used as the first candidate matching angle. In order to determine the first candidate matching angle corresponding to all positions of the image pyramid of the image to be matched, all matching results whose matching similarity at all positions of the top image of the image pyramid of the image to be matched is greater than a preset similarity threshold can be screened, and the matching angle with the highest similarity is retained as the first candidate matching angle.

[0027] Furthermore, the Otsu algorithm is used to binarize the image. For an image I(x, y) of size M×N, the segmentation threshold of the foreground (i.e., target) and background is denoted as T, the proportion of the number of pixels belonging to the foreground in the entire image is denoted as ω0, and its average grayscale is μ0; the proportion of the number of background pixels in the entire image is ω1, and its average grayscale is μ1. The total average grayscale of the image is denoted as μ, and the inter-class variance is denoted as g. When the inter-class variance g is the maximum value, T is the optimal threshold for binarization. The calculation formula for the inter-class variance g is as follows:

[0028] g=ω 0 (μ 0 -μ) 2 +ω 1 (μ 1 -μ) 2 ;

[0029] After calculating the optimal binarization threshold T, the binarization formula is as follows:

[0030]

[0031] Where f(x,y) represents the distribution function of the image pixel value, g(x,y) represents the pixel value distribution function of the binary image, and T is the binarization threshold obtained by maximizing the inter-class variance. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0033] Figure 1 An original image of a ceramic package chip in a method for calculating an offset angle of a ceramic package chip cover plate proposed in an embodiment of the present application is shown;

[0034] Figure 2 A grayscale image of an original image after passing through a 5x5 Gaussian filter in a method for calculating an offset angle of a ceramic package chip cover proposed in an embodiment of the present application is shown;

[0035] Figure 3 A schematic diagram of an image binarized by the Otsu method in a method for calculating an offset angle of a ceramic package chip cover plate proposed in an embodiment of the present application is shown;

[0036] Figure 4 A schematic diagram showing an image of a contour point set in a method for calculating an offset angle of a ceramic package chip cover plate proposed in an embodiment of the present application is shown;

[0037] Figure 5 A schematic diagram showing a chip minimum circumscribed rectangle image calculated by Graham and Rotated Calhoun algorithms in a ceramic package chip cover offset angle calculation method proposed in an embodiment of the present application is shown;

[0038] Figure 6 A schematic diagram showing an original image after being rotated and enlarged according to the angle of the minimum circumscribed rectangle in a method for calculating the offset angle of a ceramic package chip cover proposed in an embodiment of the present application is shown;

[0039] Figure 7 A schematic diagram showing a cover plate area image of a standard chip in a method for calculating a cover plate offset angle of a ceramic package chip proposed in an embodiment of the present application is shown;

[0040] Figure 8A schematic diagram of an image obtained by downsampling an original image through four Gaussian pyramids in a method for calculating an offset angle of a ceramic package chip cover proposed in an embodiment of the present application is shown;

[0041] Fig. 9 A graph showing calculation results of a cover plate offset in a ceramic package chip cover plate offset angle calculation method proposed in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0042] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation mode, structure, characteristics and effects of the present invention are described in detail below in combination with the accompanying drawings and preferred embodiments.

[0043] Implementation example Figure 1-Figure 9 As shown:

[0044] A method for calculating an offset angle of a ceramic package chip cover, comprising the following steps:

[0045] S01: Preprocess the chip image collected by the industrial computer. The preprocessing methods include grayscale, bilateral filtering and adaptive binarization, and finally realize image adaptive binarization;

[0046] First: Why grayscale?

[0047] Image grayscale can significantly reduce computational complexity and storage space requirements, simplify feature extraction and analysis processes, enhance contrast to improve recognition accuracy, and thus improve overall processing efficiency and effectiveness. In addition, grayscale images can better highlight object boundaries and key features, reduce interference from color information, and make subsequent processing more efficient and accurate. In practical applications, grayscale images can also help reduce noise, improve the consistency and stability of image processing, and further optimize the performance of visual recognition systems;

[0048] Secondly: Figure 1 As shown, the color image collected by the industrial computer has three color channels: R, G, and B. The default arrangement is bgr. In order to facilitate subsequent processing, the three color channels are merged into a single channel grayscale image with a brightness range of 0-255 according to the formula. The calculation formula is as follows:

[0049] GraySca le=0.299*R+0.587*G+0.114*B

[0050] Among them, R, G, and B are the brightness values ​​corresponding to the three components of the color image, and GrayScale is the brightness of the grayscale image channel. The grayscale result is as follows Figure 2 As shown;

[0051] About bilateral filtering:

[0052] In other filtering algorithms (such as mean filtering, median filtering, and Gaussian filtering), it is assumed that image pixels change slowly in space, but there will be sudden changes in certain areas. At this time, the above assumption does not hold. If this idea is also used to filter at the edge, that is, it is assumed that adjacent pixels are close, the result will inevitably blur the edge. In order to remove noise while retaining edge details and reduce image distortion, a bilateral filter is used to achieve the above effect by applying a weighted average operation to each pixel. This weighted average not only considers the spatial position of the pixel, but also the grayscale value (or color value) of the pixel. The core of the bilateral filter lies in the combination of two Gaussian kernel functions:

[0053]

[0054] The front is the airspace weight, (ik) 2 +(jl) 2 is the spatial distance between pixels, σ s is the standard deviation of the spatial Gaussian kernel, followed by the range weight, ||I(i,j)-I(k,l)|| is the grayscale value difference between pixels, σ r is the standard deviation of the range Gaussian kernel, and the range weight is determined by the similarity between the center point and the surrounding pixels. In flat areas, since the brightness values ​​of the center point and the surrounding pixels are close, the range weight in the window is close to 1. At this time, the spatial domain weight plays a dominant role, and the filtering effect is similar to Gaussian smoothing. In areas with boundaries, since the gap between the center point and some of the surrounding pixels is relatively large, the weight of the part with a large gap is suppressed, and only the weight of the part similar to the boundary is used, so the boundary is retained after filtering;

[0055] Image adaptive binarization:

[0056] The Otsu algorithm is used to binarize the image. For an image I (x, y) of size M×N, the segmentation threshold of the foreground (i.e., target) and background is denoted as T. The proportion of the number of pixels belonging to the foreground in the entire image is denoted as ω0, and its average grayscale is μ0; the proportion of the number of background pixels in the entire image is ω1, and its average grayscale is μ1. The total average grayscale of the image is denoted as μ, and the inter-class variance is denoted as g. When the inter-class variance g is the maximum value, T is the optimal threshold for binarization. The calculation formula for the inter-class variance g is as follows:

[0057] g=ω 0 (μ 0 -μ) 2 +ω 1 (μ 1 -μ) 2

[0058] After calculating the optimal binarization threshold T, the binarization formula is as follows:

[0059]

[0060] Where f(x,y) represents the distribution function of the image pixel value, g(x,y) represents the pixel value distribution function of the binary image, and T is the binarization threshold obtained by maximizing the inter-class variance.

[0061] S02: Calculate the chip rotation angle and rotate the image, find all the contours of the binary image, then filter out the smaller contours, then merge the contours, and finally calculate the minimum bounding rectangle of the merged contours, and obtain the angle θ between the minimum bounding rectangle and the X-axis, and rotate the original image by θ;

[0062] first:

[0063] For a binary image, each pixel is either 255 or 0. Here, we assume that the background is 0 and the foreground is 255, that is, to find the outline of a white object in the image. Finding the outline can be divided into two steps: finding the boundary points and finding the connected domain based on the boundary points. The specific steps are as follows:

[0064] To find boundary points, we first need to traverse every pixel in the image. If its value is 255, it means it is a foreground pixel, and we save it in a List. Next, we need to find boundary points. A contour is composed of many boundary points. If a pixel has one foreground pixel above or below or one background pixel on its left and right, we save it as a boundary point. Finally, we get a series of boundary points, which we save in a Vector.

[0065] Find the connected domain based on the boundary points. In the above steps, we get the positions of some discrete boundary points. We arrange these points in a specific order so that the polygonal area they form is closed. Select a starting point from the point set, and then find the next point in order and connect these points in sequence. In the process of finding the connection point, follow the following order: find the first connection point and mark it as visited and connect it to our output contour. At the same time, find the next connection point in the neighborhood with the connection point as the center;

[0066] Then filter out the smaller contours and merge the contours:

[0067] The method of screening the number of contour pixels is adopted. For contours with a number of pixels less than the set threshold, it is considered that they are impurities in the background that are close to the target color or impurities with different colors on the substrate. They should be screened out because they do not affect the determination of the overall rotation angle of the chip. The opening operation is used here. The specific steps are to first corrode the image and then perform an expansion operation. Corrosion and expansion are mainly used for tasks such as removing noise, filling holes, and extracting boundaries. Taking corrosion as an example, the idea is to define a structural element, traverse the structural element to each pixel point, and update the minimum pixel value of the pixel points in the structural element to the pixel value of the center point. In this method, a 3x3 Structural element, dilation is the opposite, the center point pixel value is updated to the maximum value in the structural element. After the contour processing is completed, the remaining contours are merged into an overall contour, which is the sum of the inner boundary contour and the outer boundary contour of the entire chip, and this contour is considered to be the chip contour;

[0068] Calculate the minimum circumscribed rectangle of the merged contour and get the angle θ between the minimum circumscribed moment and the X-axis:

[0069] The minimum enclosing rectangle of a contour refers to the rectangle with the minimum area that can completely contain a given contour. This rectangle may not be axis-aligned, that is, its sides are not necessarily parallel to the image coordinate axes. Because the contour is not smooth after merging, the Graham scanning algorithm is used to initialize and scan the contour, checking each point one by one to determine whether the current point is on the right side of the line segment determined by the last point and the second to last point that have been added to the convex hull. Otherwise, remove the point and repeat the comparison until all points have been checked. Then, for the case where the convex hull is known, the Calhoun algorithm is rotated step by step to finally find the minimum enclosing rectangle. For the two points M below the rectangle 1 (x 1 ,y 1 ) and M 2 (x 2 ,y 2 ), the angle θ between the minimum circumscribed moment and the X-axis is obtained by the following calculation formula:

[0070]

[0071] Rotate the original image by θ:

[0072] Rotating the image according to the angle θ between the minimum circumscribed moment and the X-axis requires two additional tasks: First, since rotation at any angle will cause the image to be incomplete and lose some information, the image matrix needs to be expanded accordingly, which can be calculated based on the rotation angle θ.

[0073] NW=H*Si n(θ)+W*Cos(θ)

[0074] NH=H*Cos(θ)+W*Sin(θ)

[0075] Where NW and NH are the width and height of the enlarged matrix, and W and H are the width and height of the original image matrix.

[0076] The second step is to recalculate the new coordinates of the pixel points. The transformation matrix M obtained by the opencv function GetRotationMatrix2D is:

[0077]

[0078] The [0,2] and [1,2] of the matrix are the translation parts of the matrix. According to the calculation, the transformation matrix M after the enlargement is obtained. ′ The translation part of is transformed as follows

[0079] M ′ [0,2]=M[0,2]+(NW-W) / 2

[0080] M ′ [1,2]=M[1,2]+(NH-H) / 2

[0081] S03: Arrangement of standard data and test data images: including selection of cover plate area images of standard chips and image pyramid down sampling;

[0082] Specific:

[0083] Select the cover area image of the standard chip:

[0084] Choosing a suitable template is crucial to improving matching accuracy. The following basic principles should be followed when selecting:

[0085] High clarity: the template should contain enough detail information to distinguish it from the background. Avoid selecting areas that are too blurry or have unclear features as templates.

[0086] Uniqueness: The template should have a certain degree of uniqueness to ensure that there is only one matching location in the entire search area. If the template is too common or the features are not obvious, there may be multiple matching locations, resulting in false matches.

[0087] The size of the template should be determined according to the actual application requirements. A template that is too small may not contain enough feature information, while a template that is too large will increase the amount of calculation and may cause a decrease in matching effect due to the inclusion of too much irrelevant background.

[0088] Robustness: A good template should be robust to lighting changes, rotation, scaling, etc., which means that even if the target object changes in the actual scene, it can still be correctly identified;

[0089] Edge features: areas with rich edge information are preferred as templates. Edges are usually one of the important features of an image and can help the algorithm locate the target more accurately.

[0090] Image pyramid downsampling:

[0091] An image pyramid is a collection of images consisting of sub-images of different resolutions obtained by continuously downsampling an image. Each downsampling will halve the width and height of the image. The bottom of the pyramid is the original image. The higher the pyramid level, the smaller the image and the lower the resolution.

[0092] The main purpose of using an image pyramid is to improve the robustness and efficiency of the algorithm at different scales. The higher the number of image pyramid layers, the smaller the template image and the image to be matched will be, and the faster the matching speed will be. However, too many image pyramid layers will also result in too few image pixels, and after multiple downsampling, it is no longer possible to match correctly. Therefore, it is necessary to increase the number of pyramid layers as much as possible to improve the matching efficiency while ensuring the accuracy of the matching. Common algorithms for constructing image pyramids include bilinear interpolation and Gaussian pyramid sampling matrix. Bilinear interpolation is to use the weighted average of the four nearest neighboring pixels to calculate the value of the new pixel after determining the position of the new image pixel in the original image. This method takes into account both speed and effect. The Gaussian pyramid sampling matrix method is implemented through a Gaussian filter. It will perform Gaussian kernel convolution on the image and delete all even rows and columns in the original image, and finally reduce the image. Among them, the Gaussian kernel convolution operation is the process of weighted averaging the entire image. The value of each pixel is obtained by weighted averaging itself and other pixel values ​​in the neighborhood (with different weights). Finally, each layer of the image is half the size of the previous layer. The kernel used by the Gaussian filter is:

[0093]

[0094] This method directly uses 2x2 mean downsampling, that is, the average value of all pixels in the 2x2 area is used. This method does not have the frequency response problem, while larger filters have this problem.

[0095] S04: performing regional correlation matching on the image to be tested, calculating the correlation using a sliding window and a rotating window, and finally calculating the cover plate offset to obtain the cover plate offset angle of the ceramic package chip.

[0096] Compute correlation using a sliding window:

[0097] The processed standard cover area image is used as a sliding window. On the image to be detected at the top layer of the image pyramid, the correlation in the window area is calculated from the upper left corner, from left to right, and from top to bottom. The calculation formula is as follows:

[0098]

[0099] The formula can be simplified to:

[0100]

[0101] T represents the template, then ∑ x′,y′ T(x′,y′) and ∑ x′,y′ T 2 (x′, y′) is a fixed value, which can be directly calculated after selecting the template, without having to be calculated during matching; I represents the sliding window in the search image. Obviously, the multiple accumulations of I in the formula can be quickly calculated using the integral graph method with O(1) time complexity. Therefore, for this formula, except for ∑ x′,y′ The term T(x′,y′)·I(x+x′,y+y′) is a convolution of pixels in the same area of ​​the template image and the search image, which cannot be calculated in advance or quickly. The other terms can either be calculated in advance as constants or can be quickly calculated with a time complexity of O(1). The point set with a similarity higher than the set threshold is used as the first candidate point.

[0102] Rotate the window to calculate the correlation:

[0103] For the first candidate matching angle, after mapping all coordinates in the first candidate point set to the lower pyramid, each rotated template is used to traverse and search on the image to be matched, so that the matching angle corresponding to the matching result that meets the requirements at all positions of the image pyramid of the image to be matched is taken as the first candidate matching angle. In order to determine the first candidate matching angle corresponding to all positions of the image pyramid of the image to be matched, all matching results whose matching similarity at all positions of the top image of the image pyramid of the image to be matched is greater than a preset similarity threshold can be screened, and the matching angle with the highest similarity is retained as the first candidate matching angle.

[0104] For the angle step setting of the bottom pyramid, the larger the angle step, the less rotation information needs to be calculated, and the speed can be faster, but at the same time, the accuracy is worse. Generally speaking, the larger the template, the smaller the discretization interval needs to be. This is because larger templates can distinguish smaller angle changes. At the same time, the step size needs to ensure that the minimum difference in length or width between two adjacent templates during rotation is not less than 1 pixel. Usually, for templates larger than 100 pixels, the angle step can be set to 1 degree.

[0105] For the angle discrete value setting of each layer of the pyramid, at the bottom of the pyramid, the image can be rotated step by step according to the aforementioned automatic angle amplitude. Then, as the number of layers of the pyramid increases, the angle step of the template on the corresponding pyramid can also be increased by 2 times based on the fact that the template will be reduced by 2 times in each layer of the pyramid. Therefore, if the angle step used on the bottom layer of the pyramid is 1 degree, then 8 degrees can be used as the angle step on the fourth layer. That is:

[0106] Anglerayer[i]=2 i-1 Angel ayer[1]

[0107] Here, Anglelayer[i] is the angle step of the i-th layer of the pyramid. This has many benefits, because we need to do multi-angle full-image matching at the top layer, and this calculation is relatively large. If the angle step can be reduced exponentially at this layer, the amount of calculation will also be reduced by an order of magnitude;

[0108] Calculate the cover offset:

[0109] The rotation angle of the highest correlation area is obtained, and the absolute value of the difference between this angle and the original image rotation angle θ is calculated. The result is the cover offset angle, such as Fig. 9 As shown, the cover plate offset angle in the figure is 4.241 degrees.

[0110] The purpose of the present invention is to solve the problem that there is currently a lack of a calculation method for the offset angle of a ceramic package chip cover.

[0111] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technical personnel in this field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.

Claims

1. A method for calculating the offset angle of a ceramic package chip cover, characterized in that: The following steps are involved: S01: Preprocess the chip image collected by the industrial computer. The preprocessing methods include grayscale, bilateral filtering and adaptive binarization, and finally realize image adaptive binarization; S02: Calculate the chip rotation angle and rotate the image, find all the contours of the binary image, then filter out the smaller contours, then merge the contours, and finally calculate the minimum bounding rectangle of the merged contours, and obtain the angle θ between the minimum bounding rectangle and the X-axis, and rotate the original image by θ; S03: Arrangement of standard data and test data images: including selection of cover plate area images of standard chips and image pyramid down sampling; S04: performing regional correlation matching on the image to be tested, calculating the correlation using a sliding window and a rotating window, and finally calculating the cover plate offset to obtain the cover plate offset angle of the ceramic package chip.

2. The method for calculating the offset angle of a ceramic package chip cover according to claim 1, characterized in that: In step S01, grayscale: convert the BGR image into a grayscale image using the formula: GrayScale = 0.299*R + 0.587*G + 0.114*B; Among them, R, G, and B are the corresponding brightness values ​​of the color image in the three components, GrayScale is the brightness of the grayscale image channel, and the three color channels R, G, and B are merged.

3. The method for calculating the offset angle of a ceramic package chip cover according to claim 2, characterized in that: In step S01, bilateral filtering is to apply a combination of Gaussian kernel functions of spatial weights and range weights to remove noise while retaining edge details. The core of the bilateral filter lies in the combination of two Gaussian kernel functions: The front is the airspace weight, (ik) 2 +(jl) 2 is the spatial distance between pixels, σ s is the standard deviation of the spatial Gaussian kernel, followed by the range weight, ||I(i,j)-I(k,l)|| is the grayscale value difference between pixels, σ r is the standard deviation of the range Gaussian kernel, and the range weight is determined by the similarity between the center point and the surrounding pixels.

4. The method for calculating the offset angle of a ceramic package chip cover according to claim 3, characterized in that: In step S01, the adaptive binarization uses the Otsu algorithm to calculate the segmentation threshold T of the foreground and background, and uses the threshold to perform binarization processing.

5. A method for calculating the offset angle of a ceramic package chip cover according to any one of claims 1 to 4, characterized in that: In step S03, in the step of arranging the standard data and the test data images, the cover area image of the standard chip is selected according to the principles of clarity, uniqueness, moderate size and robustness, and the image pyramid is constructed using the 2x2 mean downsampling method.

6. The method for calculating the offset angle of a ceramic package chip cover according to claim 5, characterized in that: In step S04, in the regional correlation matching step of the image to be tested, the rotating window calculates the correlation: all matching results whose matching similarities at all positions of the top image of the image pyramid to be matched are screened and are greater than a preset similarity threshold, and the matching angle with the highest similarity is retained as the first candidate matching angle.

7. The method for calculating the offset angle of a ceramic package chip cover according to claim 6, characterized in that: In the regional correlation matching step of the image to be tested, the cover plate offset is calculated to obtain the rotation angle of the highest correlation area, and the absolute value of the difference between the angle and the original image rotation angle θ is calculated, and the result is the cover plate offset angle.

8. The method for calculating the offset angle of a ceramic package chip cover according to claim 6, characterized in that: In the regional correlation matching step of the image to be tested, on the image to be tested at the top layer of the image pyramid, the correlation in the window area is calculated starting from the upper left corner, from left to right, and from top to bottom. The calculation formula is as follows: T represents the template, ∑ x′,y′ T(x′,y′) and ∑ x′,y′ T 2 (x′,y′) is a constant.

9. The method for calculating the offset angle of a ceramic package chip cover according to claim 6, characterized in that: For the first candidate matching angle, after mapping all coordinates in the first candidate point set to the lower pyramid, each rotated template is used to traverse and search on the image to be matched, so that the matching angle corresponding to the matching result that meets the requirements at all positions of the image pyramid of the image to be matched is taken as the first candidate matching angle. In order to determine the first candidate matching angle corresponding to all positions of the image pyramid of the image to be matched, all matching results whose matching similarity at all positions of the top image of the image pyramid of the image to be matched is greater than a preset similarity threshold can be screened, and the matching angle with the highest similarity is retained as the first candidate matching angle.

10. The method for calculating the offset angle of a ceramic package chip cover according to claim 4, characterized in that: The image is binarized using the Otsu algorithm. For an image I(x, y) of size M×N, the segmentation threshold of the foreground (i.e., target) and background is denoted as T, the proportion of the number of pixels belonging to the foreground to the entire image is denoted as ω0, and its average grayscale is μ0; The ratio of background pixels to the entire image is ω1, and its average grayscale is μ1. The total average grayscale of the image is denoted by μ, and the inter-class variance is denoted by g. When the inter-class variance g is the maximum value, T is the optimal threshold for binarization. The calculation formula for the inter-class variance g is as follows: g=ω0(μ0-μ) 2 +ω1(μ1-μ) 2 ; After calculating the optimal binarization threshold T, the binarization formula is as follows: Where f(x,y) represents the distribution function of the image pixel value, g(x,y) represents the pixel value distribution function of the binary image, and T is the binarization threshold obtained by maximizing the inter-class variance.

Citation Information

Cited By

  • Method and device for detecting acute angle of copper conductive structure of printed circuit board and electronic equipment

    CN121783080A