Summary of the invention
In order to solve the above technological deficiency of the prior art and technical problem, the present invention provides a kind of surface mounting technologies
Steel mesh automatic image registration method, its object is to choose matching characteristic point automatically;And the randomness of steel mesh placement angle is mentioned
Reasonable usability methods are gone out;It joined internal automatic test matching effect and secondary registration.Thus existing steel mesh is solved to match
The technical problems such as quasi- and defect inspection method low efficiency, poor for applicability and not smart enoughization.
To achieve the above object, according to one aspect of the present invention, a kind of steel mesh image of surface mounting technology is provided
Autoegistration method, method includes the following steps:
(1) steel mesh design profile is obtained by steel mesh design document, seeks design profile minimum circumscribed rectangle, obtain rectangle four
The coordinate on a vertex and the length of rectangle;
(2) area and barycentric coodinates of all intercommunicating pores in design profile are extracted, and generates design point according to barycentric coodinates
System of battle formations picture;
(3) 4 design registration points successively are sought by 4 vertex of rectangle and design dot matrix image;
(4) finished product steel mesh high-contrast image is acquired, if finished product steel mesh is too big, the multiple topographies of steel mesh is acquired and carries out
Splicing forms complete steel mesh image, reuses iterative method and carries out bilinear interpolation sub-pix Threshold segmentation processing image;It seeks locating
Image-region minimum circumscribed rectangle and the coordinate on four vertex of rectangle and the length of rectangle are calculated after reason;
(5) area and barycentric coodinates in the steel mesh image connectivity hole after extraction process generates steel mesh by all barycentric coodinates
Dot matrix image;
(6) 4 the first registration points successively are sought by 4 vertex of rectangle and steel mesh dot matrix image;
(7) it is found respectively in steel mesh dot matrix image away from 4 nearest focus points of 4 the first registration points as the second registration
Point;
(8) 3 the first registration points for choosing 3 design registration points and corresponding position carry out affine transformation, and it is imitative to obtain feature
Matrix is penetrated, design profile is covered on steel mesh image after converting by affine matrix;
(9) autoregistration test is carried out to the design profile converted by affine matrix, judges whether to be registrated successfully, if
Then registration terminates;Otherwise the second registration point that failure registration point is changed to corresponding position is continued to be registrated.
Further, registration point finding process is divided into following sub-step in the step (3) and step (6):
(11) using a vertex of rectangle as the center of circle, with RdIt draws and justifies for radius, wherein Rd=kL, L are the length of rectangle, and k is
First radius multiple;The value range of k is 5% < k < 20%, preferably k=10%;
(12) round and dot matrix image intersection is asked, judges whether there is focus point in intersection, has, obtain the center of gravity in intersection
Coordinate, and execute step (34);It is no to then follow the steps (33);
(13) k=2k updates radius RdAnd circle is repainted, it executes step (32);
(14) distance for seeking all barycentric coodinates in rectangle vertex and intersection takes apart from the smallest barycentric coodinates as registration
Point.
Further, iterative method progress bilinear interpolation sub-pix Threshold segmentation processing image is specific in the step (4)
It is divided into following sub-step:
(41) each pixel of the transition portion between steel mesh display foreground and background is selected to carry out 10 × 10 interpolation;
(42) threshold value that steel mesh image is acquired using iterative method carries out Threshold segmentation to the steel mesh image after interpolation.
Further, autoregistration test is divided into following sub-step in the step (9):
(91) the connection hole area and barycentric coodinates for extracting design profile after affine matrix converts, are given birth to by all barycentric coodinates
At registration dot matrix image;
(92) using 3 selected the first registration points one of them as the center of circle, with RcIt draws and justifies for radius, wherein Rc=jl, j are
Second radius multiple;The value range of j is 1% < j < 10%, preferably j=3%;L is lie farthest away in 4 the first registration points
The distance between two registration points;The focus point coordinate in circle and registration dot matrix image intersection is acquired, the first intersection point set is denoted as
It closes;The focus point coordinate in round and steel mesh dot matrix image intersection is acquired, the second intersection point set is denoted as;
(93) successively compare in the first intersection point set internal coordinate point and the second intersection point set corresponding position coordinate points it
Between distance, distance be greater than maximum allowable offset coordinate points be denoted as registration failed point, if registration failed point number be greater than match
Quasi- threshold value, then current the first registration point as the center of circle of judgement is registrated failure, and is denoted as unsuccessfully registration point;Otherwise judgement is current makees
It is registrated successfully for first registration point in the center of circle;Wherein, registration threshold value value range is intersection point set internal coordinate point sum
30% to 50%, preferably the 40% of intersection point set internal coordinate point sum;The value range of maximum allowable offset arrives for 50um
150um, preferably 100um;
(94) it repeats step (92) and (93) first registration point selected by 3 and all completes autoregistration to test, if 3 institutes
It selects the first registration point to be all registrated success, is then registrated success;Otherwise registration failure.
It is another aspect of this invention to provide that a kind of steel mesh automatic image registration system of surface mounting technology is provided, it should
System includes following part:
Design profile boundary rectangle extraction module is sought designing for obtaining steel mesh design profile by steel mesh design document
Profile minimum circumscribed rectangle obtains the coordinate on four vertex of rectangle and the length of rectangle;
Dot matrix image extraction module is designed, for extracting the area and barycentric coodinates of all intercommunicating pores in design profile, and
Design dot matrix image is generated according to barycentric coodinates;
Registration point extraction module is designed, for successively being sought 4 designs by 4 vertex of rectangle and design dot matrix image and being matched
On schedule;
Steel mesh image boundary rectangle extraction module, for acquiring finished product steel mesh high-contrast image, if finished product steel mesh is too big,
It then acquires the multiple topographies of steel mesh and carries out the complete steel mesh image of splicing composition, reuse iterative method and carry out bilinear interpolation Asia picture
Plain Threshold segmentation handles image;It seeks image-region minimum circumscribed rectangle after processing and calculates the coordinate and square on four vertex of rectangle
The length of shape;
Steel mesh dot matrix image extraction module, for the area and barycentric coodinates in the steel mesh image connectivity hole after extraction process,
Steel mesh dot matrix image is generated by all barycentric coodinates;
First registration point extraction module is matched for successively seeking 4 first by 4 vertex of rectangle and steel mesh dot matrix image
On schedule;
Second registration point extraction module, for found respectively in steel mesh dot matrix image away from 4 the first registration points it is nearest 4
A focus point is as the second registration point;
Registration module, 3 the first registration points for choosing 3 design registration points and corresponding position carry out affine transformation,
Feature affine matrix is obtained, design profile is covered on steel mesh image after converting by affine matrix;
It is registrated test module, for carrying out autoregistration test to the design profile converted by affine matrix, judgement is
It is no to be registrated successfully, if then registration terminates;Otherwise the second registration point that failure registration point is changed to corresponding position is continued to be registrated.
Further, registration point finding process point in the design registration point extraction module and the first registration point extraction module
For following submodule:
Dumpling made of glutinous rice flour module is drawn, for a vertex using rectangle as the center of circle, with RdIt draws and justifies for radius, wherein Rd=kL, L are square
The length of shape, k are the first radius multiple;The value range of k is 5% < k < 20%, preferably k=10%;
Seek common ground submodule, for asking the intersection of round and dot matrix image, judges whether there is focus point in intersection, has, obtain
Barycentric coodinates in intersection, and execute step (34);It is no to then follow the steps (33);
Dumpling made of glutinous rice flour module is updated, for updating k=2k, updates radius RdAnd circle is repainted, it executes step (32);
Registration point submodule is sought, for seeking the distance of all barycentric coodinates in rectangle vertex and intersection, is taken apart from the smallest
Barycentric coodinates are as registration point.
Further, iterative method carries out bilinear interpolation sub-pix threshold value in the steel mesh image boundary rectangle extraction module
Dividing processing image is specifically divided into following submodule:
Interpolation submodule, for select the transition portion between steel mesh display foreground and background each pixel carry out 10 ×
10 interpolation;
Threshold segmentation submodule, for acquiring the threshold value of steel mesh image using iterative method, to the steel mesh image after interpolation into
Row threshold division.
Further, autoregistration test is divided into following submodule in the registration test module:
It is registrated dot matrix image and generates submodule, for extracting the connection hole area and again of design profile after affine matrix transformation
Heart coordinate generates registration dot matrix image by all barycentric coodinates;
Be registrated intersection submodule, for using 3 selected the first registration points one of them as the center of circle, with RcFor radius picture
Circle, wherein Rc=jl, j are the second radius multiple;The value range of j is 1% < j < 10%, preferably j=3%;L is 4 the
The distance between two registration points of lie farthest away in one registration point;The focus point acquired in circle and registration dot matrix image intersection is sat
Mark, is denoted as the first intersection point set;The focus point coordinate in round and steel mesh dot matrix image intersection is acquired, the second intersection point set is denoted as
It closes;
Registration point judging submodule, for successively comparing in the first intersection point set internal coordinate point and the second intersection point set
The distance between corresponding position coordinate points, the coordinate points that distance is greater than maximum allowable offset are denoted as registration failed point, if registration loses
The number lost a little is greater than registration threshold value, then current the first registration point as the center of circle of judgement is registrated failure, and is denoted as and is unsuccessfully registrated
Point;Otherwise current the first registration point as the center of circle of judgement is registrated successfully;Wherein, registration threshold value value range is all intersection points
30% to the 50% of sum, the 40% of preferably all intersection point sums;The value range of maximum allowable offset arrives for 50um
150um, preferably 100um;
It is registrated judging submodule, for repeating step registration intersection submodule and registration point judging submodule until 3 institutes
It selects the first registration point all to complete autoregistration test, if the first registration point selected by 3 is all registrated success, is registrated success;Otherwise
Registration failure.
In general, through the invention it is contemplated above technical scheme is compared with the prior art, have following technology special
Sign and the utility model has the advantages that
(1) minimum circumscribed rectangle using figure of the invention can with arbitrary placement position and angle phase
The variation answered, but registration features point and the constant property feature of the absolute minimum range in rectangle vertex, can effectively solve arbitrarily to revolve
Turn the influence to registration effect.
(2) dividing between image and image with operation and the automatic search range that increases cleverly is utilized in the present invention
Characteristic area greatly reduces the calculation amount and complexity for finding characteristic point.By using iterative method selected threshold and bilinearity
The segmentation of interpolation sub-pix ensure that the precision and detection accuracy later of registration.It can be than classics under the premise of guaranteeing accuracy
Sub-pixel Edge Detection faster completes contours extract.
(3) technical solution of the present invention in view of practical steel mesh in process there may be stretch and heating power deformation with
Other influences for being difficult to expect, by testing the mechanism with adjust automatically registration point and secondary registration automatically, compared to existing
Technology registration has higher success rate.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.As long as in addition, technical characteristic involved in the various embodiments of the present invention described below
Not constituting a conflict with each other can be combined with each other.
As shown in Figure 1, the method for the present invention process is as follows:
(1) it reads steel mesh and processes Gerber file, the information such as parsing hole site, shape size obtain steel mesh contour vector text
Part is simultaneously shown as shown in Figure 2;
It seeks the minimum circumscribed rectangle of entire file area and rectangle upper left, upper right, lower-left, the top of bottom right four is calculated
The coordinate of point and the length of rectangle, as shown in rectangle frame in Fig. 2 and 4 dots.The step of seeking the minimum circumscribed rectangle of image are as follows:
Successively each column of scan image find the starting point coordinate (x1, y1) of each column target and terminal point coordinate (x2, y2) obtains in this column
Barycentric coodinates be (x, y), calculate each column barycentric coodinates (xi, yi) using least square method carry out straight line fitting obtain horizontal master
Axis linear equation y=k1x+b1.Row center of gravity and vertical major y=k2x+b2 similarly are asked to each row.Real center of gravity is horizontal main
The intersection point of axis and vertical major.The constant downward translation in horizontal spindle direction is kept to find whether straight line intersects with target, last
Lower boundary of the linear position of secondary intersection as boundary rectangle.It similarly can be in the hope of the upper and right boundary of boundary rectangle as just
Beginning boundary rectangle.Then initial rectangular is rotated by certain direction of rotation and rotation angle interval, finds the smallest external square of area
Shape is as preferred target.The mutually perpendicular four edges of rectangle are indicated with linear equation, and the intersection point of straight line is then external square
4 vertex of shape.
(2) intercommunicating pore is extracted according to the method for seeking center of gravity in step (1) to all connection bore regions of design profile file
Area and center of gravity coordinate, and barycentric coodinates point generate a width design dot chart, as the dot in Fig. 3 show design
Dot chart.
(3) using 4 vertex of rectangle as the center of circle, radius initial value is 10% long picture circle of rectangle, asks friendship with design dot chart
Collection, and obtain the point of the barycentric coodinates in intersection.If one times of radius of circle automatic increase, duplicate picture circle asks friendship without intersection
Collection is until having focus point in intersection.Barycentric coodinates are sought in intersection at a distance from current rectangle vertex, and take minimum range
Corresponding coordinate points are a registration features point.4 registration points nearest with 4 vertex distances of rectangle are obtained, design is denoted as
Registration point.As shown in figure 3, quadrant is the circle drawn using top left corner apex as the center of circle, cross corresponding point in figure
For with top left corner apex apart from nearest registration point.
(4) bilinear interpolation sub-pix threshold value point is carried out using iterative method to the high contrast steel mesh image that acquisition has been spliced
It cuts as shown in Figure 4.The transition portion between steel mesh display foreground and background is selected to carry out interpolation.Thus each pixel is carried out
The interpolation of 10*10 carries out Threshold segmentation to the image after interpolation using the calculated threshold value of iterative method.Seek whole image region
The length of interior minimum circumscribed rectangle and coordinate and rectangle that four vertex of rectangle are calculated.Such as rectangle frame in Fig. 5 and 4 dots
It is shown,
(5) coordinate of the area to the image zooming-out hole after the segmentation of steel mesh sub-pix and center of gravity, all barycentric coodinates points
The image for generating a width dot matrix, is denoted as steel mesh dot chart, as shown in Fig. 6 dot.
(6) 4 vertex of image boundary rectangle are the center of circle, and radius initial value is 10% long picture circle of rectangle, with steel mesh dot matrix
Figure seeks common ground, and obtains the point of the barycentric coodinates in intersection.If without intersection, one times of radius of circle automatic increase, duplicate picture
Circle seeks common ground until having intersection.Barycentric coodinates are sought in intersection at a distance from current rectangle vertex, and take minimum range institute
Corresponding coordinate points are a registration features point.Obtain 4 first registration points nearest with 4 vertex distances of rectangle.In Fig. 6
The corresponding point of cross is with top left corner apex apart from nearest registration point.Steel mesh is put in the presence of randomness, and angle tilt is difficult to
Avoid, the minimum circumscribed rectangle of image also can with the inclined degree put corresponding change, but most with rectangle vertex distance
What the absolute property of small feature focus point was no variation in, thus the method can be adapted for the random inclination of placement angle.
(7) consider steel mesh during cutting processing as the number of open cell content and closeness increase can be cold due to heat expansion
Contracting and stretching cause a degree of deformation of global shape.If having neighbor point and rectangle vertex distance near the first registration point
It is very close with the first registration point minimum range, then it is backed up using neighbor point as potential interference point, as possible second
Registration point.Conduct potential interference point as circle is irised out in Fig. 6 is backed up.
(8) coordinate for finding out 3 the first registration points of 3 design registration points and corresponding position carries out affine transformation, obtains
Feature affine matrix.Design profile file by affine matrix convert after displacement, rotation angle and scaling all with steel mesh figure
As consistent and coordinate unification.
(9) registration result is tested automatically.To the face of the design profile file drawing holes after step (8) affine transformation
Long-pending and center of gravity coordinate, generates all barycentric coodinates points the image of the new dot matrix of one width, is denoted as registration dot chart.With step
(8) 3 selected the first registration points are the center of circle in, and a length of radius of 3% rectangle bevel edge draws circle, acquire circle and registration dot matrix image
Focus point coordinate in intersection is denoted as the first intersection point set;The focus point coordinate in round and steel mesh dot matrix image intersection is acquired,
It is denoted as the second intersection point set;Corresponding position in the first intersection point set internal coordinate point and the second intersection point set is successively compared to sit
The distance between punctuate, coordinate points of the distance greater than 100um are denoted as registration failed point, if the number of registration failed point is greater than intersection
The 40% of point set internal coordinate point sum, then current the first registration point as the center of circle of judgement is registrated failure, and is denoted as failure and matches
On schedule;Otherwise current the first registration point as the center of circle of judgement is registrated successfully;First registration point selected by 3 all completes autoregistration
After test, if the first registration point selected by 3 is all registrated success, it is registrated success, as shown in Figure 8;If failure, as shown in fig. 7,
First registration point of registration failure is changed to after the second registration point repeatedly autoregistration and tested and continues to be registrated.Images after registration office
Portion is as shown in figure 9, obviously can see that steel mesh makes defect by registration result.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention
Made any modifications, equivalent replacements, and improvements etc., should all be included in the protection scope of the present invention within mind and principle.