WO2017067321A1 - 一种基于外轮廓的pcb板卡匹配方法及装置 - Google Patents

一种基于外轮廓的pcb板卡匹配方法及装置 Download PDF

Info

Publication number
WO2017067321A1
WO2017067321A1 PCT/CN2016/096751 CN2016096751W WO2017067321A1 WO 2017067321 A1 WO2017067321 A1 WO 2017067321A1 CN 2016096751 W CN2016096751 W CN 2016096751W WO 2017067321 A1 WO2017067321 A1 WO 2017067321A1
Authority
WO
WIPO (PCT)
Prior art keywords
tan
pcb
target image
axis
image
Prior art date
Application number
PCT/CN2016/096751
Other languages
English (en)
French (fr)
Inventor
廖明熙
Original Assignee
广州视源电子科技股份有限公司
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 广州视源电子科技股份有限公司 filed Critical 广州视源电子科技股份有限公司
Publication of WO2017067321A1 publication Critical patent/WO2017067321A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • 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
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30141Printed circuit board [PCB]

Definitions

  • the invention relates to the field of image recognition and industrial vision detection, in particular to a PCB board matching method and device based on an outer contour.
  • PCBs are the most basic components of electronic devices. They are the support of electronic components. Their quality plays an important role in the performance of electronic products. It is important.
  • Image registration algorithms can be roughly divided into two categories: region-based methods and feature-based methods.
  • the region-based approach is also known as class correlation or template matching.
  • the method generally does not require complex preprocessing of the image, and only uses some statistical information of the two images as the similarity criterion, and adopts an appropriate search algorithm to obtain an image conversion form that maximizes the similarity criterion to achieve the image.
  • the purpose of the registration is that the implementation is relatively simple, but the application range is narrow, which can not be directly used to correct the nonlinear deformation of the image, and the calculation amount is large in the search process of the optimal transformation.
  • the feature-based image registration algorithm uses the significant feature structure in the image as the flag, extracts them in the reference image and the image to be matched, and then finds the matching relationship between the two image markers. Complete the space alignment.
  • the feature-based registration method greatly reduces the amount of data of the image information by extracting the salient features of the image, and at the same time maintains the characteristics of displacement, rotation and proportion of the image. The calculation amount is small and the speed is fast.
  • the application is also more extensive. There are many salient features of the image, such as point features (including corner points, high curvature points, etc.), straight lines, edges, outlines, Close area features, etc.
  • point features are commonly used features
  • corner points are the most commonly used feature points.
  • the existing corner detection methods generally rely on the calculation of the gradient of the image, and thus are susceptible to noise and illumination changes, and the calculation of the gradient is actually approximated by using the difference, and the detected angular position tends to deviate from the true angle.
  • the position of the point is not high enough to meet the requirements of PCB inspection, which requires high precision.
  • edges or contours are also common features.
  • precise positioning of edges or contour points is not an easy task.
  • the target edge detected by the general edge detection operator is often not closed, there are many breakpoints, and subsequent edge connection processing is often required.
  • the target contour obtained by the contour tracking algorithm tends to have many jagged portions.
  • the appearance of edge segments and sawtooth contours affects the accuracy of image registration.
  • Embodiments of the present invention provide a PCB card matching method based on an outer contour, including the steps of:
  • a is a variable, a ranges from 0 to 180°;
  • d ⁇ represents the angle at which the angle of inclination of all lines in ⁇ Di ⁇ is the smallest;
  • i 1, 2, 3...M, M Is the total number of all lines in the line information;
  • FIG. 9 is a structural block diagram of a PCB board matching device based on an outer contour according to an embodiment of the present invention.
  • step S2 the angle and the intercept between each edge of the PCB card and the X-axis or the Y-axis of the plane coordinate system of the target image are calculated mainly based on the obtained line set ⁇ Li ⁇ . .
  • the plane coordinate system of the target image is consistent with the coordinate system of the plane coordinate system of the camera that generates the target image.
  • the target image is a rectangle, and an edge of the target image is parallel or perpendicular to an X-axis and a Y-axis of the plane coordinate system.
  • the horizontal edge of the target image is parallel to the X-axis of the plane coordinate system
  • the vertical edge of the target image and the plane coordinate system are The Y axis is parallel.
  • the direction of all the lines in the line set ⁇ Li ⁇ is mostly parallel to the edge of the PCB board, as shown in Figure 3, so as long as the line is statistical
  • the edge direction of the PCB card that is, the angle between the edge of the PCB card and the X-axis or Y-axis of the plane coordinate system of the target image, also called the tilt angle or PCB Conversion angle.
  • Step S211 calculating the direction of all the straight lines in the line information, to obtain a set of inclination angles ⁇ Di ⁇ of the straight line, wherein the inclination angle range of each line in ⁇ Di ⁇ is 0-180°;
  • Step S212 calculating an angle d ⁇ between an edge of the PCB card and an X-axis or a Y-axis of the plane coordinate system of the target image by using the following formulas (1) and (2):
  • a is a variable, a ranges from 0 to 180°;
  • d ⁇ represents the angle at which the angle of inclination of all lines in ⁇ Di ⁇ is the smallest;
  • i 1, 2, 3...M, M Is the total number of all lines in the line information;
  • Step S223 the angle between the remaining three edges of the PCB card and the X-axis or the Y-axis of the plane coordinate system of the target image are: d ⁇ , d ⁇ +90° , d ⁇ +90° .
  • the embodiment may calculate an intercept between each edge of the PCB card in the PCB edge information and an X-axis or a Y-axis of a plane coordinate system of the target image by using the following steps:
  • Step S231 traversing all the straight lines in the straight line information, and calculating a straight line set ⁇ Mi ⁇ in the same direction as any edge of the PCB card by formula (3):
  • ⁇ Li ⁇ is a set of all the straight lines in the straight line information
  • Ki is a tilt angle of the straight line Li
  • is a minimum angle between a straight line in ⁇ Li ⁇ and any edge direction of the PCB card
  • Step S232 assuming that the intercept of the line set ⁇ Mi ⁇ and the X-axis/Y-axis is ⁇ Bi ⁇ , and:
  • B max is the maximum value in ⁇ Bi ⁇
  • B min is the minimum value in ⁇ Bi ⁇
  • ⁇ B is the size of each intercept interval
  • B min is the minimum value in ⁇ Bi ⁇ , that is, the minimum intercept value of all the straight lines in the line set ⁇ Mi ⁇ and the X/Y axis (shown as the Y axis in FIG. 5).
  • B max is the maximum value in ⁇ Bi ⁇ , that is, the maximum intercept value of all the straight lines in the line set ⁇ Mi ⁇ and the X/Y axis (shown as the Y axis in Fig. 5), and ⁇ B is the size of each intercept interval.
  • A1 and A2 are ranges indicating the first and second intercept intervals.
  • step S3 the following steps are specifically used to calculate the PCB card in the target image to The coordinates of two vertices:
  • four straight lines can be obtained, respectively: L1 (d ⁇ , B l ), L2(d ⁇ , B r ), L3(d ⁇ +90°, B u ) and L4(d ⁇ +90°, B b ), the four straight lines intersect to obtain four vertices p 0 , p 1 , p 2 , p 3 ;
  • the coordinates of at least two of the four vertices are obtained by the following calculation method:
  • step S4 an affine transformation matrix of the standard image to the target image is obtained by the following steps:
  • the affine transformation matrix is:
  • the corresponding four vertices of the PCB card in the target image are (p 11 , p 12 , p 13 , p 14 ) are the four vertices obtained by the above steps (p 0 , p 1 ) , p 2 , p 3 ).
  • the four vertices of the PCB card in the standard image are (p 01 , p 02 , p 03 , p 04 ) and can also be calculated by steps S1 to S3 of the embodiment.
  • the embodiment correspondingly discloses a PCB board matching device based on an outer contour, including:
  • the edge information detecting module 91 is configured to detect all edge information in the target image
  • a line information obtaining module 92 configured to acquire line information in the edge information
  • the vertex calculation module 94 calculates coordinates of at least two vertices of the PCB card in the target image based on the PCB edge information;
  • An affine transformation matrix calculation module 95 based on coordinates of any two vertices of at least two vertices of the PCB card in the target image and corresponding vertices of the PCB card in a preset standard image Coordinates, calculating an affine transformation matrix of the standard image to the target image;
  • the matching module 96 obtains a registration image based on the affine transformation matrix and the standard image, and matches the registration image with the target image.
  • the PCB edge information acquiring module 93 calculates, by using the following steps, a clip between each edge of the PCB card in the PCB edge information and the X-axis or the Y-axis of the plane coordinate system of the target image. angle:
  • the angle d ⁇ between the edge of any of the PCB boards and the X-axis or the Y-axis of the plane coordinate system of the target image is calculated by the following formulas (1) and (2):
  • a is a variable, a ranges from 0 to 180°;
  • d ⁇ represents the angle at which the angle of inclination of all lines in ⁇ Di ⁇ is the smallest;
  • i 1, 2, 3...M, M Is the total number of all lines in the line information;
  • the angle between the remaining three edges of the PCB card and the X-axis or the Y-axis of the plane coordinate system of the target image are: d ⁇ , d ⁇ +90° , d ⁇ +90° .
  • the PCB edge information acquiring module 93 calculates an intercept between the X-axis or the Y-axis of each edge of the PCB card in the PCB edge information and the plane coordinate system of the target image by the following steps: :
  • ⁇ Li ⁇ is a set of all the straight lines in the straight line information
  • Ki is a tilt angle of the straight line Li
  • is a minimum angle between a straight line in ⁇ Li ⁇ and any edge direction of the PCB card
  • B max is the maximum value in ⁇ Bi ⁇
  • B min is the minimum value in ⁇ Bi ⁇
  • ⁇ B is the size of each intercept interval
  • the vertex calculation module 94 calculates coordinates of at least two vertices of the PCB card in the target image by the following steps:
  • four straight lines can be obtained, respectively: L1 (d ⁇ , B l ), L2(d ⁇ , B r ), L3(d ⁇ +90°, B u ) and L4(d ⁇ +90°, B b ), the four straight lines intersect to obtain four vertices p 0 , p 1 , p 2 , p 3 ;
  • the coordinates of at least two of the four vertices are obtained by the following calculation method:
  • the PCB board matching method and device based on the outer contour disclosed in the embodiment of the present invention fully utilizes the information of the PCB board itself (the PCB board is filled with the line information parallel to the edge of the PCB board)
  • the edge information of the PCB card By obtaining the linear information to determine the edge information of the PCB card, the coordinates of at least two vertices of the PCB card are obtained, and the coordinates of at least two vertices of the PCB card in the standard image and the target image are respectively obtained by the calculation method.
  • calculating any two of the at least two vertices as local feature points to calculate an affine transformation matrix of the standard image to the target image, thereby obtaining a registration image to match the target image. Since the calculation of feature points does not require traversing each pixel, the calculation speed is greatly accelerated, thereby improving the matching efficiency.

