CN110992326B - QFN chip pin image rapid inclination correction method - Google Patents

QFN chip pin image rapid inclination correction method Download PDF

Info

Publication number
CN110992326B
CN110992326B CN201911182587.1A CN201911182587A CN110992326B CN 110992326 B CN110992326 B CN 110992326B CN 201911182587 A CN201911182587 A CN 201911182587A CN 110992326 B CN110992326 B CN 110992326B
Authority
CN
China
Prior art keywords
image
point
corner
contour
points
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911182587.1A
Other languages
Chinese (zh)
Other versions
CN110992326A (en
Inventor
巢渊
周伟
刘文汇
唐寒冰
李龑
李兴成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu University of Technology
Original Assignee
Jiangsu University of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu University of Technology filed Critical Jiangsu University of Technology
Priority to CN201911182587.1A priority Critical patent/CN110992326B/en
Publication of CN110992326A publication Critical patent/CN110992326A/en
Application granted granted Critical
Publication of CN110992326B publication Critical patent/CN110992326B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/24Aligning, centring, orientation detection or correction of the image
    • G06V10/242Aligning, centring, orientation detection or correction of the image by image rotation, e.g. by 90 degrees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/30Noise filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20112Image segmentation details
    • G06T2207/20164Salient point detection; Corner detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30164Workpiece; Machine component

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

本发明公开一种QFN芯片引脚图像快速倾斜校正方法,包括以下步骤:(1)采集QFN芯片引脚图像,进行滤波、二值化处理;(2)利用多边形逼近方法提取芯片图像中心焊盘轮廓;(3)提出改进Harris角点检测算法,获取轮廓顶点;(4)利用最小二乘法对距离最远的顶点进行直线拟合,将直线作为角度识别方向;(5)以图像形心坐标为旋转中心,快速校正芯片引脚图像并去除白边。该校正方法为更快速、更准确地校正QFN芯片提供了一定的理论依据,提高了QFN封装缺陷视觉检测效率。

Figure 201911182587

The invention discloses a quick tilt correction method for a pin image of a QFN chip, comprising the following steps: (1) collecting the pin image of the QFN chip, filtering and binarizing it; (2) extracting the center pad of the chip image by using a polygon approximation method contour; (3) propose an improved Harris corner detection algorithm to obtain contour vertices; (4) use the least squares method to fit a straight line to the farthest vertex, and use the straight line as the angle to identify the direction; (5) use the image centroid coordinates For the center of rotation, quickly correct the chip pin image and remove white edges. The correction method provides a certain theoretical basis for faster and more accurate correction of QFN chips, and improves the visual inspection efficiency of QFN package defects.

Figure 201911182587

Description

一种QFN芯片引脚图像快速倾斜校正方法A fast tilt correction method for QFN chip pin image

技术领域technical field

本发明属于图像处理算法设计领域,提出改进Harris角点检测算法,结合多边形逼近方法,设计一种针对QFN芯片引脚图像快速倾斜校正的方法。The invention belongs to the field of image processing algorithm design, and proposes an improved Harris corner point detection algorithm, combined with a polygon approximation method, to design a fast tilt correction method for QFN chip pin images.

背景技术Background technique

QFN(Quad Flat No-lead Package)是一种无引脚封装,呈正方形或矩形,利用封装底部中间焊盘导热,围绕中间焊盘的封装外围四周有实现电气连结的导电焊盘。QFN芯片在生产过程中会有一定的尺寸误差,因此制造料盘承载口时会留有余量,但是这会导致放入芯片时发生倾斜,从而影响到芯片封装质量视觉检测。QFN (Quad Flat No-lead Package) is a leadless package, which is square or rectangular. It uses the middle pad at the bottom of the package to conduct heat, and there are conductive pads around the package periphery for electrical connection around the middle pad. There will be a certain size error in the production process of QFN chips, so there will be a margin when manufacturing the tray carrier port, but this will cause the chip to be tilted when it is placed, which will affect the visual inspection of the chip packaging quality.

同时,由于芯片的尺寸较小,精确度较低的人工检测识别方式已经远远满足不了当前芯片生产的要求,开发一种有效的、可快速、准确地对芯片图像进行校正的技术是当前急需解决的问题。现有技术中针对QFN芯片的研究,主要集中于QFN芯片结构改进、制造工艺、外观检测及QFN芯片缺陷检测方面,目前尚未查阅到与QFN芯片图像倾斜的快速校正方法相关的文献与专利,因此设计一种针对QFN芯片引脚图像快速倾斜校正的方法,填补现有研究在这一方面的缺失,对于提高QFN封装缺陷视觉检测效率显得尤为重要。At the same time, due to the small size of the chip, the manual detection and identification method with low accuracy is far from meeting the requirements of current chip production. It is urgently needed to develop an effective technology that can quickly and accurately correct the chip image. solved problem. The research on QFN chips in the prior art mainly focuses on the improvement of QFN chip structure, manufacturing process, appearance inspection and QFN chip defect detection. At present, there is no literature or patent related to the fast correction method of QFN chip image tilt. Therefore, Designing a fast tilt correction method for QFN chip pin images to fill the gap of existing research in this aspect is particularly important for improving the efficiency of visual inspection of QFN package defects.

发明内容SUMMARY OF THE INVENTION

针对现有技术中存在的问题,本发明提出改进Harris角点检测算法,结合多边形逼近方法,设计一种QFN芯片引脚图像快速倾斜校正方法,较传统算法而言速度更快、效率也有明显提高。In view of the problems existing in the prior art, the present invention proposes an improved Harris corner detection algorithm, combined with the polygon approximation method, to design a fast tilt correction method for the pin image of a QFN chip, which is faster and more efficient than the traditional algorithm. .

本发明的技术方案为:一种针对QFN芯片引脚图像快速倾斜校正的方法,包括以下步骤:The technical scheme of the present invention is: a method for fast tilt correction of a pin image of a QFN chip, comprising the following steps:

1.对工控机采集的芯片引脚图像进行预处理:1. Preprocess the chip pin image collected by the industrial computer:

1.1图像滤波:1.1 Image filtering:

为去除噪声,减少图像失真,采用5×5高斯滤波器与图像进行卷积,以平滑图像,减少边缘检测器上明显的噪声影响,在图像处理中,常使用二维高斯函数进行滤波,计算公式如下:In order to remove noise and reduce image distortion, a 5×5 Gaussian filter is used to convolve the image to smooth the image and reduce the obvious noise effect on the edge detector. In image processing, a two-dimensional Gaussian function is often used to filter and calculate The formula is as follows:

Figure GDA0003711964400000011
Figure GDA0003711964400000011

其中,G(x,y)为二维高斯函数,(x,y)为点坐标,σ为标准差,A为归一化系数,使不同的权重之和为一;Among them, G(x, y) is the two-dimensional Gaussian function, (x, y) is the point coordinate, σ is the standard deviation, and A is the normalization coefficient, so that the sum of different weights is one;

1.2.二值化处理:1.2. Binarization processing:

采用固定阈值法对图像进行二值化处理,计算公式如下:The fixed threshold method is used to binarize the image, and the calculation formula is as follows:

Figure GDA0003711964400000021
Figure GDA0003711964400000021

其中,f(x,y)表示图像像素值的分布函数,g(x,y)表示阈值分割之后的像素值分布函数,固定阈值T=145;Among them, f(x, y) represents the distribution function of image pixel values, g(x, y) represents the pixel value distribution function after threshold segmentation, and the fixed threshold T=145;

2.利用多边形逼近方法提取目标轮廓,具体包括:2. Use the polygon approximation method to extract the target contour, including:

2.1对芯片引脚图像进行边缘检测:2.1 Edge detection on chip pin image:

采用Canny算子边缘检测,得到芯片引脚图像的边缘轮廓信息;Using Canny operator edge detection, the edge contour information of the chip pin image is obtained;

2.2利用多边形逼近方法提取目标轮廓,即芯片引脚图像中心焊盘轮廓:2.2 Use the polygon approximation method to extract the target contour, that is, the center pad contour of the chip pin image:

通过多边形逼近方法提取芯片引脚图像中心焊盘轮廓,滤除掉其余轮廓部分,简化了后续图像处理环节,多边形逼近方法是从目标轮廓中挑出两个最远的点,进行连接;接着从目标轮廓上寻找一个离线段距离最远的点,将该点加入逼近后的新轮廓,即连接着三个点形成的三角形作为轮廓;最后选择三角形的任意一条边出发,重复上一步骤,将距离最远点加入新轮廓,不断迭代,直至满足输出的精度要求;The contour of the center pad of the chip pin image is extracted by the polygon approximation method, and the remaining contour parts are filtered out, which simplifies the subsequent image processing. The polygon approximation method is to pick out the two farthest points from the target contour and connect them; Find a point on the target contour with the farthest distance from the off-line segment, add this point to the new contour after approximation, that is, the triangle formed by connecting the three points as the contour; finally select any side of the triangle to start, repeat the previous step, and add Add a new contour to the farthest point, and iterate continuously until the output accuracy requirements are met;

3.提出改进Harris角点检测算法,获取目标轮廓顶点,具体包括:3. An improved Harris corner detection algorithm is proposed to obtain the target contour vertices, including:

3.1.确定选取阈值,获取目标轮廓角点:3.1. Determine the selection threshold and obtain the corner points of the target contour:

通常情况下,两幅黑白图像的点像素灰度之差小于最大像素灰度值的10%~15%时,人眼是难以分辨的,故选取阈值N提取图像目标轮廓角点,公式如下:Under normal circumstances, when the difference between the pixel gray levels of the two black and white images is less than 10% to 15% of the maximum pixel gray value, it is difficult for the human eye to distinguish, so the threshold N is selected to extract the corners of the target contour of the image, and the formula is as follows:

N=255×12%≈30N=255×12%≈30

3.2.提取目标轮廓拐角角点:3.2. Extract the corner points of the target contour:

提取并保存所有角点,按顺序读取角点中的三点Ma-n、Ma、Ma+n,三点构成一个由三个元素组成的模板,其中三点中将Ma作为模板中心,点的下标代表角点在所有角点中的序号,遍历所有角点,从初始值开始,Ma确定为一个实时性操作点,取其前后序号相距n的两点,Ma分别与模板中其他两点组成两条边,将两条边构成的夹角作为Ma点的角点响应值,由点Ma与点Ma-n距离确定边L1,点Ma与点Ma+n的距离确定边L2,点Ma-n与点Ma+n的距离确定边L3,三边可以根据余弦定理得到Ma点的角度,计算公式如下:Extract and save all the corner points, read the three points Man , M a , and M a+n in the corner points in sequence, the three points constitute a template consisting of three elements, among which the three points take M a as the template center , the subscript of the point represents the sequence number of the corner point in all the corner points, traverse all the corner points, starting from the initial value, M a is determined as a real-time operation point, take the two points whose front and rear numbers are separated by n, and M a are respectively the same as The other two points in the template form two sides, the angle formed by the two sides is used as the corner response value of point Ma, and the distance between point Ma and point Man determines the edge L 1 , point Ma and point M a + The distance of n determines the side L 2 , the distance between the point Man and the point M a +n determines the side L 3 , and the angle of the point Ma can be obtained from the three sides according to the cosine law. The calculation formula is as follows:

Figure GDA0003711964400000031
Figure GDA0003711964400000031

通过两条边构成的夹角,即角点响应值来判断是否保留角点,设g为角点响应值,若点Ma≥g,则保存为所需要的角点;反之,则去除;The angle formed by the two sides, that is, the response value of the corner point, is used to determine whether to retain the corner point. Let g be the response value of the corner point. If the point M a ≥ g, save it as the required corner point; otherwise, remove it;

3.3.剔除邻近角点,保留轮廓顶点:3.3. Eliminate adjacent corners and retain contour vertices:

提取出轮廓拐角角点后,周围可能还会存在有其它角点,为消除这一现象,将邻近角点进行剔除,取剩下的点作为轮廓拐角顶点,设图像高度为H,图像宽度为W,Corner(x,y)表示在图像(x,y)处是否有角点,令Corner(x,y)=1时,(x,y)处有角点,m×m(m>1)为以(x,y)为中心的矩阵的大小,则:After the contour corner points are extracted, there may be other corner points around. To eliminate this phenomenon, the adjacent corner points are removed, and the remaining points are taken as the contour corner vertices. Set the image height as H and the image width as W, Corner(x, y) indicates whether there is a corner point at the image (x, y), when Corner(x, y)=1, there is a corner point at (x, y), m×m (m>1 ) is the size of the matrix centered at (x, y), then:

Figure GDA0003711964400000032
Figure GDA0003711964400000032

其中,m≤x≤H,m≤y≤W,count指以(x,y)为中心的矩阵范围的角点,将(x,y)为中心的矩阵范围的邻近角点全部去除,保留目标轮廓拐角处剩下的角点作为顶点,以方便后续图像校正处理;Among them, m≤x≤H, m≤y≤W, count refers to the corner points of the matrix range with (x, y) as the center, and all the adjacent corner points of the matrix range with (x, y) as the center are removed and reserved The remaining corner points at the corners of the target contour are used as vertices to facilitate subsequent image correction processing;

4.最小二乘法拟合直线:4. Least squares fit straight line:

运用最小二乘法,将目标轮廓最长边的两个顶点进行直线拟合,作为芯片引脚图像的角度识别方向;Using the least squares method, the two vertices of the longest side of the target contour are fitted with a straight line as the angle identification direction of the chip pin image;

5.根据图像形心快速校正芯片并去除白边,具体包括:5. Quickly correct the chip and remove the white edge according to the image centroid, including:

5.1.以图像形心为旋转中心:5.1. Taking the image centroid as the rotation center:

为准确校正图像,利用形心法确定图像的中心位置,将形心坐标O点作为图像的旋转中心;In order to correct the image accurately, the centroid method is used to determine the center position of the image, and the centroid coordinate O point is used as the rotation center of the image;

5.2.获取图像倾斜角度,校正芯片引脚图像。5.2. Obtain the image tilt angle and correct the chip pin image.

进一步的,在所述步骤4中,设两个顶点坐标分别为p(x,y)、q(x,y),所述最小二乘法拟合直线计算公式如下:Further, in the step 4, set the coordinates of the two vertices to be p(x, y) and q(x, y) respectively, and the least squares fitting straight line calculation formula is as follows:

y=ax+by=ax+b

a和b分别为直线方程的斜率和截距,则:a and b are the slope and intercept of the straight line equation, respectively, then:

Figure GDA0003711964400000041
Figure GDA0003711964400000041

其中

Figure GDA0003711964400000042
分别为顶点p、q的横坐标与纵坐标的均值,
Figure GDA0003711964400000043
in
Figure GDA0003711964400000042
are the mean values of the abscissa and ordinate of vertices p and q, respectively,
Figure GDA0003711964400000043

进一步的,在所述步骤5.1中,图像左上角设为起始点坐标(0,0),右下角设为终点坐标(m,n),图像形心公式如下:Further, in the step 5.1, the upper left corner of the image is set as the starting point coordinates (0, 0), the lower right corner is set as the end point coordinates (m, n), and the image centroid formula is as follows:

Figure GDA0003711964400000044
Figure GDA0003711964400000044

其中,(x0,y0)是形心坐标,m、n分别为图像的行数和列数(m、n均为大于等于2的整数),f(x,y)是图像在点(x,y)处的灰度值。Among them, (x 0 , y 0 ) are the coordinates of the centroid, m and n are the number of rows and columns of the image respectively (m, n are both integers greater than or equal to 2), f(x, y) is the image at the point ( gray value at x, y).

进一步的,在所述步骤5.2中,芯片图像倾斜角度α由以下计算公式可求出:Further, in the step 5.2, the chip image tilt angle α can be calculated by the following calculation formula:

Figure GDA0003711964400000045
Figure GDA0003711964400000045

引脚图像在水平方向偏移值x可求得:The offset value x of the pin image in the horizontal direction can be obtained:

x=|px-hx|x=|p x -h x |

则引脚图像倾斜角度α为:Then the pin image tilt angle α is:

Figure GDA0003711964400000046
Figure GDA0003711964400000046

其中,l为点p到点O的垂直距离,OA为形心坐标往x轴正方向的延长线,h(x,y)为pq与OA的交点坐标。Among them, l is the vertical distance from point p to point O, OA is the extension of the centroid coordinate to the positive direction of the x-axis, and h(x, y) is the coordinate of the intersection point of pq and OA.

本发明的有益效果为:The beneficial effects of the present invention are:

本发明公开的一种QFN芯片引脚图像快速倾斜校正方法,为更快速、更准确地校正QFN芯片提供了一定的理论依据,提高QFN封装缺陷视觉检测效率。The invention discloses a quick tilt correction method for a pin image of a QFN chip, which provides a certain theoretical basis for correcting the QFN chip more quickly and accurately, and improves the visual inspection efficiency of QFN package defects.

附图说明Description of drawings

图1a是QFN芯片原始图像,图1b是高斯滤波图像,图1c是二值化图像;Figure 1a is the original image of the QFN chip, Figure 1b is the Gaussian filtered image, and Figure 1c is the binarized image;

图2a是Canny边缘检测图像,图2b是多边形逼近轮廓图像;Figure 2a is a Canny edge detection image, and Figure 2b is a polygon approximation contour image;

图3是根据阈值获取的角点图像;Fig. 3 is the corner image obtained according to the threshold;

图4是对图像目标轮廓顶点进行提取;Fig. 4 is to extract the image target contour vertex;

图5是选取最长轮廓的两个顶点,利用最小二乘法进行直线拟合;Fig. 5 is to select two vertices of the longest contour, and utilize the least squares method to carry out straight line fitting;

图6是角度偏差示意图;Fig. 6 is the schematic diagram of angle deviation;

图7a是旋转校正后的图像,图7b是去除白边后的图像;Fig. 7a is the image after rotation correction, Fig. 7b is the image after removing the white edge;

图8是Hough变换算法检测角度后的校正标注示意图;FIG. 8 is a schematic diagram of the correction labeling after the Hough transform algorithm detects the angle;

图9是最小外接矩法检测角度后的校正标注示意图;FIG. 9 is a schematic diagram of calibration and labeling after the minimum circumscribed moment method detects the angle;

图10是基于改进Harris角点检测算法检测角度后的校正标注示意图;FIG. 10 is a schematic diagram of the correction annotation after the angle is detected based on the improved Harris corner detection algorithm;

图11是三种算法的角度偏差数据统计表;Figure 11 is the angle deviation data statistics table of the three algorithms;

图12是三种算法的运算时间数据统计表;Figure 12 is the operation time data statistics table of the three algorithms;

图13是QFN芯片引脚图像快速倾斜校正方法的流程图。FIG. 13 is a flow chart of a method for fast tilt correction of a pin image of a QFN chip.

具体实施方式Detailed ways

以下实施例进一步说明本发明的内容,但不应理解为对本发明的限制。在不背离本发明实质的情况下,对本发明方法、步骤或条件所作的修改和替换,均属于本发明的范围。The following examples further illustrate the content of the present invention, but should not be construed as limiting the present invention. Modifications and substitutions made to the methods, steps or conditions of the present invention without departing from the essence of the present invention all belong to the scope of the present invention.

为了提高QFN封装缺陷视觉检测效率,本实施方式中公开一种QFN芯片引脚图像快速倾斜校正方法,图1a为原始图像,以图1a作为本实施方式的解释图像,具体的校正过程包括以下步骤:In order to improve the visual detection efficiency of QFN package defects, this embodiment discloses a method for fast tilt correction of QFN chip pin images. Fig. 1a is the original image, and Fig. 1a is used as the explanatory image of this embodiment. The specific correction process includes the following steps :

(1)对工控机采集的芯片引脚图像进行预处理:(1) Preprocess the chip pin image collected by the industrial computer:

(1.1)图像滤波:(1.1) Image filtering:

为去除噪声,减少图像失真,采用5×5高斯滤波器与图像进行卷积(如图1b),以平滑图像,减少边缘检测器上明显的噪声影响。在图像处理中,常使用二维高斯函数进行滤波,计算公式如下:In order to remove noise and reduce image distortion, a 5 × 5 Gaussian filter is used to convolve the image (as shown in Figure 1b) to smooth the image and reduce the obvious noise effect on the edge detector. In image processing, two-dimensional Gaussian function is often used for filtering, and the calculation formula is as follows:

Figure GDA0003711964400000051
Figure GDA0003711964400000051

其中G(x,y)为二维高斯函数,(x,y)为点坐标,σ为标准差,A为归一化系数,使不同的权重之和为一。Where G(x, y) is a two-dimensional Gaussian function, (x, y) is the point coordinate, σ is the standard deviation, and A is the normalization coefficient, so that the sum of different weights is one.

(1.2)二值化处理:(1.2) Binarization processing:

采用固定阈值法对图像进行二值化处理(如图1c),计算公式如下:The fixed threshold method is used to binarize the image (as shown in Figure 1c). The calculation formula is as follows:

Figure GDA0003711964400000052
Figure GDA0003711964400000052

其中f(x,y)表示图像像素值的分布函数,g(x,y)表示阈值分割之后的像素值分布函数,固定阈值T=145;Where f(x, y) represents the distribution function of image pixel values, g(x, y) represents the pixel value distribution function after threshold segmentation, and the fixed threshold T=145;

(2)利用多边形逼近方法提取目标轮廓,具体包括:(2) Extract the target contour by using the polygon approximation method, which specifically includes:

(2.1)对芯片引脚图像进行边缘检测:(2.1) Edge detection on the chip pin image:

采用Canny算子边缘检测,得到芯片引脚图像的边缘轮廓信息,如图2a所示;Using Canny operator edge detection, the edge contour information of the chip pin image is obtained, as shown in Figure 2a;

(2.2)利用多边形逼近方法提取目标轮廓,即芯片引脚图像中心焊盘轮廓:(2.2) Use the polygon approximation method to extract the target contour, that is, the center pad contour of the chip pin image:

通过多边形逼近方法提取芯片引脚图像中心焊盘轮廓(如图2b),滤除掉其余轮廓部分,简化了后续环节图像处理。多边形逼近方法是从目标轮廓中挑出两个最远的点,进行连接;接着从目标轮廓上寻找一个离线段距离最远的点,将该点加入逼近后的新轮廓,即连接着三个点形成的三角形作为轮廓;最后选择三角形的任意一条边出发,重复上一步骤,将距离最远点加入新轮廓,不断迭代,直至满足输出的精度要求。The contour of the center pad of the chip pin image is extracted by the polygon approximation method (as shown in Figure 2b), and the remaining contour parts are filtered out, which simplifies the subsequent image processing. The polygon approximation method is to pick out the two farthest points from the target contour and connect them; then find a point with the furthest distance from the off-line segment from the target contour, and add this point to the new contour after approximation, that is, connect the three The triangle formed by the points is used as the contour; finally, select any side of the triangle to start, repeat the previous step, add the farthest point to the new contour, and iterate continuously until the output accuracy requirements are met.

(3)提出改进Harris角点检测算法,获取目标轮廓顶点,具体包括:(3) An improved Harris corner detection algorithm is proposed to obtain the target contour vertices, including:

(3.1)确定选取阈值,获取目标轮廓角点:(3.1) Determine the selection threshold and obtain the corner points of the target contour:

通常情况下,两幅黑白图像的点像素灰度之差小于最大像素灰度值的10%~15%时,人眼是难以分辨的,故选取阈值N提取图像目标轮廓角点(如图3),公式如下:Under normal circumstances, when the difference between the pixel gray levels of two black and white images is less than 10% to 15% of the maximum pixel gray value, it is difficult for the human eye to distinguish, so the threshold N is selected to extract the corners of the target contour of the image (as shown in Figure 3). ), the formula is as follows:

N=255×12%≈30N=255×12%≈30

(3.2)提取目标轮廓拐角角点:(3.2) Extract the corner points of the target contour:

提取并保存所有角点,按顺序读取角点中的三点Ma-n、Ma、Ma+n,三点构成一个由三个元素组成的模板,其中三点中将Ma作为模板中心,点的下标代表角点在所有角点中的序号。遍历所有角点,从初始值开始,Ma确定为一个实时性操作点,取其前后序号相距n的两点,Ma分别与模板中其他两点组成两条边,将两条边构成的夹角作为Ma点的角点响应值。由点Ma与点Ma-n距离确定边L1,点Ma与点Ma+n的距离确定边L2,点Ma-n与点Ma+n的距离确定边L3,三边可以根据余弦定理得到Ma点的角度,计算公式如下:Extract and save all the corner points, read the three points Man , M a , and M a+n in the corner points in sequence, the three points constitute a template consisting of three elements, among which the three points take M a as the template center , the subscript of the point represents the sequence number of the corner point among all the corner points. Traverse all the corner points, starting from the initial value, M a is determined as a real-time operation point, take the two points whose front and rear serial numbers are separated by n, M a and the other two points in the template form two sides respectively, and the two sides constituted by The included angle is taken as the corner response value of point Ma . The side L 1 is determined by the distance between the point Ma and the point Man, the side L 2 is determined by the distance between the point Ma and the point M a +n , and the side L 3 is determined by the distance between the point Man and the point M a +n. The law of cosines obtains the angle of the point M a , and the calculation formula is as follows:

Figure GDA0003711964400000061
Figure GDA0003711964400000061

通过两条边构成的夹角,即角点响应值来判断是否保留角点。设g为角点响应值,若点Ma≥g,则保存为所需要的角点;反之,则去除。The angle formed by the two sides, that is, the response value of the corner point, is used to determine whether to retain the corner point. Let g be the response value of the corner point, if the point Ma ≥ g , save it as the required corner point; otherwise, remove it.

(3.3)剔除邻近角点,保留轮廓顶点:(3.3) Eliminate adjacent corners and retain contour vertices:

提取出轮廓拐角角点后,周围可能还会存在有其它角点,为消除这一现象,将邻近角点进行剔除,取剩下的点作为轮廓拐角顶点。设图像高度为H,图像宽度为W,Corner(x,y)表示在图像(x,y)处是否有角点,令Corner(x,y)=1时,(x,y)处有角点,m×m(m>1)为以(x,y)为中心的矩阵的大小,则:After the contour corners are extracted, there may be other corners around. To eliminate this phenomenon, the adjacent corners are removed, and the remaining points are taken as contour corner vertices. Let the image height be H, the image width be W, Corner(x, y) indicates whether there is a corner at the image (x, y), and when Corner(x, y) = 1, there is a corner at (x, y) point, m×m (m>1) is the size of the matrix centered at (x, y), then:

