[go: up one dir, main page]

CN109829911A - A kind of pcb board surface inspecting method based on the overproof algorithm of profile - Google Patents

A kind of pcb board surface inspecting method based on the overproof algorithm of profile Download PDF

Info

Publication number
CN109829911A
CN109829911A CN201910107780.2A CN201910107780A CN109829911A CN 109829911 A CN109829911 A CN 109829911A CN 201910107780 A CN201910107780 A CN 201910107780A CN 109829911 A CN109829911 A CN 109829911A
Authority
CN
China
Prior art keywords
point
contour
test
image
normal
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.)
Granted
Application number
CN201910107780.2A
Other languages
Chinese (zh)
Other versions
CN109829911B (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.)
Shenzhen Haokun Electronics Co ltd
Original Assignee
Guangdong 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 Guangdong University of Technology filed Critical Guangdong University of Technology
Priority to CN201910107780.2A priority Critical patent/CN109829911B/en
Publication of CN109829911A publication Critical patent/CN109829911A/en
Application granted granted Critical
Publication of CN109829911B publication Critical patent/CN109829911B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)
  • Image Processing (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

本发明提供了一种基于轮廓超差算法的PCB板表面检测方法,首先获得PCB裸板模板图,然后对采集到的图像进行处理得到测试图,其次对测试图和模板图进行模板匹配到位,最后利用轮廓超差算法思想寻找测试图上的缺陷;利用这种轮廓超差的方法可以在PCB板铜面轮廓360度方向上找PCB板上的缺陷,而且没有轮廓形状的限制;并且可以找到PCB板上断路、短路、破损、铜面划伤、铜渣等几乎所有的PCB板缺陷;这种方法比传统的利用图像开闭运算结合的方法等算法找PCB板缺陷的方法更为准确,适用面更广,可以找出几乎所有PCB板上缺陷类型。不会漏找,误找缺陷。

The invention provides a PCB board surface detection method based on a contour out-of-tolerance algorithm. First, a template image of a PCB bare board is obtained, then a test image is obtained by processing the collected image, and then the template matching is performed on the test image and the template image. Finally, use the contour out-of-tolerance algorithm idea to find defects on the test chart; using this contour out-of-tolerance method, you can find defects on the PCB board in the 360-degree direction of the copper surface contour of the PCB, and there is no limit to the contour shape; and you can find Almost all PCB board defects such as open circuit, short circuit, damage, copper surface scratches, copper slag, etc. on the PCB board; this method is more accurate than the traditional method of using the combination of image opening and closing operations to find PCB board defects. It has a wider application and can find almost all types of defects on the PCB. Will not miss, find defects by mistake.

Description

A kind of pcb board surface inspecting method based on the overproof algorithm of profile
Technical field
The present invention relates to field of image processings, and in particular to a kind of pcb board Surface testing side based on the overproof algorithm of profile Method.
Background technique
In the defects detection of the route of the pcb board based on machine vision, mainly takes calculated with behind interception area at present Connected domain number and area carry out short circuit, and open circuit is damaged, the defect recognition of copper ashes.Not only time-consuming and laborious in this way but also precision is low, it is adopting Other interference during the image of collection caused by the factors such as mechanical shaking polishing in plan area, connected domain number and face Product changes, and be easy to cause erroneous detection.
Most detection PCB line defcts are sentenced using the method for the number for calculating connected region in the region of interception at present Disconnected defect part is short circuit or open circuit, judges copper ashes and damage zone using corresponding position conductive region size is compared Domain.First interception area size selection actual production detection in can not be accurately held, when detecting between limited feelings Under condition, there can not be sufficient time accurate interception area, in zoning when number, since line edges gray scale is gradual change , there can be the total number of tiny area influence area after binarization threshold, and then influence the judgement of defect.
Summary of the invention
In view of the deficiencies of the prior art, the present invention provides a kind of pcb board surface inspecting method based on the overproof algorithm of profile, To solve technical problem described in background technology.
To achieve the above object, the present invention adopts the following technical scheme:
A kind of pcb board surface inspecting method based on the overproof algorithm of profile, which is characterized in that comprising the following specific steps
S1 obtains PCB bare board Prototype drawing, is cut into the small image of the identical specific dimensions of several sizes, divided The object that standard picture preferentially be used to be matched;
Acquired image is handled i.e. denoising by S2, the algorithm of automatic threshold segmentation divides bare board copper face to accurate It cuts out, then binary image, that is, line conductor area gray value is 255, and the gray value of background area is 0, obtains binary map i.e. Test chart is cut into the small image of test that the identical specific dimensions of several sizes arrive, and the small image of the test being cut into is used for priority match Prototype drawing;
S3 uses the matched method of shape template to test small image and go to match the corresponding small figure of standard as template and aligns;
Obtained test image and corresponding standard picture are sought edge sub-pixel edge respectively, and seek sub- picture by S4 The ranks coordinate at plain edge, then seeks the normal direction of each coordinate points in edge with specific method;
S5 seeks the edge contour for testing small figure and the small figure of corresponding standard, the standard that will have been aligned in step S3 respectively Small figure and the corresponding small figure of test are placed under same image coordinate system, with the overproof algorithm of profile i.e. preferentially in test map contour coordinate points Normal direction on corresponding step-length number to the interior profile point for going for standard drawing.
Further, the specific steps in the step S4 include:
S401 will be obtained testing small image and the small image of corresponding standard sought edge sub-pixel edge respectively, and seeks The ranks coordinate of sub-pixel edge is stored in array in order by the ranks coordinate sought in the way of migration profile, row Coordinate and column coordinate, which should correspond to, to be stored in different arrays;
S402, the ranks coordinate that the profile ranks coordinate required by step 4.1 will be acquired in the way of migration profile Number, such as 1,2,3,4......n, have been connected with the profile coordinate points of number 3 with straight line according to by the profile coordinate points of number 1 Come, number 4 and number 6 are connected with straight line, and connection is gone down in this manner, if finally there are remaining coordinate points, no By remaining how many be all that n-th of coordinate points is connected with straight line with the n-th -2 coordinate points, and seek being connected this The slope of a little line segments, and then seek these line segment normal angles;The range of normal angles is [- π, π], by obtained normal angle Degree is numbered in order according to as the direction for seeking ranks coordinate migration profile;Such as 3,6,9.......3m, n;
S403 answers normal angles striked in step 402 according to the sequence and corresponding profile point coordinate pair of number Get up, the normal angles as numbered the profile point for being 1,2,3 are the normal angles that normal angles number is No. 3, number 4,5,6 Profile point normal angles be normal angles number be No. 6 normal angles, successively go in this way;Each profile coordinate Point has the normal angles corresponding to oneself.
Further, the specific steps in the step S5 include:
S501 seeks the edge contour for testing small figure and the small figure of corresponding standard, the mark that will have been aligned in step S3 respectively Quasi- small figure and the corresponding small figure of test are placed under same image coordinate system;
S502, according to the profile point and corresponding normal angles for preferentially seeking testing small figure in step S402 according to test The sequence of small map contour migration seek profile point number be 1 coordinate point forward normal direction step-length be 0 coordinate points coordinate and this Gray value in a coordinate points looks for the gray value of 8 neighborhoods of this coordinate points if gray scale is 0;If in this coordinate points Gray value be 255, then have found the profile point on the small figure of template and find out their distance D0, if distance D0 be less than regulation Normal distance value Dmix when, then this profile point tested on small figure is not defect point;If the coordinate that profile point number is 1 The gray value of 8 neighborhoods of the coordinate points that point forward normal direction step-length is 0 is all 0, then continues to find toward in next step-length;If surveyed Try 8 neighborhoods of the coordinate points that coordinate point forward normal direction step-length that small map contour point number is 1 is 0 gray value it is promising 255 when, say Then the bright profile point for having found the small figure of the template aligned finds out the coordinate points and test for testing that small map contour point number is 1 The gray value of 8 neighborhoods of the coordinate points that the coordinate point forward normal direction step-length that small map contour point number is 1 is 0 be 255 coordinates away from From D1, D2......;If their minimum range is greater than defined normal distance value Dmix, then this on small figure is tested A profile point is defect point, otherwise is not defect point;If the profile point i.e. gray value for having found the small figure of corresponding templates is 255 Point does not just continually look in the step-length of normal direction;It is then continually looked in the step-length of normal direction conversely, not finding defect point;
S503, if there are no find on pixel and its within 8 neighborhoods within the step-length number of defined positive normal direction It is anti-that the coordinate points that gray value is 255 then number the coordinate points for being 1 in the small map contour point of test according to the method and step of step S502 The profile point that Prototype drawing is found within to normal direction step-length number, no longer finds in normal direction, such as if the profile point for finding Prototype drawing Their distance of fruit is greater than defined distance, then this profile point tested on small figure is defect point;If defined reversed Small figure is then tested there are no the coordinate points that find gray value be 255 on pixel and its within 8 neighborhoods within the step-length number of normal direction On this profile point be defect point;
S504 is looked for according to the method and step of step S502 and step S503 along the direction for testing small map contour migration Profile point number is the profile point on the outlines points such as 2,3,4.......n on the small image of template of normal orientation, if corresponding When testing the distance of small image outline point and the small image outline point of template greater than defined normal distance value Dmix, then small figure is tested On this profile point be defect point, otherwise not be defect point;If all do not had in the test positive and negative normal direction of small image outline point Find the small image outline point of point i.e. template that pixel value is 255;At this point, testing small image outline point (sub-pixel) also is defect Point;
S505 looks for profile point if the pixel value for testing small image is all 0 or 255 in normal direction in turn It is walked i.e. in the normal direction in the profile point of the small image of template according to the method for step S502 and step S503 and step S504 The profile point of the corresponding small image of test is looked under rapid and then finds the defect point tested on small image;
S506, bare board or big defect if it is big copper face find defect point in normal orientation along profile dot interlace;If it is The bare board of small copper face or small defect then find defect point in normal orientation point by point along profile;
S507, if looking on pcb board if the big defect of copper face the defined normal distance value in the normal orientation of profile point Dmix wants setting appropriate larger, and normal direction step-length number is also appropriate to want larger;It is on the contrary then opposite.
Further, if having found test in the defined step-length number of the normal orientation for the profile point for testing small image Profile point on small image and distance is greater than type of the defined maximum Dmax apart from the defect point then looked for and is between them The defects of copper face is damaged, and copper face welds more, copper ashes;If on the both forward and reverse directions of the normal orientation for the profile point for testing small image The type for the defect point that the profile point on the small image of template is then looked for all is not had found in defined step-length number and its in 8 neighborhoods For copper face open circuit;In defined step-length number on the both forward and reverse directions in the normal direction in the profile point of the small image of template and its The type that the defect point that the profile point tested on small image is then looked for all is not had found in 8 neighborhoods is the defects of copper face is short-circuit.
A kind of beneficial effect of pcb board surface inspecting method based on the overproof algorithm of profile provided by the invention is:
(1) present invention is according to the PCB image of acquisition, and on the basis of consideration machine error, optical aberrations etc., automatic aligning is pre- The pcb board image and standard form image of processing obtain short circuit, open circuit, damaged, copper with the overproof algorithm operation of profile in turn The defects of slag;
(2) defect on pcb board can be looked on 360 degree of directions of pcb board copper face profile using the overproof algorithm of this profile, And the not limitation of chamfered shape, and open circuit, short circuit, breakage, copper face scuffing, copper ashes etc. can be found on pcb board almost All pcb board defects;Moreover, the not limitation of defect size;This method is combined than traditional using image opening and closing operation Method scheduling algorithm look for the method for pcb board defect more accurate, the precision for finding defect has reached pixel scale, and applicable surface is more Extensively, defect type on nearly all pcb board can be found out.
Detailed description of the invention
Fig. 1 is flow diagram of the present invention;
Fig. 2 is the template image of Gerber file generated of the present invention;
Fig. 3 is the present invention in the display normal direction tested on small image;
Fig. 4 is the present invention in the defect point found tested on small image.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Whole description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Ability Domain ordinary person every other embodiment obtained without making creative work, belongs to protection of the invention Range.
A kind of embodiment: pcb board surface inspecting method based on the overproof algorithm of profile.
Pcb file is converted Gerber file by S1, then, is gone out Gerber document analysis using GerbMagic software To be converted into BMP format-pattern;In this way, the bianry image i.e. standard picture of pcb bare board standard circuit has just been obtained, then by it It is cut into the small image of the identical specific dimensions of several sizes, divided standard picture is preferentially used to the object being matched;
Acquired image is handled i.e. denoising by S2, the algorithm of automatic threshold segmentation divides bare board copper face to accurate It cuts out, then binary image, that is, line conductor area gray value is 255, and the gray value of background area is 0, obtains binary map i.e. Test chart is cut into the small image of test that the identical specific dimensions of several sizes arrive, and the small image of the test being cut into is used for priority match Prototype drawing;
S3 uses the matched method of shape template to test small image and go to match the corresponding small figure of standard as template and aligns;
Obtained test image and corresponding standard picture are sought edge sub-pixel edge respectively, and seek sub- picture by S4 The ranks coordinate at plain edge, then seeks the normal direction of each coordinate points in edge with specific method;
S5 seeks the edge contour for testing small figure and the small figure of corresponding standard, the standard that will have been aligned in step S3 respectively Small figure and the corresponding small figure of test are placed under same image coordinate system, with the overproof algorithm of profile i.e. preferentially in test map contour coordinate points Normal direction on corresponding step-length number to the interior profile point for going for standard drawing.
Further, the specific steps in the step S4 include:
S401 will be obtained testing small image and the small image of corresponding standard sought edge sub-pixel edge respectively, and seeks The ranks coordinate of sub-pixel edge is stored in array in order by the ranks coordinate sought in the way of migration profile, row Coordinate and column coordinate, which should correspond to, to be stored in different arrays;
S402, the ranks coordinate that the profile ranks coordinate required by step 4.1 will be acquired in the way of migration profile Number, such as 1,2,3,4......n, have been connected with the profile coordinate points of number 3 with straight line according to by the profile coordinate points of number 1 Come, number 4 and number 6 are connected with straight line, and connection is gone down in this manner, if finally there are remaining coordinate points, no By remaining how many be all that n-th of coordinate points is connected with straight line with the n-th -2 coordinate points, and seek being connected this The slope of a little line segments, and then seek these line segment normal angles;The range of normal angles is [- π, π], by obtained normal angle Degree is numbered in order according to as the direction for seeking ranks coordinate migration profile;Such as 3,6,9.......3m, n;
S403 answers normal angles striked in step 402 according to the sequence and corresponding profile point coordinate pair of number Get up, the normal angles as numbered the profile point for being 1,2,3 are the normal angles that normal angles number is No. 3, number 4,5,6 Profile point normal angles be normal angles number be No. 6 normal angles, successively go in this way;Each profile coordinate Point has the normal angles corresponding to oneself.
Further, the specific steps in the step S5 include:
S501 seeks the edge contour for testing small figure and the small figure of corresponding standard, the mark that will have been aligned in step S3 respectively Quasi- small figure and the corresponding small figure of test are placed under same image coordinate system;
S502, according to the profile point and corresponding normal angles for preferentially seeking testing small figure in step S402 according to test The sequence of small map contour migration seek profile point number be 1 coordinate point forward normal direction step-length be 0 coordinate points coordinate and this Gray value in a coordinate points looks for the gray value of 8 neighborhoods of this coordinate points if gray scale is 0;If in this coordinate points Gray value be 255, then have found the profile point on the small figure of template and find out their distance D0, if distance D0 be less than regulation Normal distance value Dmix when, then this profile point tested on small figure is not defect point;If the coordinate that profile point number is 1 The gray value of 8 neighborhoods of the coordinate points that point forward normal direction step-length is 0 is all 0, then continues to find toward in next step-length;If surveyed Try 8 neighborhoods of the coordinate points that coordinate point forward normal direction step-length that small map contour point number is 1 is 0 gray value it is promising 255 when, say Then the bright profile point for having found the small figure of the template aligned finds out the coordinate points and test for testing that small map contour point number is 1 The gray value of 8 neighborhoods of the coordinate points that the coordinate point forward normal direction step-length that small map contour point number is 1 is 0 be 255 coordinates away from From D1, D2......;If their minimum range is greater than defined normal distance value Dmix, then this on small figure is tested A profile point is defect point, otherwise is not defect point;If the profile point i.e. gray value for having found the small figure of corresponding templates is 255 Point does not just continually look in the step-length of normal direction;It is then continually looked in the step-length of normal direction conversely, not finding defect point;
S503, if there are no find on pixel and its within 8 neighborhoods within the step-length number of defined positive normal direction It is anti-that the coordinate points that gray value is 255 then number the coordinate points for being 1 in the small map contour point of test according to the method and step of step S502 The profile point that Prototype drawing is found within to normal direction step-length number, no longer finds in normal direction, such as if the profile point for finding Prototype drawing Their distance of fruit is greater than defined distance, then this profile point tested on small figure is defect point;If defined reversed Small figure is then tested there are no the coordinate points that find gray value be 255 on pixel and its within 8 neighborhoods within the step-length number of normal direction On this profile point be defect point;
S504 is looked for according to the method and step of step S502 and step S503 along the direction for testing small map contour migration Profile point number is the outline point on the outlines points such as 2,3,4.......n on the small image of template of normal orientation, if corresponding When testing the distance of small image outline point and the small image outline point of template greater than defined normal distance value Dmix, then small figure is tested On this profile point be defect point, otherwise not be defect point;If all do not had in the test positive and negative normal direction of small image outline point Find the small image outline point of point i.e. template that pixel value is 255;At this point, testing small image outline point (sub-pixel) also is defect Point;
S505 looks for profile point if the pixel value for testing small image is all 0 or 255 in normal direction in turn It is walked i.e. in the normal direction in the profile point of the small image of template according to the method for step S502 and step S503 and step S504 The profile point of the corresponding small image of test is looked under rapid and then finds the defect point tested on small image;
S506, bare board or big defect if it is big copper face find defect point in normal orientation along profile dot interlace;If it is The bare board of small copper face or small defect then find defect point in normal orientation point by point along profile;
S507, if looking on pcb board if the big defect of copper face the defined normal distance value in the normal orientation of profile point Dmix wants setting appropriate larger, and normal direction step-length number is also appropriate to want larger;It is on the contrary then opposite.
Further, if having found test in the defined step-length number of the normal orientation for the profile point for testing small image Profile point on small image and distance is greater than type of the defined maximum Dmax apart from the defect point then looked for and is between them The defects of copper face is damaged, and copper face welds more, copper ashes;If on the both forward and reverse directions of the normal orientation for the profile point for testing small image The type for the defect point that the profile point on the small image of template is then looked for all is not had found in defined step-length number and its in 8 neighborhoods For copper face open circuit;In defined step-length number on the both forward and reverse directions in the normal direction in the profile point of the small image of template and its The type that the defect point that the profile point tested on small image is then looked for all is not had found in 8 neighborhoods is the defects of copper face is short-circuit.
The above is presently preferred embodiments of the present invention, but the present invention should not be limited to embodiment and attached drawing institute public affairs The content opened both falls within protection of the present invention so all do not depart from the lower equivalent or modification completed of spirit disclosed in this invention Range.

Claims (4)

1.一种基于轮廓超差算法的PCB板表面检测方法,其特征在于,包括以下具体步骤:1. a method for detecting the surface of a PCB board based on a contour out-of-tolerance algorithm, is characterized in that, comprises the following concrete steps: S1,获得PCB裸板模板图,将其切分成数个大小相同特定尺寸的小图像,被分割的标准图像优先被用于被匹配的对象;S1, obtain the template image of the PCB bare board, and divide it into several small images of the same size and a specific size, and the divided standard images are preferentially used for the matched objects; S2,将采集到的图像进行处理即去噪、自动阈值分割的算法将裸板铜面给准确分割出来,然后二值化图像即线路导体区的灰度值为255,背景区的灰度值为0,得到二值图即测试图切分成数个大小相同特定尺寸到的测试小图像,切分成的测试小图像用于优先匹配模板图;S2, process the collected image, that is, denoising and automatic threshold segmentation algorithms to accurately segment the bare copper surface, and then binarize the image, that is, the gray value of the line conductor area is 255, and the gray value of the background area is 255. If it is 0, the binary image is obtained, that is, the test image is divided into several small test images of the same size and a specific size, and the divided test images are used to preferentially match the template image; S3,用形状模板匹配的方法测试小图像作为模板去匹配对应的标准小图即对位;S3, use the shape template matching method to test the small image as a template to match the corresponding standard small image, that is, alignment; S4,将得到的测试图像和对应的标准图像分别求取边缘亚像素边缘,并求取亚像素边缘的行列坐标,然后用特定的方法求取边缘每个坐标点的法向;S4, obtain the edge sub-pixel edge from the obtained test image and the corresponding standard image respectively, and obtain the row and column coordinates of the sub-pixel edge, and then use a specific method to obtain the normal direction of each coordinate point of the edge; S5,分别求取测试小图和对应的标准小图的边缘轮廓,将步骤S3中对位好的标准小图和对应测试小图放在同一图像坐标系下,用轮廓超差算法即优先在测试图轮廓坐标点的法向上的对应的步长数至内去找标准图的轮廓点。S5, the edge contours of the test thumbnail and the corresponding standard thumbnail are obtained respectively, and the aligned standard thumbnail and the corresponding test thumbnail in step S3 are placed in the same image coordinate system, and the contour out-of-tolerance algorithm is used to give priority to The corresponding steps in the normal direction of the contour coordinate points of the test image are to find the contour points of the standard image. 2.如权利要求1所述的基于轮廓超差算法的PCB板表面检测方法,其特征在于,所述步骤S4中的具体步骤包括:2. the PCB board surface detection method based on contour out-of-tolerance algorithm as claimed in claim 1, is characterized in that, the concrete steps in described step S4 comprise: S401,将得到测试小图像和对应的标准小图像分别求取边缘亚像素边缘,并求取亚像素边缘的行列坐标,将求取的行列坐标按照游走轮廓的方式,按顺序存放在数组中,行坐标和列坐标应对应存放在不同的数组中;S401, obtain the edge sub-pixel edge of the obtained test small image and the corresponding standard small image respectively, and obtain the row and column coordinates of the sub-pixel edge, and store the obtained row and column coordinates in an array in an orderly manner according to the walking outline. , the row coordinates and column coordinates should be stored in different arrays correspondingly; S402,将在步骤4.1所求的轮廓行列坐标按照游走轮廓的方式将求得的行列坐标编号,如1、2、3、4......n,按照将编号1的轮廓坐标点和编号3的轮廓坐标点用直线连接起来,编号4和编号6用直线连接起来,按照这种方式连接下去,如果最后有剩余的坐标点,不论剩余多少个都是第n个坐标点与第n-2个坐标点用直线连接起来,并求取所连接起来的这些线段的斜率,进而求取这些线段法向角度;法向角度的范围为[-π,π],将所求得的法向角度按照和求行列坐标游走轮廓的方向一样按顺序将其编号;如3、6、9.......3m、n;S402, number the row and column coordinates obtained in the contour row and column coordinates obtained in step 4.1 according to the way of walking the contour, such as 1, 2, 3, 4...n, according to the contour coordinate point numbered 1 Connect with the contour coordinate point of No. 3 with a straight line, and connect the No. 4 and No. 6 with a straight line. In this way, if there are remaining coordinate points at the end, no matter how many are left, it is the nth coordinate point and the No. 6 coordinate point. The n-2 coordinate points are connected by straight lines, and the slope of the connected line segments is obtained, and then the normal angle of these line segments is obtained; the range of the normal angle is [-π, π], and the obtained The normal angle is numbered in the same order as the direction of the row-column coordinate wandering contour; such as 3, 6, 9 ...... 3m, n; S403,将步骤402中所求取的法向角度按照编号的顺序和对应的轮廓点坐标对应起来,如编号为1、2、3的轮廓点的法向角度为法向角度编号为3号的法向角度,编号为4、5、6的轮廓点的法向角度为法向角度编号为6号的法向角度,这样依次进行下去;每个轮廓坐标点都有对应于自己的法向角度。S403, correspond the normal angles obtained in step 402 with the corresponding contour point coordinates in the order of numbering, for example, the normal angles of the contour points numbered 1, 2, and 3 are the normal angles numbered No. 3. The normal angle, the normal angle of the contour points numbered 4, 5, and 6 is the normal angle of the normal angle number 6, and so on; each contour coordinate point has its own normal angle. . 3.如权利要求2所述的基于轮廓超差算法的PCB板表面检测方法,其特征在于,所述步骤S5中的具体步骤包括:3. the PCB board surface detection method based on contour out-of-tolerance algorithm as claimed in claim 2, is characterized in that, the concrete steps in described step S5 comprise: S501,分别求取测试小图和对应的标准小图的边缘轮廓,将步骤S3中对位好的标准小图和对应测试小图放在同一图像坐标系下;S501, obtain the edge contours of the test thumbnail and the corresponding standard thumbnail respectively, and place the aligned standard thumbnail and the corresponding test thumbnail in step S3 under the same image coordinate system; S502,根据步骤S402中所优先求取测试小图的轮廓点和对应的法向角度按照测试小图轮廓游走的顺序求取轮廓点编号为1的坐标点正向法向步长为0的坐标点的坐标和这个坐标点上的灰度值,如果灰度为0,则找这个坐标点的8邻域的灰度值;如果这个坐标点上的灰度值为255,则找到了模板小图上的轮廓点并求出它们的距离D0,如果距离D0小于规定的法向距离值Dmix时,则测试小图上的这个轮廓点不为缺陷点;如果轮廓点编号为1的坐标点正向法向步长为0的坐标点的8邻域的灰度值都为0,则继续往下一个步长上寻找;如果测试小图轮廓点编号为1的坐标点正向法向步长为0的坐标点的8邻域的灰度值有为255时,说明找到了对位好的模板小图的轮廓点,然后求出测试小图轮廓点编号为1的坐标点与测试小图轮廓点编号为1的坐标点正向法向步长为0的坐标点的8邻域的灰度值为255坐标的距离D1,D2......;如果他们的的最小距离大于规定的法向距离值Dmix时,则测试小图上的这个轮廓点为缺陷点,反之不为缺陷点;如果找到了对应模板小图的轮廓点即灰度值为255的点就不在法向的步长上继续寻找;反之,没有找到缺陷点则在法向的步长上继续寻找;S502, according to the contour point of the test thumbnail and the corresponding normal angle obtained preferentially in step S402, according to the sequence of the outline of the test thumbnail, obtain the coordinate point whose contour point number is 1 and whose forward normal step is 0 The coordinates of the coordinate point and the gray value of this coordinate point. If the gray value is 0, find the gray value of the 8 neighborhood of this coordinate point; if the gray value of this coordinate point is 255, the template is found. If the distance D0 is less than the specified normal distance value Dmix, the contour point on the test thumbnail is not a defect point; if the contour point number is the coordinate point of 1 The gray value of the 8 neighborhoods of the coordinate point whose forward normal step size is 0 is 0, then continue to search for the next step size; When the gray value of the 8-neighborhood of the coordinate point whose length is 0 is 255, it means that the contour point of the well-aligned template thumbnail has been found, and then the coordinate point whose contour point number is 1 in the test thumbnail is determined to be the same as the test small image. The coordinate point of the contour point number 1 of the figure has a forward normal step of 0. The gray value of the 8 neighborhood of the coordinate point is 255. The distance D1, D2...; if their minimum distance is greater than When the specified normal distance value Dmix, the contour point on the test thumbnail is a defect point, otherwise it is not a defect point; if the contour point of the corresponding template thumbnail image is found, that is, the point with a gray value of 255 is not in the normal direction. Continue to search at the step length of ; on the contrary, if no defect point is found, continue to search at the step length of the normal direction; S503,如果在规定的正向法向的步长数之内像素点上及其8邻域之内还没有找到灰度值为255的坐标点则按照步骤S502的方法步骤在测试小图轮廓点编号为1的坐标点反向法向步长数之内寻找模板图的轮廓点,如果找到模板图的轮廓点则不再法向上寻找,如果它们的距离大于规定的距离,则测试小图上的这个轮廓点为缺陷点;如果在规定的反向法向的步长数之内像素点上及其8邻域之内还没有找到灰度值为255的坐标点,则测试小图上的这个轮廓点为缺陷点;S503, if no coordinate point with a grayscale value of 255 is found on the pixel point and its 8 neighborhoods within the specified number of steps in the forward normal direction, then test the outline point of the thumbnail according to the method steps of step S502 The coordinate point numbered 1 searches for the contour point of the template image within the number of steps in the reverse normal direction. If the contour point of the template image is found, it is no longer searched in the normal direction. If the distance between them is greater than the specified distance, the test will This contour point is a defect point; if no coordinate point with a gray value of 255 is found on the pixel point and its 8 neighborhoods within the specified number of steps in the reverse normal direction, test the This contour point is a defect point; S504,按照步骤S502和步骤S503的方法步骤,沿测试小图轮廓游走的方向去寻找轮廓点编号为2,3,4.......n等轮廊点上法向方向的模板小图像上的轮廊点,如果对应的测试小图像轮廊点和模板小图像轮廊点的距离大于规定的法向距离值Dmix时,则测试小图上的这个轮廓点为缺陷点,反之不为缺陷点;如果,在测试小图像轮廊点正反法向上都没有找到像素值为255的点即模板小图像轮廊点;此时,测试小图像轮廊点(亚像素级)也为缺陷点;S504, according to the method steps of step S502 and step S503, along the walking direction of the outline of the test thumbnail, look for the template whose outline points are numbered 2, 3, 4....n and other contour points in the normal direction. The contour point on the small image, if the distance between the corresponding test small image contour point and the template small image contour point is greater than the specified normal distance value Dmix, the contour point on the test small image is a defect point, otherwise It is not a defect point; if no point with a pixel value of 255 is found in the positive and negative directions of the test small image outline point, that is, the template small image outline point; at this time, the test small image outline point (sub-pixel level) is also for the defect point; S505,如果测试小图像的像素值全为0或255时,则反过来在法向上去寻找轮廓点即在模板小图像的轮廓点上的法线方向上按照步骤S502和步骤S503及步骤S504的方法步骤下去寻找对应的测试小图像的轮廓点进而找到测试小图像上的缺陷点;S505, if the pixel values of the test small image are all 0 or 255, then look for the contour point in the normal direction, that is, in the normal direction on the contour point of the template small image, according to steps S502, S503 and S504. The method steps go down to find the contour point of the corresponding test small image and then find the defect point on the test small image; S506,如果是大铜面的裸板或大缺陷沿轮廓隔点在法向方向寻找缺陷点;如果是小铜面的裸板或小缺陷则沿轮廓逐点在法向方向寻找缺陷点;S506, if it is a bare board with a large copper surface or a large defect, look for defect points in the normal direction along the contour interval; if it is a bare board or small defect with a small copper surface, search for defect points in the normal direction along the outline point by point; S507,如果找PCB板上铜面的大缺陷则在轮廓点的法向方向上规定的法向距离值Dmix要适当的设置大一些,法向步长数也适当的要大一些;反之则相反。S507, if a large defect in the copper surface of the PCB is found, the normal distance value Dmix specified in the normal direction of the contour point should be appropriately set larger, and the number of normal steps should be appropriately larger; otherwise, the opposite is true. . 4.如权利要求3所述的基于轮廓超差算法的PCB板表面检测方法,其特征在于,如果在测试小图像的轮廓点的法向方向的规定的步长数内找到了测试小图像上的轮廓点并且它们之间距离大于规定的最大Dmax距离则所找的缺陷点的类型为铜面破损,铜面多焊,铜渣等缺陷;如果在测试小图像的轮廓点的法向方向的正反方向上的规定的步长数内及其8邻域内都没有找到了模板小图像上的轮廓点则所找的缺陷点的类型为铜面断路;在模板小图像的轮廓点上的法线方向上的正反方向上的规定的步长数内及其8邻域内都没有找到了测试小图像上的轮廓点则所找的缺陷点的类型为铜面短路等缺陷。4. the PCB board surface detection method based on contour out-of-tolerance algorithm as claimed in claim 3, is characterized in that, if found on the test small image in the prescribed step number of the normal direction of the contour point of the test small image and the distance between them is greater than the specified maximum Dmax distance, the types of defect points found are copper surface damage, copper surface multi-welding, copper slag and other defects; if the normal direction of the contour points of the test small image is If the contour point on the template small image is not found within the specified number of steps in the forward and reverse directions and its 8 neighborhoods, the type of defect point found is copper surface open circuit; the method on the contour point of the template small image If the contour points on the test small image are not found within the specified number of steps in the forward and reverse directions of the line direction and its 8 neighborhoods, the type of defect points found is copper surface short circuit and other defects.
CN201910107780.2A 2019-02-01 2019-02-01 A PCB surface detection method based on contour out-of-tolerance algorithm Active CN109829911B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910107780.2A CN109829911B (en) 2019-02-01 2019-02-01 A PCB surface detection method based on contour out-of-tolerance algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910107780.2A CN109829911B (en) 2019-02-01 2019-02-01 A PCB surface detection method based on contour out-of-tolerance algorithm

Publications (2)

Publication Number Publication Date
CN109829911A true CN109829911A (en) 2019-05-31
CN109829911B CN109829911B (en) 2020-09-29

Family

ID=66863419

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910107780.2A Active CN109829911B (en) 2019-02-01 2019-02-01 A PCB surface detection method based on contour out-of-tolerance algorithm

Country Status (1)

Country Link
CN (1) CN109829911B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110702002A (en) * 2019-07-04 2020-01-17 天津大学 A method for multi-layer synchronous measurement of curved light-transmitting parts
CN113433128A (en) * 2021-07-02 2021-09-24 南通海舟电子科技有限公司 Intelligent display screen system based on circuit board automated production
CN113838045A (en) * 2021-09-30 2021-12-24 佛山市南海区广工大数控装备协同创新研究院 PCB copper-clad circuit skeleton contour extraction method for improving spur removal algorithm
CN113870256A (en) * 2021-12-01 2021-12-31 成都数之联科技有限公司 PCB defect evaluation method, device, equipment and medium
CN113989312A (en) * 2021-11-10 2022-01-28 佛山市南海区广工大数控装备协同创新研究院 Irregular PCB contour matching method based on shape context characteristics
CN116503401A (en) * 2023-06-26 2023-07-28 成都数联云算科技有限公司 PCB (printed circuit board) connection board target detection method, device, equipment and medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090022406A1 (en) * 2007-07-20 2009-01-22 Asustek Computer Inc. Method for finding specific pattern and method for compensating image offset
CN103733223A (en) * 2011-08-04 2014-04-16 三菱电机株式会社 Method and system for determining defect of surface of model of object
CN106407502A (en) * 2016-08-19 2017-02-15 西安交通大学 Optimum matching-based blade section line profile parameter evaluation method
CN106651889A (en) * 2016-11-30 2017-05-10 太原科技大学 X-ray welding joint defect segmentation method and system
CN107798326A (en) * 2017-10-20 2018-03-13 华南理工大学 A Contour Vision Detection Algorithm
CN109003258A (en) * 2018-06-15 2018-12-14 广东工业大学 A kind of high-precision sub-pix circular pieces measurement method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090022406A1 (en) * 2007-07-20 2009-01-22 Asustek Computer Inc. Method for finding specific pattern and method for compensating image offset
CN103733223A (en) * 2011-08-04 2014-04-16 三菱电机株式会社 Method and system for determining defect of surface of model of object
CN106407502A (en) * 2016-08-19 2017-02-15 西安交通大学 Optimum matching-based blade section line profile parameter evaluation method
CN106651889A (en) * 2016-11-30 2017-05-10 太原科技大学 X-ray welding joint defect segmentation method and system
CN107798326A (en) * 2017-10-20 2018-03-13 华南理工大学 A Contour Vision Detection Algorithm
CN109003258A (en) * 2018-06-15 2018-12-14 广东工业大学 A kind of high-precision sub-pix circular pieces measurement method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
胡涛: "基于轮廓对比的PCB裸板缺陷检测算法研究", 《中国博士学位论文全文数据库信息科技辑》 *
郭联金 等: "基于亚像素的PCB表面质量检测", 《电子质量》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110702002A (en) * 2019-07-04 2020-01-17 天津大学 A method for multi-layer synchronous measurement of curved light-transmitting parts
CN113433128A (en) * 2021-07-02 2021-09-24 南通海舟电子科技有限公司 Intelligent display screen system based on circuit board automated production
CN113838045A (en) * 2021-09-30 2021-12-24 佛山市南海区广工大数控装备协同创新研究院 PCB copper-clad circuit skeleton contour extraction method for improving spur removal algorithm
CN113838045B (en) * 2021-09-30 2024-02-02 佛山市南海区广工大数控装备协同创新研究院 An improved bone spur removal algorithm for PCB copper-clad circuit skeleton outline extraction method
CN113989312A (en) * 2021-11-10 2022-01-28 佛山市南海区广工大数控装备协同创新研究院 Irregular PCB contour matching method based on shape context characteristics
CN113989312B (en) * 2021-11-10 2024-04-09 佛山市南海区广工大数控装备协同创新研究院 A method for irregular PCB board contour matching based on shape context features
CN113870256A (en) * 2021-12-01 2021-12-31 成都数之联科技有限公司 PCB defect evaluation method, device, equipment and medium
CN113870256B (en) * 2021-12-01 2022-02-11 成都数之联科技有限公司 PCB defect evaluation method, device, equipment and medium
CN116503401A (en) * 2023-06-26 2023-07-28 成都数联云算科技有限公司 PCB (printed circuit board) connection board target detection method, device, equipment and medium
CN116503401B (en) * 2023-06-26 2023-09-22 成都数联云算科技有限公司 PCB (printed circuit board) connection board target detection method, device, equipment and medium

Also Published As

Publication number Publication date
CN109829911B (en) 2020-09-29

Similar Documents

Publication Publication Date Title
CN109829911A (en) A kind of pcb board surface inspecting method based on the overproof algorithm of profile
CN109839385B (en) Self-adaptive PCB defect visual positioning detection and classification system
US11551341B2 (en) Method and device for automatically drawing structural cracks and precisely measuring widths thereof
CN108520274B (en) High-reflectivity surface defect detection method based on image processing and neural network classification
CN105335973B (en) Apply to the visual processing method of strip machining production line
CN115791822A (en) Visual detection algorithm and detection system for wafer surface defects
CN109767445B (en) A high-precision intelligent detection method for PCB defects
CN108596165B (en) Road traffic marking detection method and system based on unmanned plane low latitude Aerial Images
CN108520514B (en) Consistency detection method of printed circuit board electronic components based on computer vision
CN108510476B (en) Mobile phone screen circuit detection method based on machine vision
CN116012292B (en) A wafer appearance defect detection method based on machine vision
CN102032875A (en) A Method for Measuring the Thickness of Cable Sheath Based on Image Processing
CN109741325B (en) Intelligent detection method for wiring verticality
CN111640154A (en) A sub-pixel-level positioning method of vertical needle microplane based on microscopic vision
CN109086350B (en) A WiFi-based Hybrid Image Retrieval Method
CN115452845B (en) LED screen surface damage detection method based on machine vision
CN109934808A (en) A method for classifying PCB board defects based on image multi-shape normal gradient difference
CN110426395B (en) A kind of solar EL battery silicon wafer surface detection method and device
CN111986169A (en) Door and window detection method, system, terminal and medium
CN106815830B (en) Image defect detection method
CN114926415A (en) Steel rail surface detection method based on PCNN and deep learning
CN120031791B (en) Two-stage cutter surface defect detection method and system
CN119515825A (en) A method for detecting industrial glass defects based on Visionmaster
CN106645168A (en) Detection method for surface concave-convex defect of boom cylinder of crane
CN114882027B (en) Electronic equipment chip pin defect detection method and system

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20250803

Address after: 518000 Guangdong Province Shenzhen City Bao'an District Fuhai Street Xinhe Community Fugiao Third Area Phase II Factory Building C1 First Floor

Patentee after: Shenzhen Haokun Electronics Co.,Ltd.

Country or region after: China

Address before: 528225 4th floor, block a, Foshan hi tech think tank center, Nanhai hi tech Zone, Foshan City, Guangdong Province

Patentee before: FOSHAN NANHAI GUANGDONG TECHNOLOGY University CNC EQUIPMENT COOPERATIVE INNOVATION INSTITUTE

Country or region before: China

Patentee before: FOSHAN GUANGDONG TECHNOLOGY UNIVERSITY CNC EQUIPMENT TECHNOLOGY DEVELOPMENT Co.,Ltd.