Landscapes

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

Abstract

一种基于外轮廓的PCB板卡匹配方法,包括如下步骤:检测目标图像中所有的边缘信息,并获取所述边缘信息中的直线信息(S1);基于所述直线信息计算获得PCB边缘信息(S2);基于所述PCB边缘信息计算得到所述目标图像中所述PCB板卡的至少两个顶点的坐标(S3);基于所述目标图像中所述PCB板卡的至少两个顶点中的任意两个顶点的坐标以及预设的标准图像中所述PCB板卡的对应两个顶点的坐标,计算得到所述标准图像到所述目标图像的仿射变换矩阵(S4);基于所述仿射变换矩阵与所述标准图像得到配准图像,并将所述配准图像与所述目标图像进行匹配(S5)。

Description

一种基于外轮廓的PCB板卡匹配方法及装置 技术领域
本发明涉及图像识别与工业视觉检测领域,尤其涉及一种基于外轮廓的PCB板卡匹配方法及装置。
背景技术
印制电路板(PCB:Printed Circuit Boards)是电子设备中最基本的组成环节,是电子元器件的支撑体,其质量对于电子产品的性能起着举足轻重的作用,其质量的检测对PCB生产至关重要。
传统基于人工目测PCB瑕疵检测方法无法满足PCB发展的需要。自动光学检测(AOI:Automated optical inspection)技术目前是国内外主流的PCB瑕疵检测。在所有AOI技术中,需要定位准确PCB图片位置,这个过程又称为图像配准。
图像配准算法大致可分为两类:基于区域的方法和基于特征的方法。
基于区域的方法也称为类相关法或模板匹配法。该方法一般不需要对图像进行复杂的预处理,只利用两幅图像的某种统计信息作为相似性判别标准,采用适当的搜索算法得到令相似性判别标准最大化的图像转换形式,以达到图像配准的目的。主要特点是实现比较简单,但应用范围较窄,不能直接用于校正图像的非线性形变,而且在最优变换的搜索过程中运算量较大。
基于特征的图像配准算法借助图像中具有的显著特征结构,将其作为标志位,分别在参考图像和待匹配图像中提取出它们,然后再找到两幅图像标志位之间的匹配关系,继而完成空间对位。基于特征的配准方法由于提取了图像的显著特征,大大压缩了图像信息的数据量,同时较好地保持了图像的位移、旋转、比例方面的特征,配准时计算量小,速度较快,应用也更为广泛。图像的显著特征有很多,如点特征(包括角点、高曲率点等)、直线段、边缘、轮廓、 闭合区域特征等。
在基于特征的图像配准算法中,点特征是常用的特征,而其中,角点是最常用的特征点。然而,现有的角点检测方法一般依赖于图像的梯度的计算,因而易受噪声及光照变化的影响,而且梯度的计算实际是使用差分来近似,检测出的角点位置往往偏离真实的角点位置,精度不高,无法满足PCB检测这种对精度要求较高的场合。
在基于特征的图像配准算法中,边缘或轮廓也是常用特征。然而,在离散化的数字图像中,边缘或轮廓点的精确定位并非易事。通过一般的边缘检测算子检测出的目标边缘往往并不闭合,存在许多的断点,经常需要后续边缘连接处理。通过轮廓跟踪算法得到的目标轮廓往往有很多的锯齿状部分。边缘片段和锯齿轮廓的出现影响图像配准的精度。
另外,在现有技术基于特征的图像配准算法中需要遍历每个像素,导致计算速度慢,降低匹配效率。
发明内容
本发明实施例的目的是提供一种基于外轮廓的PCB板卡匹配方法及装置,精度高,且计算速度快,能够有效提高匹配效率。
本发明实施例提供了一种基于外轮廓的PCB板卡匹配方法,包括步骤:
检测目标图像中所有的边缘信息,并获取所述边缘信息中的直线信息;
基于所述直线信息计算获得PCB边缘信息;
基于所述PCB边缘信息计算得到所述目标图像中所述PCB板卡的至少两个顶点的坐标;
基于所述目标图像中所述PCB板卡的至少两个顶点中的任意两个顶点的坐标以及预设的标准图像中所述PCB板卡的对应两个顶点的坐标,计算得到所述标准图像到所述目标图像的仿射变换矩阵;
基于所述仿射变换矩阵与所述标准图像得到配准图像,并将所述配准图像与所述目标图像进行匹配。
作为上述方案的改进,所述PCB边缘信息包括所述PCB板卡的每个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角和截距。
作为上述方案的改进,采用Canny算子检测所述目标图像中所有的边缘信息,采用Hough变换进行直线检测以获取所述边缘信息中的直线信息。
在本发明一个实施例中,通过以下步骤计算得到所述PCB边缘信息中所述PCB板卡的每个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角:
计算所述直线信息中所有直线的方向,得到直线的倾斜角度集合{Di},其中,{Di}中的每一个直线的倾斜角度范围是0~180°;
利用下列公式计算得到所述PCB板卡的任一边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角dα
Figure PCTCN2016096751-appb-000001
Figure PCTCN2016096751-appb-000002
其中,a为变量,a的取值范围是0~180°;dα表示与{Di}中的所有直线的倾斜角度夹角最小的角度;i=1,2,3...M,M为所述直线信息中所有直线的总数量;
所述PCB板卡的其余三个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角分别为:dα,dα+90°,dα+90°。
在本发明另一个实施例中,通过以下步骤计算得到所述PCB边缘信息中所述PCB板卡的每个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角:
计算所述直线信息中所有直线的方向,得到直线的倾斜角度集合{Di},其中,{Di}中的每一个直线的倾斜角度范围是0~180°;
利用下列公式计算得到所述PCB板卡的任一边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角dα
Figure PCTCN2016096751-appb-000003
Figure PCTCN2016096751-appb-000004
其中,a为变量,a的取值范围是0~180°;dα表示与{Di}中的所有直线的倾斜角度夹角最小的角度;i=1,2,3...M,M为所述直线信息中所有直线的总数量;
所述PCB板卡的其余三个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角分别为:dα,dα+90°,dα+90°。
作为上述方案的改进,通过以下步骤计算得到所述PCB边缘信息中所述PCB板卡的每个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的截距:
遍历所述直线信息中的所有直线,通过以下公式计算得到与所述PCB板卡的任一边缘同向的直线集合{Mi}:
{Mi|Mi∈{Li},|Ki-dα|<ε}
其中,{Li}为所述直线信息中的所有直线集合;Ki为直线Li的倾斜角;ε为{Li}中的直线与所述PCB板卡的任一边缘方向的最小夹角;
假设直线集合{Mi}与X轴/Y轴的截距为{Bi},设:
Bmax=max{Bi},Bmin=min{Bi}
将区间[Bmin,Bmax]等分成N个子区间,则ΔB={Bmax-Bmin}/N,则第i个区间Ai的范围是:
Ai=[Bmin+ΔB*(i-1),Bmin+(ΔB*i)]
其中,Bmax为{Bi}中的最大值,Bmin为{Bi}中的最小值;ΔB为每个截距区间的大小;
对{Bi}中所有的截距进行区间统计,得到{Ci},0<=i<=N,{Ci}表示截距落在第i个区间的个数;
从i=0递增在{Ci}中找到第一个峰值所对应的截距Bl,从i=N递减在{Ci}中找到第一个峰值所对应的截距Br,则Bl、Br代表所述PCB板卡的两个同向边缘与X轴/Y轴的截距;
设置da′=da+90°,将da=da′-90°代入上述公式中,并重复上述步骤, 从而得到所述PCB板卡的另外两个同向边缘与X轴/Y轴的截距Bu、Bb
作为上述方案的改进,通过以下步骤计算所述目标图像中所述PCB板卡的至少两个顶点的坐标:
基于得到的PCB板卡的每个边缘所述目标图像的平面坐标系的X轴或Y轴之间的夹角和截距,得到四条直线,分别为:L1(dα,Bl),L2(dα,Br),L3(dα+90°,Bu)和L4(dα+90°,Bb),四条直线相交得到四个顶点p0,p1,p2,p3
通过以下计算方法得到所述四个顶点中的至少两个顶点的坐标:
L1:y=tan(dα)x+Bl,L3:y=tan(dα+90)x+Bu,解一个二元一次方程组,得到交点p0坐标:
((Bl-Bu)/(tan(dα+90)-tan(dα)),(tan(dα)*Bu-tan(dα+90)*Bl)/(tan(dα+90)-tan(dα)))
依次类推得到后面的交点:
p1:((Bl-Bb)/(tan(dα+90)-tan(dα)),(tan(dα)*Bb-tan(dα+90)*B1)/(tan(dα+90)-tan(dα)))
p2:((Bα-Bu)/(tan(dα+90)-tan(dα)),(tan(dα)*Bu-tan(dα+90)*Bα)/(tan(dα+90)-tan(dα)))
p3:((Bα-Bb)/(tan(dα+90)-tan(dα)),(tan(dα)*Bb-tan(dα+90)*Bα)/(tan(dα+90)-tan(dα)))。
作为上述方案的改进,通过以下步骤得到所述标准图像到所述目标图像的仿射变换矩阵:
假设所述标准图像中所述PCB板卡的四个顶点是(p01,p02,p03,p04),所述目标图像中所述PCB板卡的对应的四个顶点是(p11,p12,p13,p14),假设所述标准图像到所述目标图像的绽放系数k,旋转角度是α,及平移量是dx,dy。则仿射变换矩阵是:
Figure PCTCN2016096751-appb-000005
那么,所述标准图像中的顶点到所述目标图像的对应顶点变换过程是:
Figure PCTCN2016096751-appb-000006
将所述目标图像中任意两个顶点的坐标以及预设的标准图像中对应两个顶点的坐标代入上述公式解出k,α,dx,dy。
作为上述方案的改进,将所述仿射变换矩阵与所述标准图像相乘,得到所述配准图像。
本发明实施例对应提供了一种基于外轮廓的PCB板卡快速匹配装置,包括:
边缘信息检测模块,用于检测目标图像中所有的边缘信息;
直线信息获取模块,用于获取所述边缘信息中的直线信息;
PCB边缘信息获取模块,基于所述直线信息计算获得PCB边缘信息;
顶点计算模块,基于所述PCB边缘信息计算得到所述目标图像中所述PCB板卡的至少两个顶点的坐标;
仿射变换矩阵计算模块,基于所述目标图像中所述PCB板卡的至少两个顶点中的任意两个顶点的坐标以及预设的标准图像中所述PCB板卡的对应两个顶点的坐标,计算得到所述标准图像到所述目标图像的仿射变换矩阵;
匹配模块,基于所述仿射变换矩阵与所述标准图像得到配准图像,并将所述配准图像与所述目标图像进行匹配。
与现有技术相比,本发明实施例公开的一种基于外轮廓的PCB板卡匹配方法及装置通过充分利用PCB板卡本身的信息(PCB板卡上充满了与PCB板卡边缘平行的直线信息),通过获取这些直线信息来确定PCB板卡边缘信息,从而得到PCB板卡的至少两个顶点的坐标,并通过此计算方法分别得到标准图像和目标图像中PCB板卡的至少两个顶点的坐标,将所述至少两个顶点中的任意两个顶点标定作为局部特征点来计算得到标准图像到所述目标图像的仿射变换矩阵,从而得到配准图像以对目标图像进行匹配。由于特征点的计算不需要遍历每个像素,因此计算速度大大加快,从而提高匹配效率。
附图说明
图1是本发明实施例中一种基于外轮廓的PCB板卡匹配方法的流程示意图。
图2~图5显示利用本发明实施例中一种基于外轮廓的PCB板卡匹配方法对 图像进行处理的过程示意图。
图6是图1中的步骤S2的一个实施例的具体流程图。
图7是图1中的步骤S2的另一个实施例的具体流程图。
图8是图1中的步骤S2的再一个实施例的具体流程图。
图9是本发明实施例中一种基于外轮廓的PCB板卡匹配装置的结构框图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
参见图1,是本发明实施例提供的一种基于外轮廓的PCB板卡匹配方法的结构示意图。该方法包括步骤:
S1、检测目标图像中所有的边缘信息,并获取所述边缘信息中的直线信息;
S2、基于所述直线信息计算获得PCB边缘信息;
其中,所述PCB边缘信息包括所述PCB板卡的每个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角和截距;
S3、基于所述PCB边缘信息计算得到所述目标图像中所述PCB板卡的至少两个顶点的坐标;
S4、基于所述目标图像中所述PCB板卡的至少两个顶点中的任意两个顶点的坐标以及预设的标准图像中所述PCB板卡的对应两个顶点的坐标,计算得到所述标准图像到所述目标图像的仿射变换矩阵;
S5、基于所述仿射变换矩阵与所述标准图像得到配准图像,并将所述配准图像与所述目标图像进行匹配。
具体的,在实施步骤S1时,如图2所示,所述目标图像100带有PCB板卡200的图像信息,具体的,所述目标图像100是利用摄像头对PCB板卡拍摄得到。在得到所述目标图像100后,可以采用Canny算子检测所述目标图像100 中所有的边缘信息,然后采用Hough变换进行直线检测以获取所述边缘信息中的直线信息,得到直线集合{Li}。另外,在实施步骤S1前,还可以先对所述目标图像进行高斯滤波处理,进行高斯滤波的主要目的是为了平滑目标图像,使目标图像的噪声更低,更有利于检测边缘信息。
在步骤S2中,主要是基于获得的直线集合{Li}来计算得到所述PCB板卡的每个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角和截距。可以理解的,所述目标图像的平面坐标系与生成所述目标图像的摄像机的平面坐标系的坐标系是一致的。而且,所述目标图像为矩形,所述目标图像的边缘与所述平面坐标系的X轴、Y轴平行或垂直。在本实施例中,通过构建目标图像的平面坐标系后,将所述目标图像的水平边缘与所述平面坐标系的X轴平行,而将所述目标图像的垂直边缘与所述平面坐标系的Y轴平行。
下面,分别对如何得到所述PCB板卡的每个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角和截距。
在直线集合{Li}中,根据PCB板卡本身的特性,直线集合{Li}中所有直线的方向大部分情况下是与PCB板卡的边缘平行的,如图3所示,因此只要统计直线集合中最多的方向,则可以得到PCB板卡的边缘方向(即PCB板卡的边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角,也叫倾斜角或者是PCB的转换角度)。
参考图6,在一个优选的实施例中,通过以下步骤计算得到所述PCB边缘信息中所述PCB板卡的每个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角:
步骤S211、计算所述直线信息中所有直线的方向,得到直线的倾斜角度集合{Di},其中,{Di}中的每一个直线的倾斜角度范围是0~180°;
步骤S212、利用下列公式(1)、(2)计算得到所述PCB板卡的任一边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角dα
Figure PCTCN2016096751-appb-000007
Figure PCTCN2016096751-appb-000008
其中,a为变量,a的取值范围是0~180°;dα表示与{Di}中的所有直线的倾斜角度夹角最小的角度;i=1,2,3...M,M为所述直线信息中所有直线的总数量;
步骤S213、所述PCB板卡的其余三个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角分别为:dα,dα+90°,dα+90°
参考图7,在另一个优选的实施例中,通过以下步骤计算得到所述PCB边缘信息中所述PCB板卡的每个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角:
步骤S221、计算所述直线信息中所有直线的方向,得到直线的倾斜角度集合{Di},其中,{Di}中的每一个直线的倾斜角度范围是0~180°;
步骤S222、利用下列公式(1)、(2)计算得到所述PCB板卡的任一边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角dα
Figure PCTCN2016096751-appb-000009
Figure PCTCN2016096751-appb-000010
其中,a为变量,a的取值范围是0~180°;dα表示与{Di}中的所有直线的倾斜角度夹角最小的角度;i=1,2,3...M,M为所述直线信息中所有直线的总数量;
步骤S223、所述PCB板卡的其余三个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角分别为:dα,dα+90°,dα+90°
通过图6或图7的步骤可得到所述PCB板卡的任一边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角dα,如图4所示,其中,图4中显示的是PCB板卡的水平边缘与所述目标图像的平面坐标系的X轴之间的夹角dα
参考图8,本实施例可以通过以下步骤计算得到所述PCB边缘信息中所述PCB板卡的每个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的截距:
步骤S231、遍历所述直线信息中的所有直线,通过公式(3)计算得到与所述PCB板卡的任一边缘同向的直线集合{Mi}:
{Mi|Mi∈{Li},|Ki-dα|<ε}        (3)
其中,{Li}为所述直线信息中的所有直线集合;Ki为直线Li的倾斜角;ε为{Li}中的直线与所述PCB板卡的任一边缘方向的最小夹角;
步骤S232、假设直线集合{Mi}与X轴/Y轴的截距为{Bi},设:
Bmax=max{Bi},Bmin=min{Bi}           (4)
将区间[Bmin,Bmax]等分成N个子区间,则ΔB={Bmax-Bmin}/N,则第i个区间Ai的范围是:
Ai=[Bmin+ΔB*(i-1),Bmin+(ΔB*i)]          (5)
在公式(4)、(5)中,Bmax为{Bi}中的最大值,Bmin为{Bi}中的最小值;ΔB为每个截距区间的大小;
步骤S233、对{Bi}中所有的截距进行区间统计,得到{Ci},1<=i<=N-1,{Ci}表示截距落在第i个区间的个数;
具体的,如图5所示,Bmin为{Bi}中的最小值,也就是直线集合{Mi}中的所有直线与X/Y轴(图5显示为Y轴)的最小截距值,Bmax为{Bi}中的最大值,也就是直线集合{Mi}中的所有直线与X/Y轴(图5显示为Y轴)的最大截距值,ΔB为每个截距区间的大小,图中A1、A2就是表示第1、2个截距区间的范围。
步骤S234、从i=0递增在{Ci}中找到第一个峰值所对应的截距Bl,从i=N递减在{Ci}中找到第一个峰值所对应的截距Br,则Bl、Br代表所述PCB板卡的两个同向边缘(图5显示为PCB板卡的两个水平边缘)与X轴/Y轴(图5显示为Y轴)的截距;
步骤S235、设置da′=da+90°,将da′代入上述公式(3)中,并重复上述步骤,从而得到所述PCB板卡的另外两个同向边缘与X轴/Y轴的截距Bu、Bb
在步骤S3中,具体通过以下步骤计算所述目标图像中所述PCB板卡的至 少两个顶点的坐标:
基于得到的PCB板卡的每个边缘所述目标图像的平面坐标系的X轴或Y轴之间的夹角和截距,可以得到四条直线,分别为:L1(dα,Bl),L2(dα,Br),L3(dα+90°,Bu)和L4(dα+90°,Bb),四条直线相交得到四个顶点p0,p1,p2,p3
通过以下计算方法得到所述四个顶点中的至少两个顶点的坐标:
L1:y=tan(dα)x+Bl,L3:y=tan(dα+90)x+Bu,解一个二元一次方程组,得到交点p0坐标:
((Bl-Bu)/(tan(dα+90)-tan(dα)),(tan(dα)*Bu-tan(dα+90)*Bl)/(tan(dα+90)-tan(dα)))
依次类推得到后面的交点:
p1:((Bl-Bb)/(tan(dα+90)-tan(dα)),(tan(dα)*Bb-tan(dα+90)*Bl)/(tan(dα+90)-tan(dα)))
p2:((Bα-Bu)/(tan(dα+90)-tan(dα)),(tan(dα)*Bu-tan(dα+90)*Bα)/(tan(dα+90)-tan(dα)))
p3:((Bα-Bb)/(tan(dα+90)-tan(dα)),(tan(dα)*Bb-tan(dα+90)*Bα)/(tan(dα+90)-tan(dα)))。
在步骤S4中,通过以下步骤得到所述标准图像到所述目标图像的仿射变换矩阵:
假设所述标准图像中所述PCB板卡的是(p01,p02,p03,p04),所述目标图像中所述PCB板卡的对应的四个顶点是(p11,p12,p13,p14),假设所述标准图像到所述目标图像的绽放系数k,旋转角度是α,及平移量是dx,dy。则仿射变换矩阵是:
Figure PCTCN2016096751-appb-000011
那么,所述标准图像中的顶点到所述目标图像的对应顶点变换过程是:
Figure PCTCN2016096751-appb-000012
将所述目标图像中任意两个顶点的坐标以及预设的标准图像中对应两个顶点的坐标代入公式(7)解出k,α,dx,dy。
需要说明的是,所述目标图像中所述PCB板卡的对应的四个顶点是(p11,p12,p13,p14)为通过上述步骤得到的四个顶点(p0,p1,p2,p3)。同样的,为了提高精确度,所述标准图像中所述PCB板卡的四个顶点是(p01,p02,p03,p04)也可以通过本实施例的步骤S1~S3计算得到。
在所述步骤S5中,当通过公式(6)~(7)计算得到所述仿射变换矩阵后,通过将所述仿射变换矩阵与所述标准图像相乘,即可得到所述配准图像。在得到配准图像后,即可将所述配准图像与所述目标图像进行一一对应进行匹配,从而检测出所述目标图像中是否包含瑕疵点。
参考图9,本实施例对应公开了一种基于外轮廓的PCB板卡匹配装置,包括:
边缘信息检测模块91,用于检测目标图像中所有的边缘信息;
直线信息获取模块92,用于获取所述边缘信息中的直线信息;
PCB边缘信息获取模块93,基于所述直线信息计算获得PCB边缘信息,所述PCB边缘信息包括所述PCB板卡的每个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角和截距;
顶点计算模块94,基于所述PCB边缘信息计算得到所述目标图像中所述PCB板卡的至少两个顶点的坐标;
仿射变换矩阵计算模块95,基于所述目标图像中所述PCB板卡的至少两个顶点中的任意两个顶点的坐标以及预设的标准图像中所述PCB板卡的对应两个顶点的坐标,计算得到所述标准图像到所述目标图像的仿射变换矩阵;
匹配模块96,基于所述仿射变换矩阵与所述标准图像得到配准图像,并将所述配准图像与所述目标图像进行匹配。
具体的,所述PCB边缘信息获取模块93通过以下步骤计算得到所述PCB边缘信息中所述PCB板卡的每个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角:
计算所述直线信息中所有直线的方向,得到直线的倾斜角度集合{Di},其 中,{Di}中的每一个直线的倾斜角度范围是0~180°;
利用下列公式(1)、(2)计算得到所述PCB板卡的任一边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角dα
Figure PCTCN2016096751-appb-000013
Figure PCTCN2016096751-appb-000014
其中,a为变量,a的取值范围是0~180°;dα表示与{Di}中的所有直线的倾斜角度夹角最小的角度;i=1,2,3...M,M为所述直线信息中所有直线的总数量;
所述PCB板卡的其余三个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角分别为:dα,dα+90°,dα+90°
另外,所述PCB边缘信息获取模块93通过以下步骤计算得到所述PCB边缘信息中所述PCB板卡的每个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的截距:
遍历所述直线信息中的所有直线,通过公式(3)计算得到与所述PCB板卡的任一边缘同向的直线集合{Mi}:
{Mi|Mi∈{Li},|Ki-dα|<ε}           (3)
其中,{Li}为所述直线信息中的所有直线集合;Ki为直线Li的倾斜角;ε为{Li}中的直线与所述PCB板卡的任一边缘方向的最小夹角;
假设直线集合{Mi}与X轴/Y轴的截距为{Bi},设:
Bmax=max{Bi},Bmin=min{Bi}         (4)
将区间[Bmin,Bmax]等分成N个子区间,则ΔB={Bmax-Bmin}/N,则第i个区间Ai的范围是:
Ai=[Bmin+ΔB*(i-1),Bmin+(ΔB*i)]         (5)
在公式(4)、(5)中,Bmax为{Bi}中的最大值,Bmin为{Bi}中的最小值;ΔB为每个截距区间的大小;
对{Bi}中所有的截距进行区间统计,得到{Ci},0<=i<=N,{Ci}表示截距落在第i个区间的个数;
从i=0递增在{Ci}中找到第一个峰值所对应的截距Bl,从i=N递减在{Ci}中找到第一个峰值所对应的截距Br,则Bl、Br代表所述PCB板卡的两个同向边缘与X轴/Y轴的截距;
设置da′=da+90°,将da′代入上述公式(3)中,并重复上述步骤,从而得到所述PCB板卡的另外两个同向边缘与X轴/Y轴的截距Bu、Bb
具体的,所述顶点计算模块94通过以下步骤计算所述目标图像中所述PCB板卡的至少两个顶点的坐标:
基于得到的PCB板卡的每个边缘所述目标图像的平面坐标系的X轴或Y轴之间的夹角和截距,可以得到四条直线,分别为:L1(dα,Bl),L2(dα,Br),L3(dα+90°,Bu)和L4(dα+90°,Bb),四条直线相交得到四个顶点p0,p1,p2,p3
通过以下计算方法得到所述四个顶点中的至少两个顶点的坐标:
L1:y=tan(dα)x+Bl,L3:y=tan(dα+90)x+Bu,解一个二元一次方程组,得到交点p0坐标:
((Bl-Bu)/(tan(dα+90)-tan(dα)),(tan(dα)*Bu-tan(dα+90)*Bl)/(tan(dα+90)-tan(dα)))
依次类推得到后面的交点:
p1:((Bl-Bb)/(tan(dα+90)-tan(dα)),(tan(dα)*Bb-tan(dα+90)*Bl)/(tan(dα+90)-tan(dα)))
p2:((Bα-Bu)/(tan(dα+90)-tan(dα)),(tan(dα)*Bu-tan(dα+90)*Bα)/(tan(dα+90)-tan(dα)))
p3:((Bα-Bb)/(tan(dα+90)-tan(dα)),(tan(dα)*Bb-tan(dα+90)*Bα)/(tan(dα+90)-tan(dα)))。
具体的,所述仿射变换矩阵计算模块95通过以下步骤得到所述标准图像到所述目标图像的仿射变换矩阵:
假设所述标准图像中所述PCB板卡的四个顶点是(p01,p02,p03,p04),所述目标图像中所述PCB板卡的对应的四个顶点是(p11,p12,p13,p14),假设所述标准图像到所述目标图像的绽放系数k,旋转角度是α,及平移量是dx,dy。则仿射变换矩阵是:
Figure PCTCN2016096751-appb-000015
那么,所述标准图像中的顶点到所述目标图像的对应顶点变换过程是:
Figure PCTCN2016096751-appb-000016
将所述目标图像中任意两个顶点的坐标以及预设的标准图像中对应两个顶点的坐标代入公式(7)解出k,α,dx,dy。
在所述仿射变换矩阵计算模块95通过公式(6)~(7)计算出所述仿射变换矩阵后,所述匹配模块96将所述仿射变换矩阵与所述标准图像得到配准图像,即可得到所述配准图像。在得到配准图像后,通过将所述配准图像与所述目标图像进行一一对应进行匹配,从而检测出所述目标图像中是否包含瑕疵点。
综上所述,本发明实施例公开的一种基于外轮廓的PCB板卡匹配方法及装置通过充分利用PCB板卡本身的信息(PCB板卡上充满了与PCB板卡边缘平行的直线信息),通过获取这些直线信息来确定PCB板卡边缘信息,从而得到PCB板卡的至少两个顶点的坐标,并通过此计算方法分别得到标准图像和目标图像中PCB板卡的至少两个顶点的坐标,将所述至少两个顶点中的任意两个顶点标定作为局部特征点来计算得到标准图像到所述目标图像的仿射变换矩阵,从而得到配准图像以对目标图像进行匹配。由于特征点的计算不需要遍历每个像素,因此计算速度大大加快,从而提高匹配效率。
以上所述是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也视为本发明的保护范围。