Figure GDA0003711964400000071
Figure GDA0003711964400000071

其中m≤x≤H,m≤y≤W,count指以(x,y)为中心的矩阵范围的角点,将(x,y)为中心的矩阵范围的邻近角点全部去除,保留目标轮廓拐角处剩下的角点作为顶点(如图4),以方便后续图像校正处理。Where m≤x≤H, m≤y≤W, count refers to the corner points of the matrix range centered on (x, y), remove all adjacent corner points of the matrix range centered on (x, y), and keep the target The remaining corner points at the corners of the contour are used as vertices (as shown in Figure 4) to facilitate subsequent image correction processing.

(4)最小二乘法拟合直线:(4) Fitting a straight line by the least squares method:

运用最小二乘法,将目标轮廓最长边的两个顶点进行直线拟合,作为芯片引脚图像的角度识别方向,如图5所示。Using the least squares method, the two vertices of the longest side of the target contour are fitted with a straight line, as the angle recognition direction of the chip pin image, as shown in Figure 5.

(5)根据图像形心快速校正芯片并去除白边,具体包括:(5) Quickly correct the chip and remove the white edge according to the image centroid, including:

(5.1)以图像形心为旋转中心:(5.1) Taking the image centroid as the rotation center:

为准确校正图像,利用形心法确定图像的中心位置,将形心坐标O点作为图像的旋转中心。In order to correct the image accurately, the centroid method is used to determine the center position of the image, and the centroid coordinate O point is used as the rotation center of the image.