Claims (10)

  1. 一种基于外轮廓的PCB板卡匹配方法,其特征在于,包括步骤:
    检测目标图像中所有的边缘信息,并获取所述边缘信息中的直线信息;
    基于所述直线信息计算获得PCB边缘信息;
    基于所述PCB边缘信息计算得到所述目标图像中所述PCB板卡的至少两个顶点的坐标;
    基于所述目标图像中所述PCB板卡的至少两个顶点中的任意两个顶点的坐标以及预设的标准图像中所述PCB板卡的对应两个顶点的坐标,计算得到所述标准图像到所述目标图像的仿射变换矩阵;
    基于所述仿射变换矩阵与所述标准图像得到配准图像,并将所述配准图像与所述目标图像进行匹配。
  2. 根据权利要求1所述的一种基于外轮廓的PCB板卡匹配方法,其特征在于:所述PCB边缘信息包括所述PCB板卡的每个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角和截距。
  3. 根据权利要求1所述的一种基于外轮廓的PCB板卡匹配方法,其特征在于:采用Canny算子检测所述目标图像中所有的边缘信息,采用Hough变换进行直线检测以获取所述边缘信息中的直线信息。
  4. 根据权利要求2所述的一种基于外轮廓的PCB板卡匹配方法,其特征在于:通过以下步骤计算得到所述PCB边缘信息中所述PCB板卡的每个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角:
    计算所述直线信息中所有直线的方向,得到直线的倾斜角度集合{Di},其中,{Di}中的每一个直线的倾斜角度范围是0~180°;
    利用下列公式计算得到所述PCB板卡的任一边缘与所述目标图像的平面坐 标系的X轴或Y轴之间的夹角dα
    Figure PCTCN2016096751-appb-100001
    Figure PCTCN2016096751-appb-100002
    其中,a为变量,a的取值范围是0~180°;dα表示与{Di}中的所有直线的倾斜角度夹角最小的角度;i=1,2,3...M,M为所述直线信息中所有直线的总数量;
    所述PCB板卡的其余三个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角分别为:dα,dα+90°,dα+90°
  5. 根据权利要求2所述的一种基于外轮廓的PCB板卡匹配方法,其特征在于:通过以下步骤计算得到所述PCB边缘信息中所述PCB板卡的每个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角:
    计算所述直线信息中所有直线的方向,得到直线的倾斜角度集合{Di},其中,{Di}中的每一个直线的倾斜角度范围是0~180°;
    利用下列公式计算得到所述PCB板卡的任一边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角dα
    Figure PCTCN2016096751-appb-100003
    Figure PCTCN2016096751-appb-100004
    其中,a为变量,a的取值范围是0~180°;dα表示与{Di}中的所有直线的倾斜角度夹角最小的角度;i=1,2,3...M,M为所述直线信息中所有直线的总数量;
    所述PCB板卡的其余三个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的夹角分别为:dα,dα+90°,dα+90°
  6. 根据权利要求4或5所述的一种基于外轮廓的PCB板卡匹配方法,其特 征在于:通过以下步骤计算得到所述PCB边缘信息中所述PCB板卡的每个边缘与所述目标图像的平面坐标系的X轴或Y轴之间的截距:
    遍历所述直线信息中的所有直线,通过以下公式计算得到与所述PCB板卡的任一边缘同向的直线集合{Mi}:
    {Mi|Mi∈{Li},|Ki-dα|<ε}
    其中,{Li}为所述直线信息中的所有直线集合;Ki为直线Li的倾斜角;ε为{Li}中的直线与所述PCB板卡的任一边缘方向的最小夹角;
    假设直线集合{Mi}与X轴/Y轴的截距为{Bi},设:
    Bmax=max{Bi},Bmin=min{Bi}
    将区间[Bmin,Bmax]等分成N个子区间,则ΔB={Bmax-Bmin}/N,则第i个区间Ai的范围是:
    Ai=[Bmin+ΔB*(i-1),Bmin+(ΔB*i)]
    其中,Bmax为{Bi}中的最大值,Bmin为{Bi}中的最小值;ΔB为每个截距区间的大小;
    对{Bi}中所有的截距进行区间统计,得到{Ci},0<=i<=N,{Ci}表示截距落在第i个区间的个数;
    从i=0递增在{Ci}中找到第一个峰值所对应的截距B1,从i=N递减在{Ci}中找到第一个峰值所对应的截距Br,则B1、Br代表所述PCB板卡的两个同向边缘与X轴/Y轴的截距;
    设置da′=da+90°,将da=da′-90°代入上述公式中,并重复上述步骤,得到所述PCB板卡的另外两个同向边缘与X轴/Y轴的截距Bu、Bb
  7. 根据权利要求6所述的一种基于外轮廓的PCB板卡匹配方法,其特征在于:通过以下步骤计算所述目标图像中所述PCB板卡的至少两个顶点的坐标:
    基于得到的PCB板卡的每个边缘所述目标图像的平面坐标系的X轴或Y轴之间的夹角和截距,得到四条直线,分别为: L1(dα,Bl),L2(dα,Br),L3(dα+90°,Bu)和L4(dα+90°,Bb),四条直线相交得到四个顶点p0,p1,p2,p3
    通过以下计算方法得到所述四个顶点中的至少两个顶点的坐标:
    L1:y=tan(dα)x+B1,L3:y=tan(dα+90)x+Bu,解一个二元一次方程组,得到交点p0坐标:
    ((B1-Bu)/(tan(dα+90)-tan(dα)),(tan(dα)*Bu-tan(dα+90)*B1)/(tan(dα+90)-tan(dα)))
    依次类推得到后面的交点:
    p1:((B1-Bb)/(tan(dα+90)-tan(dα)),(tan(dα)*Bb-tan(dα+90)*B1)/(tan(dα+90)-tan(dα)))
    p2:((Bα-Bu)/(tan(dα+90)-tan(dα)),(tan(dα)*Bu-tan(dα+90)*Bα)/(tan(dα+90)-tan(dα)))
    p3:((Bα-Bb)/(tan(dα+90)-tan(dα)),(tan(dα)*Bb-tan(dα+90)*Bα)/(tan(dα+90)-tan(dα)))。
  8. 根据权利要求7所述的一种基于外轮廓的PCB板卡匹配方法,其特征在于,通过以下步骤得到所述标准图像到所述目标图像的仿射变换矩阵:
    假设所述标准图像中所述PCB板卡的四个顶点是(p01,p02,p03,p04),所述目标图像中所述PCB板卡的对应的四个顶点是(p11,p12,p13,p14),假设所述标准图像到所述目标图像的绽放系数k,旋转角度是α,及平移量是dx,dy,则仿射变换矩阵是:
    Figure PCTCN2016096751-appb-100005
    那么,所述标准图像中的顶点到所述目标图像的对应顶点变换过程是:
    Figure PCTCN2016096751-appb-100006
    将所述目标图像中任意两个顶点的坐标以及预设的标准图像中对应两个顶点的坐标代入上述公式解出k,α,dx,dy。
  9. 根据权利要求8所述的一种基于外轮廓的PCB板卡匹配方法,其特征在 于,将所述仿射变换矩阵与所述标准图像相乘,得到所述配准图像。
  10. 一种基于外轮廓的PCB板卡快速匹配装置,其特征在于,包括:
    边缘信息检测模块,用于检测目标图像中所有的边缘信息;
    直线信息获取模块,用于获取所述边缘信息中的直线信息;
    PCB边缘信息获取模块,基于所述直线信息计算获得PCB边缘信息;
    顶点计算模块,基于所述PCB边缘信息计算得到所述目标图像中所述PCB板卡的至少两个顶点的坐标;
    仿射变换矩阵计算模块,基于所述目标图像中所述PCB板卡的至少两个顶点中的任意两个顶点的坐标以及预设的标准图像中所述PCB板卡的对应两个顶点的坐标,计算得到所述标准图像到所述目标图像的仿射变换矩阵;
    匹配模块,基于所述仿射变换矩阵与所述标准图像得到配准图像,并将所述配准图像与所述目标图像进行匹配。
PCT/CN2016/096751 2015-10-19 2016-08-25 一种基于外轮廓的pcb板卡匹配方法及装置 WO2017067321A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510679957.8A CN105261022B (zh) 2015-10-19 2015-10-19 一种基于外轮廓的pcb板卡匹配方法及装置
CN201510679957.8 2015-10-19

Publications (1)

Publication Number Publication Date
WO2017067321A1 true WO2017067321A1 (zh) 2017-04-27

Family

ID=55100694

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/096751 WO2017067321A1 (zh) 2015-10-19 2016-08-25 一种基于外轮廓的pcb板卡匹配方法及装置

Country Status (2)

Country Link
CN (1) CN105261022B (zh)
WO (1) WO2017067321A1 (zh)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109614059A (zh) * 2018-12-19 2019-04-12 森大(深圳)技术有限公司 Gerber文件处理方法、装置及计算机可读存储介质
CN110070528A (zh) * 2019-04-18 2019-07-30 天津工业大学 一种应用于模具镶块工件加工在线定位的二维检测方法
CN111199563A (zh) * 2019-11-22 2020-05-26 华南理工大学 基于改进的霍夫变换算法的单晶硅太阳能晶片图像定位方法
CN113989312A (zh) * 2021-11-10 2022-01-28 佛山市南海区广工大数控装备协同创新研究院 一种基于形状上下文特征的不规则pcb板轮廓匹配的方法
CN114322775A (zh) * 2022-01-06 2022-04-12 深圳威洛博机器人有限公司 一种机器人视觉定位系统及视觉定位方法
CN114565612A (zh) * 2022-04-29 2022-05-31 惠州威尔高电子有限公司 一种基于图像对比的pcb板u型槽加工异常检测方法
CN114612537A (zh) * 2022-03-29 2022-06-10 新智认知数据服务有限公司 数字孪生图像与真实图像配准方法、设备及可读存储介质
CN117670887A (zh) * 2024-02-01 2024-03-08 湘潭大学 一种基于机器视觉的锡焊高度及缺陷检测方法

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105261022B (zh) * 2015-10-19 2018-12-18 广州视源电子科技股份有限公司 一种基于外轮廓的pcb板卡匹配方法及装置
CN107967679B (zh) * 2017-11-21 2020-07-03 凌云光技术集团有限责任公司 一种基于pcb产品矢量图形的自动选取定位核的方法
CN109581189A (zh) * 2018-11-28 2019-04-05 江门市利诺达电路科技有限公司 一种小尺寸电路板的制作方法
CN109347985A (zh) * 2018-12-03 2019-02-15 群蜂信息技术(上海)有限公司 一种基于边缘计算的多业务处理方法、装置及边缘服务器
CN113450299A (zh) * 2020-03-09 2021-09-28 深圳中科飞测科技股份有限公司 图像匹配方法、计算机装置及可读存储介质
CN115546219B (zh) * 2022-12-05 2023-10-20 广州镭晨智能装备科技有限公司 检测板式生成方法、板卡缺陷检测方法、装置及产品

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006049347A (ja) * 2004-07-30 2006-02-16 Fujitsu Ltd 部品エッジ検出方法、部品エッジ検出プログラム及び検査装置
CN102034101A (zh) * 2010-10-22 2011-04-27 广东工业大学 一种pcb视觉检测中快速圆形标志定位方法
CN102721364A (zh) * 2011-03-30 2012-10-10 比亚迪股份有限公司 一种工件的定位方法及其装置
CN104408735A (zh) * 2014-12-12 2015-03-11 电子科技大学 一种基于改进形状角计算的矩形区域识别方法
CN104981105A (zh) * 2015-07-09 2015-10-14 广东工业大学 一种快速精确获得元件中心和偏转角度的检测及纠偏方法
CN105261022A (zh) * 2015-10-19 2016-01-20 广州视源电子科技股份有限公司 一种基于外轮廓的pcb板卡匹配方法及装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102937595B (zh) * 2012-11-13 2015-05-20 浙江省电力公司电力科学研究院 一种pcb板检测方法、装置及系统

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006049347A (ja) * 2004-07-30 2006-02-16 Fujitsu Ltd 部品エッジ検出方法、部品エッジ検出プログラム及び検査装置
CN102034101A (zh) * 2010-10-22 2011-04-27 广东工业大学 一种pcb视觉检测中快速圆形标志定位方法
CN102721364A (zh) * 2011-03-30 2012-10-10 比亚迪股份有限公司 一种工件的定位方法及其装置
CN104408735A (zh) * 2014-12-12 2015-03-11 电子科技大学 一种基于改进形状角计算的矩形区域识别方法
CN104981105A (zh) * 2015-07-09 2015-10-14 广东工业大学 一种快速精确获得元件中心和偏转角度的检测及纠偏方法
CN105261022A (zh) * 2015-10-19 2016-01-20 广州视源电子科技股份有限公司 一种基于外轮廓的pcb板卡匹配方法及装置

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109614059A (zh) * 2018-12-19 2019-04-12 森大(深圳)技术有限公司 Gerber文件处理方法、装置及计算机可读存储介质
CN110070528A (zh) * 2019-04-18 2019-07-30 天津工业大学 一种应用于模具镶块工件加工在线定位的二维检测方法
CN110070528B (zh) * 2019-04-18 2023-04-21 天津工业大学 一种应用于模具镶块工件加工在线定位的二维检测方法
CN111199563B (zh) * 2019-11-22 2023-03-14 华南理工大学 基于改进霍夫变换算法的单晶硅太阳能晶片图像定位方法
CN111199563A (zh) * 2019-11-22 2020-05-26 华南理工大学 基于改进的霍夫变换算法的单晶硅太阳能晶片图像定位方法
CN113989312A (zh) * 2021-11-10 2022-01-28 佛山市南海区广工大数控装备协同创新研究院 一种基于形状上下文特征的不规则pcb板轮廓匹配的方法
CN113989312B (zh) * 2021-11-10 2024-04-09 佛山市南海区广工大数控装备协同创新研究院 一种基于形状上下文特征的不规则pcb板轮廓匹配的方法
CN114322775B (zh) * 2022-01-06 2022-11-11 深圳威洛博机器人有限公司 一种机器人视觉定位系统及视觉定位方法
CN114322775A (zh) * 2022-01-06 2022-04-12 深圳威洛博机器人有限公司 一种机器人视觉定位系统及视觉定位方法
CN114612537A (zh) * 2022-03-29 2022-06-10 新智认知数据服务有限公司 数字孪生图像与真实图像配准方法、设备及可读存储介质
CN114565612B (zh) * 2022-04-29 2022-07-05 惠州威尔高电子有限公司 一种基于图像对比的pcb板u型槽加工异常检测方法
CN114565612A (zh) * 2022-04-29 2022-05-31 惠州威尔高电子有限公司 一种基于图像对比的pcb板u型槽加工异常检测方法
CN117670887A (zh) * 2024-02-01 2024-03-08 湘潭大学 一种基于机器视觉的锡焊高度及缺陷检测方法
CN117670887B (zh) * 2024-02-01 2024-04-09 湘潭大学 一种基于机器视觉的锡焊高度及缺陷检测方法