(5.2)获取图像倾斜角度,校正芯片引脚图像:(5.2) Obtain the image tilt angle and correct the chip pin image:

QFN芯片封装入载带时,存在肉眼难以辨别的角度偏差,为了计算偏差角度,提出改进Harris角点检测算法,结合多边形逼近轮廓,利用最小二乘法对最长边的两个顶点进行直线拟合,此时芯片倾斜角度α与芯片在水平方向偏移值x具有直角三角形关系,如图6所示,根据倾斜角度α校正芯片(如图7a),并将旋转校正后的芯片引脚图像存在的白边进行去除(如图7b)。When the QFN chip is packaged into the carrier tape, there is an angle deviation that is difficult to distinguish with the naked eye. In order to calculate the deviation angle, an improved Harris corner detection algorithm is proposed. Combined with the polygon approximation outline, the least squares method is used to fit the two vertices of the longest side. , at this time, the chip tilt angle α and the chip offset value x in the horizontal direction have a right triangle relationship. As shown in Figure 6, the chip is corrected according to the tilt angle α (as shown in Figure 7a), and the rotated corrected chip pin image exists The white edge is removed (as shown in Figure 7b).

在所述步骤(4)中,设两个顶点坐标分别为p(x,y)、q(x,y),所述最小二乘法拟合直线计算公式如下:In the step (4), set the coordinates of the two vertices to be p(x, y) and q(x, y) respectively, and the least squares fitting straight line calculation formula is as follows:

y=ax+by=ax+b

a和b分别为直线方程的斜率和截距,则:a and b are the slope and intercept of the straight line equation, respectively, then:

Figure GDA0003711964400000072
Figure GDA0003711964400000072

其中

Figure GDA0003711964400000073
分别为顶点p、q的横坐标与纵坐标的均值,
Figure GDA0003711964400000074
in
Figure GDA0003711964400000073
are the mean values of the abscissa and ordinate of vertices p and q, respectively,
Figure GDA0003711964400000074

在所述步骤(5.1)中,图像左上角设为起始点坐标(0,0),右下角设为终点坐标(m,n),图像形心公式如下:In the step (5.1), the upper left corner of the image is set as the starting point coordinates (0, 0), the lower right corner is set as the end point coordinates (m, n), and the image centroid formula is as follows:

Figure GDA0003711964400000075
Figure GDA0003711964400000075

其中,(x0,y0)是形心坐标,m、n分别为图像的行数和列数(m、n均为大于等于2的整数),f(x,y)是图像在点(x,y)处的灰度值。Among them, (x 0 , y 0 ) are the coordinates of the centroid, m and n are the number of rows and columns of the image respectively (m, n are both integers greater than or equal to 2), f(x, y) is the image at the point ( gray value at x, y).

在所述步骤(5.2)中,芯片图像倾斜角度α由以下计算公式可求出:In the step (5.2), the tilt angle α of the chip image can be calculated by the following formula:

Figure GDA0003711964400000081
Figure GDA0003711964400000081

引脚图像在水平方向偏移值x可求得:The offset value x of the pin image in the horizontal direction can be obtained:

x=|px-hx|x=|p x -h x |

则引脚图像倾斜角度α为:Then the pin image tilt angle α is:

Figure GDA0003711964400000082
Figure GDA0003711964400000082

其中,l为点p到点O的垂直距离,OA为形心坐标往x轴正方向的延长线,h(x,y)为pq与OA的交点坐标。Among them, l is the vertical distance from point p to point O, OA is the extension of the centroid coordinate to the positive direction of the x-axis, and h(x, y) is the coordinate of the intersection point of pq and OA.

图13为QFN芯片引脚图像快速倾斜校正方法的流程图,对上述QFN芯片引脚图像快速倾斜校正方法进行实验验证与比较如下:Figure 13 is a flow chart of the method for fast tilt correction of the pin image of the QFN chip. The experimental verification and comparison of the above method of fast tilt correction of the pin image of the QFN chip are as follows:

(1)本实施方式中公开的校正方法与传统Hough变换、最小二阶矩法校正精度比较:(1) The correction method disclosed in this embodiment is compared with the correction accuracy of the traditional Hough transform and the least second moment method:

本实施方式采用内存为4GB,处理器为AMD A10-7300RadeonR6,10ComputeCores4C+6G@1.9GHz的操作系统,Visual Studio版本为2013。选取10幅不同QFN芯片引脚图像为实验对象,在相同环境下运行程序,将本实施方式公开的校正方法与传统Hough变换、最小外接矩法进行对比。图8、图9、图10分别为上述三种算法检测角度后的校正标注示意图。以校正后的芯片中心焊盘作角度检测与验证,灰色框线为经不同算法得到的芯片五边形部分的最小外接矩形,黑色框线为芯片五边形部分的人工标注的理想外接矩形。不难发现,图8与图9存在一定的角度偏差。利用本实施方式公开的校正方法校正后的外接矩形标注示意图如图10所示,标注的灰色框线与人工标注的黑色框线接近重合,因此本实施方式公开的校正方法获取得倾斜角度更加准确。图11列出了三种算法检测出的该芯片倾斜角度。In this implementation manner, the memory is 4GB, the processor is AMD A10-7300RadeonR6, the operating system is 10ComputeCores4C+6G@1.9GHz, and the Visual Studio version is 2013. Select 10 different QFN chip pin images as experimental objects, run the program in the same environment, and compare the correction method disclosed in this embodiment with the traditional Hough transform and the minimum external moment method. FIG. 8 , FIG. 9 , and FIG. 10 are schematic diagrams of correction labels after the angles are detected by the above three algorithms, respectively. The corrected center pad of the chip is used for angle detection and verification. The gray frame line is the minimum circumscribed rectangle of the pentagon part of the chip obtained by different algorithms, and the black frame line is the ideal circumscribed rectangle of the artificially marked pentagon part of the chip. It is not difficult to find that there is a certain angular deviation between FIG. 8 and FIG. 9 . The schematic diagram of the circumscribed rectangle marked by the correction method disclosed in this embodiment is shown in FIG. 10 . The marked gray frame line and the manually marked black frame line are nearly coincident. Therefore, the correction method disclosed in this embodiment can obtain a more accurate inclination angle. . Figure 11 lists the tilt angles of the chip detected by the three algorithms.

(2)本实施方式公开的校正方法与传统Hough变换、最小二阶矩法校正时间比较:(2) The correction method disclosed in this embodiment is compared with the correction time of the traditional Hough transform and the least second moment method:

为了检测本实施方式公开的校正方法与传统Hough变换、最小外接矩法的运行时间差异,分别对10幅不同QFN芯片引脚图像运行时间进行实验对比。图12列出了三种算法的运行时间。以图形编号5为例,传统Hough变换校正时间为357ms,最小外接矩法校正时间为116ms,而本实施方式公开的校正方法仅用18ms就完成了芯片图像校正过程。Hough变换对10幅芯片引脚图像校正平均时间为412.6ms,最小外接矩法对10幅芯片引脚图像校正平均时间为125.8ms,相对传统Hough变换,本实施方式公开的校正方法运行时间仅为其1/34,相对最小外接矩法,本实施方式公开的校正方法运行时间仅为其1/10。因此本实施方式中提出的QFN芯片图像快速倾斜校正方法不仅准确度高,而且大幅地减少了运行时间,计算效率更高。In order to detect the difference of the running time between the calibration method disclosed in this embodiment and the traditional Hough transform and the least external moment method, the running time of 10 different QFN chip pin images are experimentally compared. Figure 12 lists the running times of the three algorithms. Taking figure number 5 as an example, the traditional Hough transform correction time is 357ms, and the minimum circumscribed moment method correction time is 116ms, while the correction method disclosed in this embodiment only takes 18ms to complete the chip image correction process. The average time for Hough transform to correct 10 chip pin images is 412.6ms, and the average time for minimum external moment method to correct 10 chip pin images is 125.8ms. Compared with traditional Hough transform, the running time of the correction method disclosed in this embodiment is only Its 1/34, compared to the minimum external moment method, the running time of the calibration method disclosed in this embodiment is only 1/10 of that. Therefore, the fast tilt correction method for the QFN chip image proposed in this embodiment not only has high accuracy, but also greatly reduces the running time and has higher computational efficiency.

综上所述,本实施方式提出的一种QFN芯片引脚图像快速倾斜校正方法,是一种比传统算法速度更快、效率更高的方法,可用于生产QFN芯片校正环节,为芯片的倾斜校正、检测芯片外观缺陷提供了清晰准确地图像,提高QFN封装缺陷视觉检测效率。To sum up, a method for fast tilt correction of QFN chip pin images proposed in this embodiment is a faster and more efficient method than traditional algorithms, and can be used in the production of QFN chip correction links, which is the basis for the tilt of the chip. Correcting and detecting chip appearance defects provides clear and accurate images and improves the visual inspection efficiency of QFN package defects.

以上显示和描述了本发明的基本原理、主要特征及优点。但是以上所述仅为本发明的具体实施例,本发明的技术特征并不局限于此,任何本领域的技术人员在不脱离本发明的技术方案下得出的其他实施方式均应涵盖在本发明的专利范围之中。The foregoing has shown and described the basic principles, main features and advantages of the present invention. However, the above descriptions are only specific embodiments of the present invention, and the technical features of the present invention are not limited thereto. within the scope of the invention patent.

Claims (4)