Also Published As

Publication number Publication date
CN105261022A (zh) 2016-01-20
CN105261022B (zh) 2018-12-18

Similar Documents

Publication Publication Date Title
WO2017067321A1 (zh) 一种基于外轮廓的pcb板卡匹配方法及装置
WO2021138995A1 (zh) 一种棋盘格角点全自动检测方法
CN108122256B (zh) 一种逼近状态下旋转目标位姿测量的方法
He et al. Sparse template-based 6-D pose estimation of metal parts using a monocular camera
CN103499297B (zh) 一种基于ccd的高精度测量方法
US11398053B2 (en) Multispectral camera external parameter self-calibration algorithm based on edge features
CN109544628B (zh) 一种指针式仪表的准确读数识别系统及方法
CN108510476B (zh) 一种基于机器视觉的手机屏线路检测方法
CN114494045B (zh) 一种基于机器视觉的大型直齿轮几何参数测量系统及方法
CN106447601A (zh) 一种基于投影‑相似变换的无人机遥感影像拼接方法
CN107092905B (zh) 一种电力巡检机器人的待识别仪器定位方法
CN111723801A (zh) 鱼眼相机图片中目标检测矫正的方法与系统
CN107680035B (zh) 一种参数标定方法和装置、服务器及可读存储介质
CN110519508B (zh) 一种在摄像模组自动调心过程中识别特征对象的方法
CN112419224B (zh) 一种球形引脚芯片定位方法及系统
CN113705564B (zh) 一种指针式仪表识别读数方法
JP2008252856A (ja) 画像の補正方法、補正プログラムおよび画像歪み補正装置
CN104484647B (zh) 一种高分辨率遥感图像云高度检测方法
CN117253022A (zh) 一种对象识别方法、装置及查验设备
CN107330436B (zh) 一种基于尺度判据的全景图像sift优化方法
WO2017107564A1 (zh) 板卡图像获取方法和系统
CN110674817B (zh) 一种基于双目摄像头的车牌防伪的方法及装置
CN113129363A (zh) 一种基于特征物体和透视变换的图像距离信息提取方法
CN116978005B (zh) 基于姿态变换的显微镜图像处理系统
Jing et al. Determination of platform attitude through SURF based aerial image matching

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16856755

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16856755

Country of ref document: EP

Kind code of ref document: A1