1.一种针对QFN芯片引脚图像快速倾斜校正的方法,其特征在于,包括以下步骤:1. a method for quick tilt correction for QFN chip pin image, is characterized in that, comprises the following steps: (1)对工控机采集的芯片引脚图像进行预处理:(1) Preprocess the chip pin image collected by the industrial computer: 1.1)图像滤波:1.1) Image filtering: 为去除噪声,减少图像失真,采用5×5高斯滤波器与图像进行卷积,在图像处理中,使用二维高斯函数进行滤波,计算公式如下:In order to remove noise and reduce image distortion, a 5×5 Gaussian filter is used to convolve the image. In image processing, a two-dimensional Gaussian function is used for filtering. The calculation formula is as follows:
Figure FDA0003711964390000011
Figure FDA0003711964390000011
其中,G(x,y)为二维高斯函数,(x,y)为点坐标,σ为标准差,A为归一化系数,使不同的权重之和为一;Among them, G(x, y) is the two-dimensional Gaussian function, (x, y) is the point coordinate, σ is the standard deviation, and A is the normalization coefficient, so that the sum of different weights is one; 1.2)二值化处理:1.2) Binarization processing: 采用固定阈值法对图像进行二值化处理,计算公式如下:The fixed threshold method is used to binarize the image, and the calculation formula is as follows:
Figure FDA0003711964390000012
Figure FDA0003711964390000012
其中,f(x,y)表示图像像素值的分布函数,g(x,y)表示阈值分割之后的像素值分布函数,固定阈值T=145;Among them, f(x, y) represents the distribution function of image pixel values, g(x, y) represents the pixel value distribution function after threshold segmentation, and the fixed threshold T=145; (2)利用多边形逼近方法提取目标轮廓,具体包括:(2) Extract the target contour by using the polygon approximation method, which specifically includes: 2.1)对芯片引脚图像进行边缘检测:2.1) Edge detection on the chip pin image: 采用Canny算子边缘检测,得到芯片引脚图像的边缘轮廓信息;Using Canny operator edge detection, the edge contour information of the chip pin image is obtained; 2.2)利用多边形逼近方法提取目标轮廓:2.2) Use the polygon approximation method to extract the target contour: 通过多边形逼近方法提取芯片引脚图像中心焊盘轮廓,滤除掉其余轮廓部分,多边形逼近方法是从目标轮廓中挑出两个最远的点,进行连接;接着从目标轮廓上寻找一个离线段距离最远的点,将该点加入逼近后的新轮廓,即连接着三个点形成的三角形作为轮廓;最后选择三角形的任意一条边出发,重复上一步骤,将距离最远点加入新轮廓,不断迭代,直至满足输出的精度要求;The contour of the center pad of the chip pin image is extracted by the polygon approximation method, and the remaining contour parts are filtered out. The polygon approximation method is to pick out the two farthest points from the target contour and connect them; then find an offline segment from the target contour. The farthest point is added to the new contour after approximation, that is, the triangle formed by connecting the three points is used as the contour; finally, any side of the triangle is selected to start, and the previous step is repeated to add the farthest point to the new contour. , and iterate continuously until the accuracy requirements of the output are met; (3)提出改进Harris角点检测算法,获取目标轮廓顶点,具体包括:(3) An improved Harris corner detection algorithm is proposed to obtain the target contour vertices, including: 3.1)确定选取阈值,获取目标轮廓角点:3.1) Determine the selection threshold and obtain the corner points of the target contour: 通常情况下,两幅黑白图像的点像素灰度之差小于最大像素灰度值的10%~15%时,人眼难以分辨,故选取阈值N提取图像目标轮廓角点,公式如下:Under normal circumstances, when the difference between the pixel gray levels of two black and white images is less than 10% to 15% of the maximum pixel gray value, it is difficult for the human eye to distinguish. Therefore, the threshold N is selected to extract the corner points of the target contour of the image. The formula is as follows: N=255×12%≈30N=255×12%≈30 3.2)提取目标轮廓拐角角点:3.2) Extract the corner points of the target contour: 提取并保存所有角点,按顺序读取角点中的三点Ma-n、Ma、Ma+n,三点构成一个由三个元素组成的模板,其中三点中将Ma作为模板中心,点的下标代表角点在所有角点中的序号,遍历所有角点,从初始值开始,Ma确定为一个实时性操作点,取其前后序号相距n的两点,Ma分别与模板中其他两点组成两条边,将两条边构成的夹角作为Ma点的角点响应值,由点Ma与点Ma-n距离确定边L1,点Ma与点Ma+n的距离确定边L2,点Ma-n与点Ma+n的距离确定边L3,三边可以根据余弦定理得到Ma点的角度,计算公式如下:Extract and save all the corner points, read the three points Man , M a , and M a+n in the corner points in sequence, the three points constitute a template consisting of three elements, among which the three points take M a as the template center , the subscript of the point represents the sequence number of the corner point in all the corner points, traverse all the corner points, starting from the initial value, M a is determined as a real-time operation point, take the two points whose front and rear numbers are separated by n, and M a are respectively the same as The other two points in the template form two sides, the angle formed by the two sides is used as the corner response value of point Ma, and the distance between point Ma and point Man determines the edge L 1 , point Ma and point M a + The distance of n determines the side L 2 , the distance between the point Man and the point M a +n determines the side L 3 , and the angle of the point Ma can be obtained from the three sides according to the cosine law. The calculation formula is as follows:
Figure FDA0003711964390000021
Figure FDA0003711964390000021
通过两条边构成的夹角,即角点响应值来判断是否保留角点,设g为角点响应值,若点Ma≥g,则保存为所需要的角点;反之,则去除;The angle formed by the two sides, that is, the response value of the corner point, is used to determine whether to retain the corner point. Let g be the response value of the corner point. If the point M a ≥ g, save it as the required corner point; otherwise, remove it; 3.3)剔除邻近角点,保留轮廓顶点:3.3) Eliminate adjacent corners and retain contour vertices: 提取出轮廓拐角角点后,周围可能还会存在有其它角点,为消除这一现象,将邻近角点进行剔除,取剩下的点作为轮廓拐角顶点,设图像高度为H,图像宽度为W,Corner(x,y)表示在图像(x,y)处是否有角点,令Corner(x,y)=1时,(x,y)处有角点,m×m为以(x,y)为中心的矩阵的大小,其中m>1,则:After the contour corner points are extracted, there may be other corner points around. To eliminate this phenomenon, the adjacent corner points are removed, and the remaining points are taken as the contour corner vertices. Set the image height as H and the image width as W, Corner(x, y) indicates whether there is a corner point at the image (x, y), when Corner(x, y) = 1, there is a corner point at (x, y), m×m is based on (x, y) , y) is the size of the centered matrix, where m>1, then:
Figure FDA0003711964390000022
Figure FDA0003711964390000022
其中,m≤x≤H,m≤y≤W,count指以(x,y)为中心的矩阵范围的角点,将(x,y)为中心的矩阵范围的邻近角点全部去除,保留目标轮廓拐角处剩下的角点作为顶点,以方便后续图像校正处理;Among them, m≤x≤H, m≤y≤W, count refers to the corner points of the matrix range with (x, y) as the center, and all the adjacent corner points of the matrix range with (x, y) as the center are removed and reserved The remaining corner points at the corners of the target contour are used as vertices to facilitate subsequent image correction processing; (4)最小二乘法拟合直线:(4) Fitting a straight line by the least squares method: 运用最小二乘法,将目标轮廓最长边的两个顶点进行直线拟合,作为芯片引脚图像的角度识别方向;Using the least squares method, the two vertices of the longest side of the target contour are fitted with a straight line as the angle identification direction of the chip pin image; (5)根据图像形心快速校正芯片并去除白边,具体包括:(5) Quickly correct the chip and remove the white edge according to the image centroid, including: 5.1)以图像形心为旋转中心:5.1) Take the image centroid as the rotation center: 为准确校正图像,利用形心法确定图像的中心位置,将形心坐标O点作为图像的旋转中心;In order to correct the image accurately, the centroid method is used to determine the center position of the image, and the centroid coordinate O point is used as the rotation center of the image; 5.2)获取图像倾斜角度,校正芯片引脚图像。5.2) Obtain the image tilt angle and correct the chip pin image.
2.如权利要求1所述的一种针对QFN芯片引脚图像快速倾斜校正的方法,其特征在于,在步骤4中,设两个顶点坐标分别为p(x,y)、q(x,y),所述最小二乘法拟合直线计算公式如下:2. a kind of method for quick tilt correction for QFN chip pin image as claimed in claim 1, is characterized in that, in step 4, set two vertex coordinates to be respectively p(x, y), q(x, y), the least squares fitting straight line calculation formula is as follows: y=ax+by=ax+b a和b分别为直线方程的斜率和截距,则:a and b are the slope and intercept of the straight line equation, respectively, then:
Figure FDA0003711964390000031
Figure FDA0003711964390000031
其中,
Figure FDA0003711964390000032
分别为顶点p、q的横坐标与纵坐标的均值,
Figure FDA0003711964390000033
in,
Figure FDA0003711964390000032
are the mean values of the abscissa and ordinate of vertices p and q, respectively,
Figure FDA0003711964390000033
3.如权利要求2所述的一种针对QFN芯片引脚图像快速倾斜校正的方法,其特征在于,在步骤5.1中,图像左上角设为起始点坐标(0,0),右下角设为终点坐标(m,n),图像形心公式如下:3. a kind of method for fast tilt correction of QFN chip pin image as claimed in claim 2, is characterized in that, in step 5.1, the upper left corner of the image is set as the starting point coordinates (0, 0), and the lower right corner is set as The coordinates of the end point (m, n), the image centroid formula is as follows:
Figure FDA0003711964390000034
Figure FDA0003711964390000034
其中,(x0,y0)是形心坐标,m、n分别为图像的行数和列数,m、n均为大于等于2的整数,f(x,y)是图像在点(x,y)处的灰度值。Among them, (x 0 , y 0 ) are the centroid coordinates, m and n are the number of rows and columns of the image, respectively, m and n are integers greater than or equal to 2, and f(x, y) is the image at point (x) , the gray value at y).
4.如权利要求3所述的一种针对QFN芯片引脚图像快速倾斜校正的方法,其特征在于,在步骤5.2中,芯片图像倾斜角度α由以下计算公式可求出:4. a kind of method for quick tilt correction for QFN chip pin image as claimed in claim 3, is characterized in that, in step 5.2, chip image tilt angle α can be obtained by following calculation formula:
Figure FDA0003711964390000036
Figure FDA0003711964390000036
引脚图像在水平方向偏移值x可求得:The offset value x of the pin image in the horizontal direction can be obtained: x=|px-hx|x=|p x -h x | 则引脚图像倾斜角度α为:Then the pin image tilt angle α is:
Figure FDA0003711964390000035
Figure FDA0003711964390000035
其中,l为点p到点O的垂直距离,OA为形心坐标往x轴正方向的延长线,h(x,y)为pq与OA的交点坐标。Among them, l is the vertical distance from point p to point O, OA is the extension of the centroid coordinate to the positive direction of the x-axis, and h(x, y) is the coordinate of the intersection of pq and OA.
CN201911182587.1A 2019-11-27 2019-11-27 QFN chip pin image rapid inclination correction method Active CN110992326B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911182587.1A CN110992326B (en) 2019-11-27 2019-11-27 QFN chip pin image rapid inclination correction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911182587.1A CN110992326B (en) 2019-11-27 2019-11-27 QFN chip pin image rapid inclination correction method

Publications (2)

Publication Number Publication Date
CN110992326A CN110992326A (en) 2020-04-10
CN110992326B true CN110992326B (en) 2022-08-09

Family

ID=70087207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911182587.1A Active CN110992326B (en) 2019-11-27 2019-11-27 QFN chip pin image rapid inclination correction method

Country Status (1)

Country Link
CN (1) CN110992326B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111537518B (en) * 2020-05-25 2024-05-28 珠海格力智能装备有限公司 Method and device for detecting flaws of capacitor terminal, storage medium and processor
CN111754461B (en) * 2020-05-28 2024-03-01 江苏理工学院 Method and device for positioning image character area of semiconductor chip
CN111950315B (en) * 2020-10-19 2023-11-07 江苏理工学院 Method, device and storage medium for segmenting and identifying multiple bar code images
CN112733843B (en) * 2020-12-30 2025-01-10 深圳市路远智能装备有限公司 A visual identification method for BGA
CN113379681B (en) * 2021-05-20 2022-11-04 深圳技术大学 Method, system, electronic device, and storage medium for acquiring tilt angle of LED chip
CN113763279A (en) * 2021-09-10 2021-12-07 厦门理工学院 A Precise Correction Processing Method for Image with Rectangular Frame
CN113733827A (en) * 2021-10-19 2021-12-03 长沙立中汽车设计开发股份有限公司 Device and method for detecting relative rotation angle between semitrailer trailer and trailer
CN114229396B (en) * 2022-02-18 2022-05-13 深圳市创新特科技有限公司 Correcting device and correcting method for taking and placing positions of circuit board
CN115308222B (en) * 2022-07-11 2024-02-09 江苏汤谷智能科技有限公司 System and method for identifying poor chip appearance based on machine vision
CN115830049B (en) * 2022-07-18 2024-08-09 宁德时代新能源科技股份有限公司 Corner detection method and device
CN116051389A (en) * 2022-08-10 2023-05-02 荣耀终端有限公司 Calibration image correction method and device and electronic equipment
CN116309325A (en) * 2023-02-08 2023-06-23 深圳市振华兴智能技术有限公司 Patch detection method and system based on deep learning
CN117274246B (en) * 2023-11-17 2024-02-20 深圳市大族封测科技股份有限公司 Bonding pad identification method, computer equipment and storage medium
CN117830336B (en) * 2024-03-04 2024-06-14 福建帝视科技集团有限公司 Polygonal contour detection method and device based on line scanning camera imaging
CN118212210B (en) * 2024-04-02 2024-12-20 常州信息职业技术学院 Vehicle low beam light pattern feature point detection method and system based on point symmetry

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104359402A (en) * 2014-11-17 2015-02-18 南京工业大学 Detection method for rectangular pin element visual positioning
CN109785316A (en) * 2019-01-22 2019-05-21 湖南大学 A kind of chip surface defect detection method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110933926B (en) * 2019-11-13 2021-04-06 浙江工业大学 An automatic correction method for the angle of the nozzle component of the placement machine based on the corner point detection

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104359402A (en) * 2014-11-17 2015-02-18 南京工业大学 Detection method for rectangular pin element visual positioning
CN109785316A (en) * 2019-01-22 2019-05-21 湖南大学 A kind of chip surface defect detection method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SIFT在高分辨率SAR图像自动配准中的性能分析;孙艳丽等;《电子设计工程》;20110430;第19卷(第07期);全文 *
一种基于局部不变特征的SAR图像配准新算法;金斌等;《哈尔滨工程大学学报》;20141130;第46卷(第11期);全文 *

Also Published As

Publication number Publication date
CN110992326A (en) 2020-04-10

Similar Documents

Publication Publication Date Title
CN110992326B (en) QFN chip pin image rapid inclination correction method
CN107203990B (en) Label breakage detection method based on template matching and image quality evaluation
CN103914827B (en) The visible detection method of weather strip for automobile profile defects
CN110276750A (en) A Method for Extracting Straight Line Length of Wafer with Arbitrary Tilt Angle and Isolating Grain Area
CN115294099B (en) Method and system for detecting hairline defect in steel plate rolling process
CN108171688A (en) A kind of wafer surface defects detection method based on Gabor characteristic Yu random dimensionality reduction
CN105260694B (en) A kind of two-dimension code area localization method based on multistage key extraction with analysis
CN114581446B (en) Battery core abnormity detection method and system of laminated battery
CN113989308B (en) A polygonal target segmentation method based on Hough transform and template matching
CN113971681B (en) A belt conveyor edge detection method in complex environment
CN106780437B (en) A Fast QFN Chip Plastic Package Image Acquisition and Enlargement Method
CN116485764A (en) Method, system, terminal and medium for identifying structural surface defects
CN115018785A (en) Tension detection method of hoisting wire rope based on visual vibration frequency recognition
CN115587966A (en) A method and system for detecting whether parts are missing or not under the condition of uneven illumination
CN117152165A (en) Photosensitive chip defect detection method and device, storage medium and electronic equipment
CN107038703A (en) A kind of goods distance measurement method based on binocular vision
CN118258815A (en) Detection method for detecting flexible film sensor based on machine vision
CN109934817B (en) A detection method for fruit body external contour deformity
CN114140426B (en) Inclination correction algorithm for printing carbon line image of humidity sensor ceramic substrate
CN104009144B (en) Substrate and the matching process of chip in the welding of great power LED eutectic
CN112923852B (en) SD card pose detection method based on dynamic corner positioning
CN117911419A (en) Method and device for detecting steel rotation angle enhancement of medium plate, medium and equipment
CN111754461A (en) Method and device for locating image character area of semiconductor chip
CN114677428B (en) Transmission line ice thickness detection method based on UAV image processing
CN116468691A (en) Intelligent detection method and device applied to product sorting

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant