CN104990926B - A kind of TR elements positioning of view-based access control model and defect inspection method - Google Patents

A kind of TR elements positioning of view-based access control model and defect inspection method Download PDF

Info

Publication number
CN104990926B
CN104990926B CN201510357803.7A CN201510357803A CN104990926B CN 104990926 B CN104990926 B CN 104990926B CN 201510357803 A CN201510357803 A CN 201510357803A CN 104990926 B CN104990926 B CN 104990926B
Authority
CN
China
Prior art keywords
point set
pin
efficiency frontier
mrow
frontier point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510357803.7A
Other languages
Chinese (zh)
Other versions
CN104990926A (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.)
Ningbo Intelligent Equipment Research Institute Co., Ltd.
Original Assignee
Harbin Institute 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 Harbin Institute of Technology filed Critical Harbin Institute of Technology
Priority to CN201510357803.7A priority Critical patent/CN104990926B/en
Publication of CN104990926A publication Critical patent/CN104990926A/en
Application granted granted Critical
Publication of CN104990926B publication Critical patent/CN104990926B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

A kind of TR elements positioning of view-based access control model and defect inspection method, the present invention relates to TR elements vision positioning and visible detection method.The present invention solves have the problem of low human error, precision, poor real and result of calculation are to light sensitive in the prior art.The present invention is by binaryzation area image, extract external boundary point set, find efficiency frontier point set, find minimum enclosed rectangle, efficiency frontier point set is classified, bianry image affine transformation, TR component types check that efficiency frontier point set is classified and numbered again, it is fitted pin straight line, pin foot straight line is fitted, TR component details information is determined, checks what the steps such as the defect of TR component pins were realized, and include multinomial technology, wherein also include gray scale value filtering, the quick Contour extraction in 4 fields, dual-axis rotation method finds the innovative technologies such as minimum enclosed rectangle.Present invention is mainly applied to element positioning and detection field in visual system of chip mounter.

Description

A kind of TR elements positioning of view-based access control model and defect inspection method
Technical field
The present invention relates to the recognition methods of vision positioning and defects detection, the TR elements of more particularly to a kind of view-based access control model are determined Position and defect inspection method.
Background technology
With the development of electronic industry, requirement of the market to electronic product is more and more harsher, not only to reach miniaturization, light Quantify, be thinned, even more to reach automation in assembling production process.Therefore surface installation technique (SMT) arises at the historic moment simultaneously Fast development, and the equipment of wherein core the most is exactly chip mounter.One chip mounter quality of measurement is most important three indexs: The scope of component, placement speed and placement accuracy can be pasted.And between this, image recognition algorithm and flow are acknowledged as patch The key of piece machine vision system, the effective range of element recognizer, which directly affects chip mounter, can paste the scope of component, its Accuracy and speed also directly govern placement speed and placement accuracy.
Nowadays the chip mounter of China is just at the early-stage, far apart with foreign level, and the visual identity of slice component is calculated Patent in terms of method is few again, for TR elements, is even more the complete vision positioning of neither one and detection algorithm at present Deliver, this is very unfavorable for the development of China's electronic industry.
It is concentrated mainly on now for the vision research of surface mount elements among vision positioning and Symbol recognition, for paster member The defects detection of part is main or is measured by manual precision instrument, and this not only wastes practice, wastes manpower, have also been introduced More human errors, precision is very low.
Also there are many problems in the research of the vision positioning of nowadays surface mount elements, most of algorithms all have precision It is low, poor real, the problems such as result of calculation is to light sensitive.
The content of the invention
The invention aims to solve to have in the vision research now for surface mount elements human error, precision it is low, Poor real and result of calculation are to light sensitive problem, and a kind of TR elements positioning of the view-based access control model proposed and defects detection Method.
Above-mentioned goal of the invention is achieved through the following technical solutions:
Step 1: checking selected area image brightness;Stop checking and returning phase if image appearance is too light or too dark Answer error code;If bright spot number and the ratio always counted step 2 is gone to if interval [0.01,0.90];Wherein, selected region Pixel value is considered bright spot for 255 pixel in image, and selected areas image all pixels point number is designated as total points;When bright Count with the ratio always counted and to think that area image is too dark less than 0.01, when bright spot number and the ratio always counted are recognized more than 0.90 It is too bright for area image;
Step 2: carrying out two in the image of [0.01,0.90] to bright spot number in selected areas image and the ratio always counted Value, obtains binary image;Wherein, binary image includes being manually entered the binaryzation that fixed threshold binarization method is obtained Image and the binary image obtained using the maximum method of inter-class variance;
Step 3: carrying out external boundary extraction to the binary image obtained in step 2 using the maximum method of inter-class variance Operation, obtain the external boundary point set of binary image, be stored in two-dimensional points container 1;Wherein, the operation that external boundary is extracted is adopted Extraction operator is a kind of quick Contour extraction operator in 4 field, wherein, the description of the quick Contour extraction operator operator in 4 fields It is as follows:
P is pixel to be determined, and the position in its 4 field is respectively P1, P2, P3 and P4;When having in P1, P2, P3 and P4 One when being background pixel point, judges P as boundary pixel point, is traveled through with the quick Contour extraction operator in 4 fields and use inter-class variance The binary image that maximum method is obtained just obtains the i.e. binary image of border point set image of accurate single pixel width External boundary point set.
Screened Step 4: the external boundary point set in the two-dimensional points container 1 obtained to step 3 carries out gray value inspection Border point set afterwards, and the border point set after screening is pressed into a two-dimensional points container 2, it is designated as efficiency frontier point set;
Wherein, described step three China and foreign countries border point set carries out the specific of the border point set after gray value inspection is screened Process is:
(1) any one external boundary point set that step 3 is obtained is taken, if the points that external boundary point set is included are more than 10, is entered Row step (2);
(2) if the external boundary point set in step (1) has the external boundary point set for including or having nesting, it will include or embedding Connected region all pixels point pixel value between the external boundary point set of set is set to 255;If the external boundary point set in step (1) does not have Have and include or nested external boundary point set then border point set will include inside all pixels point pixel value and be set to 255 in addition;
(3) pixel value is drawn in an empty gray level image for 255 pixel, is designated as this external boundary point set Bianry image;
(4) pixel value is the number of 255 pixel in calculation procedure (3), is designated as s1;It will be manually entered in step 2 solid The bianry image for determining this external boundary point set of binary image that threshold binarization method obtains with being obtained in step (2) enters Row step-by-step and computing, obtain a new bianry image, calculate the pixel number that pixel value in new bianry image is 255, It is designated as s2;
(5) calculate s1/s2 value and s1/s2 values are less than to the border point set corresponding to 0.5 and delete;Repeat (1)~(5) straight All external boundary point sets are obtained in step 3 to taking, and all external boundary point sets stayed are pressed into a two-dimensional points appearance In device, that is, obtain effective border point set;
Step 5: the minimum enclosed rectangle of all efficiency frontier point sets is found, the minimum of all efficiency frontier point sets is outer Rectangle is connect as the rough minimum enclosed rectangle of element, and by the anglec of rotation of the minimum enclosed rectangle of all efficiency frontier point sets As the rough anglec of rotation α of TR elements, the centre coordinate of the minimum enclosed rectangle of all efficiency frontier point sets is used as TR elements Rough centre coordinate (x0,y0);
The method that the minimum enclosed rectangle of all efficiency frontier point sets of described searching is used is the rotation after a kind of optimization Turn goal method, concretely comprised the following steps referred to herein as dual-axis rotation method:
(1) horizontal spindle of all efficiency frontier point sets is found:Each row i of all efficiency frontier point sets is scanned successively, Find the starting point coordinate (x of each row efficient boundary point collectioni1,yi1) and terminal point coordinate (xi2,yi2), so as to calculate target in the i-th row Centre coordinate (x 'i,y′i):
It regard the centre coordinate of each row of all efficiency frontier point sets as one group of data (x 'i,y′i), utilize least square method Fitting a straight line is carried out, obtains representing the linear equation y=k of the horizontal spindle initial position of all efficiency frontier point sets1x+b1
Wherein, i=1,2 ..., N;k1For slope, b1For intercept;
(2) vertical major of all efficiency frontier point sets is found:Every a line j of all efficiency frontier point sets is scanned successively, Find the starting point coordinate (x of each row bound point setj1,yj1) and terminal point coordinate (xj2,yj2), so as to calculate in jth row in target Heart coordinate (x 'j,y′j):
It regard the centre coordinate of each row of this border point set as one group of data (x 'j,y′j), carried out using least square method straight Line is fitted, and obtains representing the linear equation x=k of the vertical major initial position of all efficiency frontier point sets2y+b2
Wherein, j=1,2 ..., M;k2For slope, b2For intercept;
(3) the initial minimum enclosed rectangle of all efficiency frontier point sets, referred to as initial minimum enclosed rectangle are asked for:Keep The horizontal spindle direction of all efficiency frontier point sets is constant, finds and linear equation y=k1x+b1It is parallel, and and efficient boundary point Two tangent straight line y=k of collection1x+b11And y=k1x+b12
Take i.e. k ' vertical with the horizontal spindle of efficiency frontier point set1=-1/k1And cross (x0,y0) vertical line y=k '1x+y0- k′1x0, find vertical line and two tangent straight line y=k ' of efficiency frontier point set1x+b′11With y=k '1x+b′12
According to four straight line y=k1x+b11, y=k1x+b12, y=k '1x+b′11With y=k '1x+b′12Intersection point just obtain Four summits of initial minimum enclosed rectangle;
Wherein, y=k1x+b11For the coboundary of initial minimum enclosed rectangle;Y=k1x+b12For initial minimum enclosed rectangle Lower boundary, y=k '1x+b′11For the left margin of initial minimum enclosed rectangle;Y=k '1x+b′12For initial minimum enclosed rectangle Right margin;
(4) demand perfection body efficiency frontier point set minimum enclosed rectangle:Around the horizontal spindle and entirety of all efficiency frontier point sets The intersection point rotation of the vertical major of efficiency frontier point set, anglec of rotation interval is taken as:From the level master of all efficiency frontier point sets Axle initial position starts, and gradually rotated acute angle gamma is overlapped to efficiency frontier point set vertical major initial position, in the anglec of rotation With △ θ=1 ° it is rotation steps each time in degree is interval, asking for postrotational entirety each time according to the method in step (3) has Imitate the minimum enclosed rectangle of border point set;And calculate the minimum enclosed rectangle area for all efficiency frontier point sets for rotating the t times Mt, draw out MtLine chart is observed;T=1,2 ..., [γ];[γ] is γ integer part;
(5) if the area M that step (4) is obtainedtMore than area M1,M2,...,Mt-11.1 times of middle minimum value, or effectively The position slope rotated to of boundary point collection horizontal spindle is more than or equal to the slope of efficiency frontier point set vertical major;Then reach End condition, reach end condition terminate after, by the rotation steps in step (4) be changed into △ θ=0.1 ° repeat step (4)~ (5) △ θ≤0.001 °, to the last and untill meeting above end condition;
Step 6: obtaining the centre coordinate (x for each efficiency frontier point set that step 4 is obtainedi,yi), i=1,2 ..., N;Wherein, the centre coordinate (x of each efficiency frontier point seti,yi) be specially:
When point (x, y) is on efficiency frontier point set, f (x, y)=1;Otherwise f (x, y)=0;I=1,2 ..., N;N is represented There is N number of border point set;
Step 7: the efficiency frontier point set that step 4 is obtained is divided into TR member upper efficiency frontier point sets and TR according to α Two groups of element lower portions efficiency frontier point set;
Step 8: TR member upper efficiency frontiers point set, bottom efficiency frontier point set and step 6 that step 7 is obtained The center of each obtained efficiency frontier point set carries out affine transformation according to the rough anglec of rotation α of element and become a full member;Simultaneously will Rough centre coordinate (x0,y0) become a full member as (x '0,y′0);
Step 9: being detected to TR component types;If TR component types are standard TR types, continue step 10;It is no Then, stop and return to corresponding error code;
Step 10: by the TR member upper efficiency frontier point sets and bottom efficiency frontier point set of step 7 according to belonging to pin Relation classify obtaining the efficiency frontier point set of the first subseries, and the efficiency frontier point set of the first subseries is compiled Number;
Step 11: the efficiency frontier point set of the first subseries obtained to step 10 carries out the foot and root of same pin The classification of portion's efficiency frontier point set, determines the relation of pin-foot-root;And set up in three containers, three containers One conventional pin efficiency frontier point set of container storage and conventional pin efficiency frontier point set numbering, second container storage are conventional Pin foot efficiency frontier point set and conventional pin foot efficiency frontier point set numbering, it is effective that the 3rd container deposits special pin Border point set and special pin efficiency frontier point set numbering;
Step 12: asking for the center point set of conventional pin efficiency frontier point set in first container in step 11 respectively Center point set with conventional pin foot efficiency frontier point set in second container is:
The center point set of the conventional pin efficiency frontier point set in top is stored in the conventional pin central point container in top;
The center point set of the conventional pin foot efficiency frontier point set in top is stored in the conventional pin foot central point in top In container;
The center point set of the conventional pin efficiency frontier point set in bottom is stored in the conventional pin central point container in bottom;
The center point set of the conventional pin foot efficiency frontier point set in bottom is stored in the conventional pin foot central point in bottom In container;
Step 13: to the center point set and conventional pin foot efficiency frontier point set of conventional pin efficiency frontier point set Center point set carries out least square fitting linear operating, obtains four straight lines, remembers that the conventional pin of TR element lower portions is effective respectively The conventional pin efficiency frontier point set fitting a straight line Line_ of border point set fitting a straight line Line_downpin, TR member upper Uppin, TR element lower portions routine pin foot efficiency frontier point set fitting a straight line Line_downfoot and TR member upper are conventional Pin foot efficiency frontier point set fitting a straight line Line_upfoot;
Step 14: the efficiency frontier point set in three containers obtained according to step 11 determines that TR member uppers are effective Pin average length hpin_up, the effective pin average length h of TR element lower portionspin_down, the effective pin foot of TR member uppers be averaged Length hfoot_up, the effective pin foot average length h of TR element lower portionsfoot_down, the effective pin number s of TR member upperspin_up With the effective pin number s of TR element lower portionspin_down
Step 15: what the efficiency frontier point set and step 13 in three containers obtained according to step 11 were obtained The top accurate mean breadth w of effective pin foot that four straight lines ask for TR elementsfoot_up, TR elements bottom effective pin essence True mean breadth wpin_down, TR elements the accurate spacing p of the effective pin in toppin_up, TR elements the effective pin in bottom it is accurate between Away from ppin_down, TR element true center coordinates (xa,ya), the accurate anglec of rotation α of TR elementsa, TR element strict widths wbodyAnd TR Element precise length hbody
Step 16: checking the defect of TR component pins:
(1) check whether TR component pins bend:Each minimum enclosed rectangle obtained in step 5 is rotated The inspection of angle, the minimum enclosed rectangle anglec of rotation of i-th of pin of note is βi, when | αai| TR component pins are thought when≤5 Normally, do not bend;When | αai|>Think that i-th of pin anglec of rotation is excessive when 5, be bending pin;
(2) check whether TR component pins are symmetrical:Ask for TR member uppers routine pin border point set in step 11 Central point collection center G0, the conventional pin border point set of TR element lower portions central point collection center G1, the special pin edge of TR member uppers The central point collection center G of boundary's point set2With the center G of the center point set of the special pin border point set of TR element lower portions3;Judge G0、 G1、G2And G3This four points arrived TR element true centers (xa,ya) and parallel to the vertical of the accurate minimum enclosed rectangle of TR elements The distance of the straight line of main shaft, as distance respectively less than wbodyThink that symmetry meets the requirements when/20, otherwise return to symmetry and do not meet It is required that error code;Complete the recognition methods of a kind of TR elements vision positioning and defects detection.
Invention effect
The present invention is even more in operation while the vision positioning of chip TR elements and defects of vision detection function is realized The high level of a comparison is reached in speed and repeatable accuracy.Shown according to retest result, the present invention is to selected example Average out to 20ms the time required to calculating once, the repeatable accuracys of identical lower 100 retests of external condition also reaches ± In 0.001mm, it is seen that a kind of positioning of the TR elements of this view-based access control model and defect inspection method no matter precision, real-time, stability It is all very high such as Figure 19.
Brief description of the drawings
Fig. 1 is selected 8 single channel area images that embodiment one is proposed;
Fig. 2 is the binary image figure of fixed threshold 150 that embodiment one is proposed
Fig. 3 is the Otsu binary images that embodiment one is proposed
Fig. 4 is the quick Boundary Extraction operator schematic diagram in 4 fields that embodiment one is proposed;
Fig. 5 is that the element found according to pin fitting a straight line the fitting minimum enclosed rectangle that embodiment ten is proposed shows It is intended to;
Fig. 6 is the boundary image after the gray value that embodiment one is proposed is checked;
Fig. 7 is the element minimum enclosed rectangle schematic diagram that embodiment one is proposed;
Fig. 8 is the border point set and its centre coordinate schematic diagram after the gray value that embodiment one is proposed is checked;
Fig. 9 be embodiment one propose efficiency frontier point set packet after upper and lower part border point set and its Center schematic diagram;
Figure 10 be embodiment one propose become a full member after border point set and its center schematic diagram;
Figure 11 is excessive back boundary point set and its center schematic diagram of becoming a full member of the anglec of rotation that embodiment one is proposed;
Figure 12 is the TR component pins-foot-root relation and numbering schematic diagram that embodiment one is proposed; Wherein, 0 is pin 0, and the coordinate in the corresponding x-axis direction of pin 0 is (x1,x2), the coordinate in the corresponding x-axis direction of pin 1 is (x3,x4); Border point set is foot or the profile of root;
Figure 13 be embodiment five propose become a full member after upper bound point set and its center schematic diagram;
Figure 14 be embodiment five propose become a full member after lower limits point set and its center schematic diagram;
Figure 15 is the border point set of the proposition of embodiment five according to the affiliated classification results schematic diagram of pin;Wherein, 0, 1,2 be the numbering of pin belonging to boundary point collection correspondence;
Figure 16 is the G that embodiment one is proposed0And G1Illustrate with the accurate minimum enclosed rectangle vertical major position of element Figure;
Figure 17 is Line_downpin the and Line_uppin schematic diagrames that embodiment one is proposed;
Figure 18 is Line_downfoot the and Line_upfoot schematic diagrames that embodiment one is proposed;
Figure 19 is the TR element vision positioning design sketch that embodiment one is proposed.
Embodiment
Embodiment one:A kind of TR elements positioning of view-based access control model of present embodiment and defect inspection method, tool Body is prepared according to following steps:
Step 1: checking selected area image (Fig. 1) brightness;Stop checking and returning if image appearance is too light or too dark Return corresponding error code;If bright spot number and the ratio always counted step 2 is gone to if interval [0.01,0.90];Wherein, it is selected Pixel value is considered bright spot for 255 pixel in area image, and selected areas image all pixels point number is designated as total points; When bright spot number with the ratio always counted thinks that area image is too dark less than 0.01, when bright spot number and the ratio always counted are more than 0.90 Then think that area image is too bright;
Step 2: carrying out two in the image of [0.01,0.90] to bright spot number in selected areas image and the ratio always counted Value, obtains binary image such as Fig. 2 and Fig. 3;Wherein, binary image is obtained including being manually entered fixed threshold binarization method To binary image and the binary image that is obtained using the maximum method (Otsu methods or Da-Jin algorithm) of inter-class variance;
Step 3: carrying out outside to the binary image (Fig. 3) obtained in step 2 using the maximum method of inter-class variance The operation that boundary is extracted, obtains the external boundary point set of binary image (Fig. 3), is stored in two-dimensional points container 1;Wherein, external boundary The extraction operator that the operation of extraction is used is a kind of quick Contour extraction operator in 4 field such as Fig. 4 (advantages:Relative to conventional one Rank differential operator such as Sobel operators, Prewitt operators etc. operand can be greatly reduced, so that algorithm speed also can be faster), Wherein, 4 fields quick Contour extraction operator operators is described as follows:
P is pixel to be determined, and the position in its 4 field is respectively P1, P2, P3 and P4;When having in P1, P2, P3 and P4 One be background pixel point when, P is judged as boundary pixel point, otherwise P is not boundary pixel point, with the quick Contour extraction in 4 fields Binary image Fig. 3 that operator traversal is obtained using the maximum method of inter-class variance just obtains the border of accurate single pixel width Point set image is the external boundary point set of binary image;
Screened Step 4: the external boundary point set in the two-dimensional points container 1 obtained to step 3 carries out gray value inspection Border point set afterwards, and the border point set after screening is pressed into a two-dimensional points container 2, it is designated as efficiency frontier point set;
Wherein, described step three China and foreign countries border point set carries out the specific of the border point set after gray value inspection is screened Process is:
(1) any one external boundary point set that step 3 is obtained is taken, if the points that external boundary point set is included are more than 10, is entered Row step (2), if the points that border point set is included directly remove this border point set less than or equal to 10;
(2) if the external boundary point set in step (1) has the external boundary point set for including or having nesting, it will include or embedding Connected region all pixels point pixel value between the external boundary point set of set is set to 255;If the external boundary point set in step (1) does not have Have and include or nested external boundary point set then border point set will include inside all pixels point pixel value and be set to 255 in addition;
(3) pixel value is drawn in an empty gray level image for 255 pixel, is designated as this external boundary point set Bianry image;
(4) pixel value is the number of 255 pixel in calculation procedure (3), is designated as s1;It will be manually entered in step 2 solid The bianry image for determining this external boundary point set of binary image that threshold binarization method obtains with being obtained in step (2) enters Row step-by-step and computing, obtain a new bianry image, calculate the pixel number that pixel value in new bianry image is 255, It is designated as s2;
(5) calculate s1/s2 value and s1/s2 values are less than to the border point set corresponding to 0.5 and delete;Repeat (1)~(5) straight All external boundary point sets are obtained in step 3 to taking, and all external boundary point sets stayed are pressed into a two-dimensional points appearance In device, that is, obtain effective border point set, such as Fig. 6;
Step (1)~(5) main purpose is that two categories below border point set is handled:One class is step 2 otsu two-values The excess edge point set that change process threshold value is produced when too low is, it is necessary to remove such border point set;It is another kind of be it is some exist include, Nest relation border point set is, it is necessary to which whether clearly such border point set is effective;
Step 5: the minimum enclosed rectangle of all efficiency frontier point sets is found, the minimum of all efficiency frontier point sets is outer Rectangle is connect as rough minimum enclosed rectangle such as Fig. 7 of element, and by the rotation of the minimum enclosed rectangle of all efficiency frontier point sets Gyration is used as the rough anglec of rotation α of TR elements, the centre coordinate conduct of the minimum enclosed rectangle of all efficiency frontier point sets Rough centre coordinate (the x of TR elements0,y0);
The method that the minimum enclosed rectangle of all efficiency frontier point sets of described searching is used is the rotation after a kind of optimization Turn goal method, referred to herein as dual-axis rotation method, (advantage:The method is compared with conventional target rotary process and summit Chain-Code-Method The affine transformation of required progress greatly reduces, and the angular range of rotation is also substantially reduced, and then speed is also just faster, also more Accurately;) concretely comprise the following steps:
(1) horizontal spindle of all efficiency frontier point sets is found:Each row i of all efficiency frontier point sets is scanned successively, Find the starting point coordinate (x of each row efficient boundary point collectioni1,yi1) and terminal point coordinate (xi2,yi2), so as to calculate target in the i-th row Centre coordinate (x 'i,y′i):
It regard the centre coordinate of each row of all efficiency frontier point sets as one group of data (x 'i,y′i), utilize least square method Fitting a straight line is carried out, obtains representing the linear equation y=k of the horizontal spindle initial position of all efficiency frontier point sets1x+b1
Wherein, i=1,2 ..., N;k1For slope, b1For intercept;
(2) vertical major of all efficiency frontier point sets is found:Similarly, each of all efficiency frontier point sets is scanned successively Row j, finds the starting point coordinate (x of each row bound point setj1,yj1) and terminal point coordinate (xj2,yj2), so as to calculate target in jth row Centre coordinate (x 'j,y′j):
It regard the centre coordinate of each row of this border point set as one group of data (x 'j,y′j), carried out using least square method straight Line is fitted, and obtains representing the linear equation x=k of the vertical major initial position of all efficiency frontier point sets2y+b2
Wherein, j=1,2 ..., M;k2For slope, b2For intercept;
(3) the initial minimum enclosed rectangle of all efficiency frontier point sets, referred to as initial minimum enclosed rectangle are asked for:Keep The horizontal spindle direction of all efficiency frontier point sets is constant, finds and linear equation y=k1x+b1It is parallel, and and efficient boundary point Two tangent straight line y=k of collection1x+b11And y=k1x+b12
Take i.e. k ' vertical with the horizontal spindle of efficiency frontier point set1=-1/k1And cross (x0,y0) vertical line y=k '1x+y0- k′1x0, find vertical line and two tangent straight line y=k ' of efficiency frontier point set1x+b′11With y=k '1x+b′12
According to four straight line y=k1x+b11, y=k1x+b12, y=k '1x+b′11With y=k '1x+b′12Intersection point just obtain Four summits of initial minimum enclosed rectangle, initial minimum enclosed rectangle center and initial minimum enclosed rectangle deflection angle information It can be obtained by this four summits;
Wherein, y=k1x+b11For the coboundary of initial minimum enclosed rectangle;Y=k1x+b12For initial minimum enclosed rectangle Lower boundary, y=k '1x+b′11For the left margin of initial minimum enclosed rectangle;Y=k '1x+b′12For initial minimum enclosed rectangle Right margin;
(4) demand perfection body efficiency frontier point set minimum enclosed rectangle:Around the horizontal spindle and entirety of all efficiency frontier point sets The intersection point rotation of the vertical major of efficiency frontier point set, anglec of rotation interval is taken as:From the level master of all efficiency frontier point sets Axle initial position starts, and gradually rotated acute angle gamma is overlapped to efficiency frontier point set vertical major initial position, in the anglec of rotation With △ θ=1 ° it is rotation steps each time in degree is interval, asking for postrotational entirety each time according to the method in step (3) has Imitate the minimum enclosed rectangle of border point set;And calculate the minimum enclosed rectangle area for all efficiency frontier point sets for rotating the t times Mt, draw out MtLine chart is observed;T=1,2 ..., [γ];[γ] is γ integer part;
(5) if the area M that step (4) is obtainedtMore than area M1,M2,...,Mt-11.1 times of middle minimum value, or effectively The position slope rotated to of boundary point collection horizontal spindle is more than or equal to the slope of efficiency frontier point set vertical major;Then reach End condition, reach end condition terminate after, by the rotation steps in step (4) be changed into △ θ=0.1 ° repeat step (4)~ (5) △ θ≤0.001 °, to the last and untill meeting above end condition;
Step 6: obtaining the centre coordinate (x for each efficiency frontier point set that step 4 is obtainedi,yi), i=1,2 ..., N, as shown in Figure 8;Wherein, the centre coordinate (x of each efficiency frontier point seti,yi) be specially:
When point (x, y) is on efficiency frontier point set, f (x, y)=1;Otherwise f (x, y)=0;I=1,2 ..., N;N is represented There is N number of border point set;
Step 7: the efficiency frontier point set that step 4 is obtained is divided into TR member upper efficiency frontier point sets and TR according to α Two groups of element lower portions efficiency frontier point set, such as Fig. 9;
Step 8: TR member upper efficiency frontiers point set, bottom efficiency frontier point set and step 6 that step 7 is obtained The center of each obtained efficiency frontier point set carries out affine transformation according to the rough anglec of rotation α of element and become a full member i.e. Fig. 9 turns Image such as Figure 10 after just, and record the corresponding relation for each front and rear efficiency frontier point set of becoming a full member;Rough center is sat simultaneously Mark (x0,y0) become a full member as (x '0,y′0);
Step 9: to prevent the TR elements anglec of rotation from, close to 90 degree situation such as Figure 11, being detected to TR component types; If TR component types are standard TR types, continue step 10;Otherwise, stop and return to corresponding error code;
Step 10: by the TR member upper efficiency frontier point sets and bottom efficiency frontier point set of step 7 according to belonging to pin Relation classify obtaining the efficiency frontier point set of the first subseries, and the efficiency frontier point set of the first subseries is compiled Number, the pin numbering mode of numbering as described in Figure 12;
Step 11: the efficiency frontier point set of the first subseries obtained to step 10 carries out the foot and root of same pin The classification of portion's efficiency frontier point set, determines that the relation of pin-foot-root is as shown in figure 12;And set up three containers, three The conventional pin efficiency frontier point set of first container storage and conventional pin efficiency frontier point set numbering, second appearance in individual container The conventional pin foot efficiency frontier point set of device storage and conventional pin foot efficiency frontier point set numbering, the 3rd container storage are special Different pin efficiency frontier point set and special pin efficiency frontier point set numbering;
Step 12: asking for the center point set of conventional pin efficiency frontier point set in first container in step 11 respectively With the center point set of conventional pin foot efficiency frontier point set in second container, i.e.,:
The center point set of the conventional pin efficiency frontier point set in top is stored in the conventional pin central point container in top;
The center point set of the conventional pin foot efficiency frontier point set in top is stored in the conventional pin foot central point in top In container;
The center point set of the conventional pin efficiency frontier point set in bottom is stored in the conventional pin central point container in bottom;
The center point set of the conventional pin foot efficiency frontier point set in bottom is stored in the conventional pin foot central point in bottom In container;
Step 13: to the center point set and conventional pin foot efficiency frontier point set of conventional pin efficiency frontier point set Center point set carries out least square fitting linear operating, obtains four straight lines (most four), remembers that TR element lower portions are normal respectively Advise the conventional pin efficiency frontier point set fitting a straight line of pin efficiency frontier point set fitting a straight line Line_downpin, TR member upper On Line_uppin, TR element lower portions routine pin foot efficiency frontier point set fitting a straight line Line_downfoot and TR element Portion routine pin foot efficiency frontier point set fitting a straight line Line_upfoot, Figure 17 are Line_downpin, Line_uppin, Figure 18 is Line_downfoot, Line_upfoot;
Step 14: the efficiency frontier point set in three containers obtained according to step 11 determines that TR member uppers are effective Pin average length hpin_up, the effective pin average length h of TR element lower portionspin_down, the effective pin foot of TR member uppers be averaged Length hfoot_up, the effective pin foot average length h of TR element lower portionsfoot_down, the effective pin number s of TR member upperspin_up With the effective pin number s of TR element lower portionspin_down
Step 15: what the efficiency frontier point set and step 13 in three containers obtained according to step 11 were obtained The top accurate mean breadth w of effective pin foot that four straight lines ask for TR elementsfoot_up, TR elements bottom effective pin essence True mean breadth wpin_down, TR elements the accurate spacing p of the effective pin in toppin_up, TR elements the effective pin in bottom it is accurate between Away from ppin_down, TR element true center coordinates (xa,ya), the accurate anglec of rotation α of TR elementsa, TR element strict widths wbodyAnd TR Element precise length hbody;So far the precise information everywhere of TR elements has been obtained, the vision positioning of TR elements is completed;
Step 16: checking the defect of TR component pins:
(1) check whether TR component pins bend:Each minimum enclosed rectangle obtained in step 5 is rotated The inspection of angle, the minimum enclosed rectangle anglec of rotation of i-th of pin of note is βi, when | αai| TR component pins are thought when≤5 Normally, do not bend;When | αai|>Think that i-th of pin anglec of rotation is excessive when 5, be bending pin;
(2) check whether TR component pins are symmetrical:Ask for TR member uppers routine pin border point set in step 11 Central point collection center G0, the conventional pin border point set of TR element lower portions central point collection center G1, the special pin edge of TR member uppers The central point collection center G of boundary's point set2With the center G of the center point set of the special pin border point set of TR element lower portions3;Judge G0、 G1、G2And G3This four points arrived TR element true centers (xa,ya) and parallel to the vertical of the accurate minimum enclosed rectangle of TR elements The straight line of main shaft such as Figure 16 distance, as distance respectively less than wbodyThink that symmetry meets the requirements, and otherwise returns to symmetry when/20 Undesirable error code;Complete the recognition methods of a kind of TR elements vision positioning and defects detection.
Present embodiment effect:
Present embodiment even more exists while the vision positioning of chip TR elements and defects of vision detection function is realized The high level of a comparison is reached in the speed of service and repeatable accuracy.Shown according to retest result, present embodiment is to institute Average out to 20ms the time required to choosing example calculation once, the repeatable accuracy of identical lower 100 retests of external condition also reaches Into ± 0.001mm, it is seen that a kind of positioning of the TR elements of this view-based access control model and defect inspection method no matter precision, real-time, surely It is qualitative all very high such as Figure 19.
Embodiment two:Present embodiment from unlike embodiment one:To selected areas in step 2 Bright spot number and the ratio always counted are [0.01,0.90 image carries out binaryzation, obtains binary image implementation method in image It is specially comprising two kinds:
The first is to be manually entered fixed threshold binarization method, and the pixel point value that will be more than or equal to input threshold value is all fixed For 255,0 will be set to less than the pixel point value of input threshold value, obtain being manually entered the two-value that fixed threshold binarization method is obtained Image such as Fig. 2;
Second is the maximum method (Otsu methods or Da-Jin algorithm) of inter-class variance, is obtained using the maximum side of inter-class variance The bianry image that method is obtained such as Fig. 3;
The method for being manually entered the obtained binary image of fixed threshold binarization method and using inter-class variance maximum is obtained The binary image arrived.Other steps and parameter are identical with embodiment one.
Embodiment three:Present embodiment from unlike embodiment one or two:Will according to α in step 7 The efficiency frontier point set that step 4 is obtained is divided into TR member upper efficiency frontier point sets and TR element lower portions efficiency frontiers point set two Group sorting technique be:
(1) if the rough anglec of rotation α of element that step 5 is obtained stops when outside positive and negative 30 degree, and the anglec of rotation is exported Excessive error code, if α is in the range of positive and negative 30 degree, carries out step (2);
(2) obtain pointing to the unit vector of TR element lower portions efficiency frontier point sets by the rough anglec of rotation α of TR elements
(3) with the rough center (x of TR elements0,y0) it is initial point, point to each the efficiency frontier point set obtained in step 6 Centre coordinate (xi,yi) obtain Vector Groups
By unit vectorWith Vector GroupsIn each vector make dot productWork as s<0 judges corresponding i-th Efficiency frontier point set is TR member upper efficiency frontier point sets;s>0 judges that corresponding i-th of border point set is that TR element lower portions have Imitate border point set;S=0 judges that center selection is wrong, stops and returns to corresponding error code.Other steps and parameter and specific reality Apply mode one or two identical.
Embodiment four:Unlike one of present embodiment and embodiment one to three:It is right in step 9 The method that TR component types are detected is:
(1) all effective edges after asking for each efficient boundary point collection center point set after becoming a full member in step 8 and becoming a full member The minimum enclosed rectangle of boundary's point set;
(2) the bottom efficient boundary point after asking for the central point of the top efficiency frontier point set after becoming a full member in (1) and becoming a full member The central point of collection;
(3) with (x '0,y′0) centered on, with 1/8 of minimum enclosed rectangle length in (1) for x-axis direction length value, with (1) The 1/8 of middle minimum enclosed rectangle width is y directions length value, makees a rectangle, is designated as detecting rectangle;
(4) center of the bottom efficiency frontier point set after checking the central point of (2) middle and upper part efficiency frontier point set and becoming a full member Whether point is all in the detection rectangle that step (3) is obtained, and if thinking if, normally i.e. TR elements are standard TR types to TR elements, after Continuous next step;Think that the anglec of rotation is excessive if if not, stop and return to corresponding error code.Other steps and parameter with it is specific One of embodiment one to three is identical.
Embodiment five:Unlike one of present embodiment and embodiment one to four:It is right in step 10 The side that the TR member upper efficiency frontier point sets and bottom efficiency frontier point set of step 7 are classified according to pin belonging relation Method is specially:
(1) image is designated as TR member uppers image such as figure after TR member uppers efficiency frontier point set in step 8 is become a full member 13, and image is designated as TR element lower portions image such as Figure 14 after TR element lower portions efficiency frontier point sets are become a full member;
(2) TR member uppers image and TR element lower portions image are scanned along the x-axis direction respectively, are sequentially output TR members The corresponding x-axis coordinate { xup of pixel that part upper image pixel value is changed1,xup2,…,xupnAnd TR element lower portions images The corresponding x-axis coordinate { xdown of pixel that pixel value is changed1,xdown2,…,xdownn};
(3) interval in x-axis direction where the x-axis coordinate in step (2) determines pin, so that according to efficient boundary point The interval of x-axis direction where the x coordinate at collection center determines the corresponding pin of efficient boundary point collection, and efficiency frontier point set is pressed Mode according to pin numbering in Figure 12 is numbered, sorted efficiency frontier point set such as Figure 15, that is, has obtained the first subseries Efficiency frontier point set;Wherein, the interval in x-axis direction is [xup where i-th of pin of TR member uppers2i-1,xup2i], TR members The interval in x-axis direction is [xdown where the pin of i-th of part bottom2i-1,xdown2i].Other steps and parameter and specific implementation One of mode one to four is identical.
Embodiment six:Unlike one of present embodiment and embodiment one to five:In step 11 The foot of same pin is carried out to the efficiency frontier point set of the subseries of step 10 first and root efficiency frontier point set is classified, it is determined that The relation specific practice as shown in figure 12 of pin-foot-root is:
(1) there is the efficiency frontier point set of a certain numbering among the efficiency frontier point set for the first subseries that step 10 is obtained Number be 1 when, then it is assumed that the efficiency frontier point set of this numbering is a special pin efficiency frontier point set, by special pin Efficiency frontier point set and special pin efficiency frontier point set numbering are stored among the 3rd container;
(3) there is the efficiency frontier point set of a certain numbering among the efficiency frontier point set for the first subseries that step 10 is obtained Number when being more than 1, then it is assumed that it is a conventional pin that this numbering is corresponding, first carries out the efficiency frontier point set of this numbering The sequence of area, filters out two maximum efficiency frontier point sets of area;Then two maximum efficiency frontier point sets of area are this The conventional pin foot efficiency frontier point set of one numbering and the conventional pin root efficiency frontier point set of this numbering, according to same The conventional pin foot efficient boundary point collection center y-axis coordinate in the top of numbering is less than the conventional pin root efficiency frontier point set in top Center y-axis coordinate and the foot efficient boundary point collection center y-axis coordinate of lower leg are more than root efficient boundary point collection center y-axis Coordinate come judge this numbering conventional pin foot border point set and this numbering conventional pin root border point set as scheme 12;Conventional pin foot efficiency frontier point set and conventional pin foot efficiency frontier point set numbering second container of deposit are worked as In, the conventional pin foot of same numbering and root efficiency frontier point set and this numbering are stored among first container, from And determine the relation of pin-foot-root.Other steps and parameter are identical with one of embodiment one to five.
Embodiment seven:Unlike one of present embodiment and embodiment one to six:In step 12 Ask for respectively normal in the center point set and second container of conventional pin efficiency frontier point set in first container in step 11 Rule pin foot efficiency frontier point set center point set specific practice be:
(1) each conventional pin foot efficiency frontier point set among second container that step 11 is obtained is asked for Center;
(2) each conventional pin foot and root efficiency frontier among the first container that step 11 is obtained are asked for The center of point set;The way of thinking for asking for boundary point collection center is shown in step 6.Other steps and parameter and embodiment one It is identical to one of six.
Embodiment eight:Unlike one of present embodiment and embodiment one to seven:In step 13 The center point set of center point set and conventional pin foot efficiency frontier point set to conventional pin efficiency frontier point set carries out minimum Square law fitting a straight line is operated, and wherein least square fitting straight line is specially:
P1,P2,…,PNCentered on point set N number of discrete point, remember i-th of discrete point Pi=(xi,yi), fitting a straight line expression Formula y=ax+b, utilizes least square method, the quadratic sum of deviationMinimum, that is, solve
By a after arrangement, b separation is obtained
Wherein, center point set is the center point set or conventional pin foot efficient boundary point of conventional pin efficiency frontier point set The center point set of collection.Other steps and parameter are identical with one of embodiment one to seven.
Embodiment nine:Unlike one of present embodiment and embodiment one to eight:In step 14 Efficiency frontier point set in three containers obtained according to step 11 determines the effective pin average length of TR member uppers hpin_up, the effective pin average length h of TR element lower portionspin_down, the effective pin foot average length h of TR member uppersfoot_up、 The effective pin foot average length h of TR element lower portionsfoot_down, the effective pin number s of TR member upperspin_upWith TR element lower portions Effective pin number spin_downSpecific practice is:
(1) each conventional pin efficiency frontier of first container storage is asked for using the dual-axis rotation method in step 5 The minimum enclosed rectangle of the minimum enclosed rectangle of point set and each special pin efficiency frontier point set of the 3rd container storage;
(2) ask for second container using the dual-axis rotation method in step 5 and deposit conventional pin foot efficiency frontier point set Minimum enclosed rectangle;
(3) top for TR elements of (ignoring the special pin of TR member uppers) if conventional pin is arranged at the top of TR elements is normal Rule pin is effective pin;If TR elements think there is conventional pin in bottom, (ignoring the special pin of TR element lower portions) TR The conventional pin of the bottom of element is effective pin;
When TR member uppers only have special pin, then it is assumed that special pin is that the special pin of TR member uppers is effective Pin;It is the effective pin in bottom that special pin is thought when bottom only special pin;
(4) length value for asking for the minimum enclosed rectangle of the efficiency frontier point set of the effective pin of TR member uppers is averaged Value, it is determined as hpin_up;Similarly obtain the length value of the minimum enclosed rectangle of the efficiency frontier point set of the effective pin of TR element lower portions Average value hpin_down;The conventional effectively length value of the minimum enclosed rectangle of the efficiency frontier point set of pin foot of TR member uppers Average value hfoot_up;The conventional effectively length value of the minimum enclosed rectangle of the efficiency frontier point set of pin foot of TR element lower portions Average value hfoot_down;The minimum enclosed rectangle number of the efficiency frontier point set of the effective pin of TR member uppers is spin_up;TR members The minimum enclosed rectangle number of the efficiency frontier point set of the effective pin in part bottom is spin_down.Other steps and parameter and specific reality Apply one of mode one to eight identical.
Embodiment ten:Unlike one of present embodiment and embodiment one to nine:In step 15 Four straight lines that efficiency frontier point set and step 13 in three containers obtained according to step 11 are obtained ask for TR members The top accurate mean breadth w of effective pin foot of partfoot_up, TR elements the accurate mean breadth of the effective pin in bottom wpin_down, TR elements the accurate spacing p of the effective pin in toppin_up, TR elements the accurate spacing p of the effective pin in bottompin_down、 TR element true center coordinates (xa,ya), the accurate anglec of rotation α of TR elementsa, TR element strict widths wbodyIt is accurate with TR elements Length hbodySpecific practice is as follows:
1) when fitting a straight line Line_downpin and Line_uppin are not present in step 13, with step 14 The average value for calculating the minimum enclosed rectangle width of effective pin of TR member uppers is used as the effective pin foot of TR member uppers Accurate mean breadth wfoot_up=wpin_up;With the minimum enclosed rectangle for effective pin that TR element lower portions are calculated in step 14 The average value of width is used as the accurate mean breadth w of the effective pin foot of TR element lower portionsfoot_down=wpin_down;wpin_upFor TR members The accurate mean breadth of the effective pin in part top;wpin_downFor the accurate mean breadth of the effective pin of TR element lower portions;
2) in the presence of fitting a straight line Line_downpin or Line_uppin in step 13, obtain Line_uppin with The intersection point point set P of TR member uppers routine pin foot border point setup={ (x1,y1),(x2,y2),…,(x2N,y2N) and Line_downpin and the conventional pin foot border point set of TR element lower portions intersection point point set Pdown={ (x1,y1),(x2, y2),…,(x2M,y2M)};
(1) makeAs the width of i-th of pin foot of TR member uppers, ask for All effective pin widths average values of TR member uppers are used as the accurate mean breadth w of the effective pin foot of TR member uppersfoot_up, The accurate mean breadth w of the effective pin of TR member upperspin_up=wfoot_up;Wherein, i=1,2 ..., N;
(2) makeAs the width of i-th of pin foot of TR element lower portions, ask for All effective pin widths average values of TR element lower portions are used as the bottom accurate mean breadth w of effective pin footfoot_down, simultaneously The accurate mean breadth w of the effective pin of TR element lower portionspin_down=wfoot_down;I=1,2 ..., M
(3) makeIt is used as TR members I-th of part top and the spacing of i+1 pin, ask for dI~i+1Average value is used as the accurate average headway of the effective pin in top ppin_up;I=1,2 ..., N
OrderIt is used as TR elements I-th of bottom and the spacing of i+1 pin, ask for dI~i+1Between average value is accurately averaged as the effective pin of TR element lower portions Away from ppin_down;I=1,2 ..., M;
3) when fitting a straight line Line_downpin and Line_uppin are not present in step 13, i.e. TR member uppers When there was only special pin with TR element lower portions, it is believed that element central accurate coordinates (xa,ya)=(x0,y0), TR elements accurately rotate Angle [alpha]aThe strict width w of=α, TR elementbodyEqual to the rough minimum extraneous rectangle width of TR elements in step 5;TR elements Precise length hbodyEqual to the rough minimum enclosed rectangle length of TR elements in step 5;
4) when fitting a straight line Line_downpin or Line_uppin only exist one in step 13, by this straight line Slope obtain its anglec of rotation α1, it is believed that the accurate anglec of rotation of TR elementsAnd according to αaDo all effective The minimum enclosed rectangle of border point set is the Accurate Curve-fitting minimum enclosed rectangle of TR elements, minimum outer with the Accurate Curve-fitting of TR elements The center for connecing rectangle is the true center (x of TR elementsa,ya), the width using the Accurate Curve-fitting minimum enclosed rectangle of TR elements is TR The strict width w of elementbody;Using the length of the Accurate Curve-fitting minimum enclosed rectangle of TR elements as the length h of TR elementsbody
5) when in step 13 fitting a straight line Line_downpin and Line_uppin it is equal in the presence of, by Line_downpin Slope anglec of rotation α1, by Line_uppin slope anglec of rotation α2, the accurate anglec of rotation of TR elements
According to anglec of rotation αaDo the minimum enclosed rectangle of all efficiency frontier point sets, the minimum of all efficiency frontier point sets Boundary rectangle is Accurate Curve-fitting minimum enclosed rectangle such as Fig. 5 of TR elements, in the Accurate Curve-fitting minimum enclosed rectangle of TR elements The heart is the true center (x of elementa,ya),Using the width of the Accurate Curve-fitting minimum enclosed rectangle of TR elements as the accurate width of TR elements Spend wbody;Using the length of the Accurate Curve-fitting minimum enclosed rectangle of TR elements as the precise length h of TR elementsbody.Other steps and ginseng Number is identical with one of embodiment one to nine.

Claims (9)

1. a kind of TR elements positioning of view-based access control model and defect inspection method, it is characterised in that a kind of TR elements of view-based access control model are determined Position and defect inspection method are specifically what is followed the steps below:
Step 1: checking selected area image brightness;Stop checking and returning corresponding mistake if image appearance is too light or too dark Error code;If bright spot number and the ratio always counted step 2 is gone to if interval [0.01,0.90];Wherein, selected area image Middle pixel value is considered bright spot for 255 pixel, and selected areas image all pixels point number is designated as total points;When bright spot number Think that area image is too dark less than 0.01 with the ratio always counted, when bright spot number and the ratio always counted more than 0.90 think area Area image is too bright;
Step 2: the image to bright spot number in selected areas image and the ratio always counted in [0.01,0.90] carries out binaryzation, Obtain binary image;Wherein, binary image includes being manually entered the binary image that fixed threshold binarization method is obtained With the binary image obtained using the maximum method of inter-class variance;
Step 3: carrying out the behaviour of external boundary extraction to the binary image obtained in step 2 using the maximum method of inter-class variance Make, obtain the external boundary point set of binary image, be stored in two-dimensional points container 1;Wherein, what the operation that external boundary is extracted was used It is a kind of quick Contour extraction operator in 4 field to extract operator, wherein, the quick Contour extraction operator operator in 4 fields is described as follows:
P is pixel to be determined, and the position in its 4 field is respectively P1, P2, P3 and P4;When there is one in P1, P2, P3 and P4 During for background pixel point, P is judged as boundary pixel point, it is maximum using inter-class variance with the quick Contour extraction operator traversal in 4 fields The obtained binary image of method just obtain the border point set image i.e. outside of binary image of accurate single pixel width Boundary's point set;
Step 4: after the external boundary point set progress gray value inspection in the two-dimensional points container 1 obtained to step 3 is screened Border point set, and the border point set after screening is pressed into a two-dimensional points container 2, it is designated as efficiency frontier point set;
Wherein, described step three China and foreign countries border point set carries out the detailed process of the border point set after gray value inspection is screened For:
(1) any one external boundary point set that step 3 is obtained is taken, if the points that external boundary point set is included are more than 10, is walked Suddenly (2);
(2) if the external boundary point set in step (1) has the external boundary point set for including or having nesting, it will include or nested Connected region all pixels point pixel value between external boundary point set is set to 255;If the external boundary point set in step (1) is without interior Contain or nested external boundary point set then border point set will include inside all pixels point pixel value and be set to 255 in addition;
(3) pixel value is drawn in an empty gray level image for 255 pixel, is designated as the two-value of this external boundary point set Image;
(4) pixel value is the number of 255 pixel in calculation procedure (3), is designated as s1;Fixed threshold will be manually entered in step 2 The bianry image of this external boundary point set of binary image that value binarization method is obtained with being obtained in step (2) carry out by Position and computing, obtain a new bianry image, calculate the pixel number that pixel value in new bianry image is 255, are designated as s2;
(5) calculate s1/s2 value and s1/s2 values are less than to the border point set corresponding to 0.5 and delete;(1)~(5) are repeated until taking All external boundary point sets are obtained in step 3, and all external boundary point sets stayed are pressed into a two-dimensional points container In, that is, obtain effective border point set;
Step 5: the minimum enclosed rectangle of all efficiency frontier point sets is found, by the minimum external square of all efficiency frontier point sets Shape as element rough minimum enclosed rectangle, and using the anglec of rotation of the minimum enclosed rectangle of all efficiency frontier point sets as The rough anglec of rotation α of TR elements, the centre coordinate of the minimum enclosed rectangle of all efficiency frontier point sets is used as the thick of TR elements Slightly centre coordinate (x0,y0);
The method that the minimum enclosed rectangle of all efficiency frontier point sets of described searching is used is the rotation mesh after a kind of optimization Mark method, is concretely comprised the following steps referred to herein as dual-axis rotation method:
(1) horizontal spindle of all efficiency frontier point sets is found:Each row i of all efficiency frontier point sets is scanned successively, is found Starting point coordinate (the x of each row efficient boundary point collectioni1,yi1) and terminal point coordinate (xi2,yi2), so as to calculate in the i-th row in target Heart coordinate (x 'i,y′i):
<mrow> <msubsup> <mi>x</mi> <mi>i</mi> <mo>&amp;prime;</mo> </msubsup> <mo>=</mo> <mfrac> <mrow> <msub> <mi>x</mi> <mrow> <mi>i</mi> <mn>1</mn> </mrow> </msub> <mo>+</mo> <msub> <mi>x</mi> <mrow> <mi>i</mi> <mn>2</mn> </mrow> </msub> </mrow> <mn>2</mn> </mfrac> <mo>,</mo> <msubsup> <mi>y</mi> <mi>i</mi> <mo>&amp;prime;</mo> </msubsup> <mo>=</mo> <mfrac> <mrow> <msub> <mi>y</mi> <mrow> <mi>i</mi> <mn>1</mn> </mrow> </msub> <mo>+</mo> <msub> <mi>y</mi> <mrow> <mi>i</mi> <mn>2</mn> </mrow> </msub> </mrow> <mn>2</mn> </mfrac> <mo>,</mo> </mrow>
It regard the centre coordinate of each row of all efficiency frontier point sets as one group of data (x 'i,y′i), carried out using least square method Fitting a straight line, obtains representing the linear equation y=k of the horizontal spindle initial position of all efficiency frontier point sets1x+b1
Wherein, i=1,2 ..., N;k1For slope, b1For intercept;
(2) vertical major of all efficiency frontier point sets is found:Every a line j of all efficiency frontier point sets is scanned successively, is found Starting point coordinate (the x of each row bound point setj1,yj1) and terminal point coordinate (xj2,yj2), so that the center for calculating target in jth row is sat Mark (x 'j,y′j):
<mrow> <msub> <mi>x</mi> <mi>j</mi> </msub> <mo>=</mo> <mfrac> <mrow> <msub> <mi>x</mi> <mrow> <mi>j</mi> <mn>1</mn> </mrow> </msub> <mo>+</mo> <msub> <mi>x</mi> <mrow> <mi>j</mi> <mn>2</mn> </mrow> </msub> </mrow> <mn>2</mn> </mfrac> <mo>,</mo> <msubsup> <mi>y</mi> <mi>j</mi> <mo>&amp;prime;</mo> </msubsup> <mo>=</mo> <mfrac> <mrow> <msub> <mi>y</mi> <mrow> <mi>j</mi> <mn>1</mn> </mrow> </msub> <mo>+</mo> <msub> <mi>y</mi> <mrow> <mi>j</mi> <mn>2</mn> </mrow> </msub> </mrow> <mn>2</mn> </mfrac> </mrow>
It regard the centre coordinate of each row of this border point set as one group of data (x 'j,y′j), carry out straight line plan using least square method Close, obtain representing the linear equation x=k of the vertical major initial position of all efficiency frontier point sets2y+b2
Wherein, j=1,2 ..., M;k2For slope, b2For intercept;
(3) the initial minimum enclosed rectangle of all efficiency frontier point sets, referred to as initial minimum enclosed rectangle are asked for:Keep all The horizontal spindle direction of efficiency frontier point set is constant, finds and linear equation y=k1x+b1It is parallel, and with efficiency frontier point set phase The two straight line y=k cut1x+b11And y=k1x+b12
Take i.e. k ' vertical with the horizontal spindle of efficiency frontier point set1=-1/k1And cross (x0,y0) vertical line y=k '1x+y0-k′1x0, Find vertical line and two tangent straight line y=k ' of efficiency frontier point set1x+b′11With y=k '1x+b′12
According to four straight line y=k1x+b11, y=k1x+b12, y=k '1x+b′11With y=k '1x+b′12Intersection point just obtain initially Four summits of minimum enclosed rectangle;
Wherein, y=k1x+b11For the coboundary of initial minimum enclosed rectangle;Y=k1x+b12For under initial minimum enclosed rectangle Border, y=k '1x+b′11For the left margin of initial minimum enclosed rectangle;Y=k '1x+b′12For the right side of initial minimum enclosed rectangle Border;
(4) demand perfection body efficiency frontier point set minimum enclosed rectangle:Horizontal spindle and entirety around all efficiency frontier point sets is effective The intersection point rotation of the vertical major of border point set, anglec of rotation interval is taken as:At the beginning of the horizontal spindle of all efficiency frontier point sets Beginning, position started, and gradually rotated acute angle gamma was overlapped to efficiency frontier point set vertical major initial position, in anglec of rotation area Interior is rotation steps each time with △ θ=1 °, and all effective edges postrotational each time are asked for according to the method in step (3) The minimum enclosed rectangle of boundary's point set;And calculate the minimum enclosed rectangle area M for all efficiency frontier point sets for rotating the t timest, paint Make MtLine chart is observed;T=1,2 ..., [γ];[γ] is γ integer part;
(5) if the area M that step (4) is obtainedtMore than area M1,M2,...,Mt-11.1 times of middle minimum value, or efficiency frontier The position slope rotated to of point set horizontal spindle is more than or equal to the slope of efficiency frontier point set vertical major;Then reach termination Rotation steps in step (4) after reaching that end condition is terminated, are changed into △ θ=0.1 ° repeat step (4)~(5), directly by condition To last △ θ≤0.001 ° and untill meeting above end condition;
Step 6: obtaining the centre coordinate (x for each efficiency frontier point set that step 4 is obtainedi,yi), i=1,2 ..., N;Its In, the centre coordinate (x of each efficiency frontier point seti,yi) be specially:
<mrow> <msub> <mi>x</mi> <mi>i</mi> </msub> <mo>=</mo> <mfrac> <mrow> <munder> <mo>&amp;Sigma;</mo> <mi>x</mi> </munder> <munder> <mo>&amp;Sigma;</mo> <mi>y</mi> </munder> <mi>x</mi> <mi>f</mi> <mrow> <mo>(</mo> <mi>x</mi> <mo>,</mo> <mi>y</mi> <mo>)</mo> </mrow> </mrow> <mrow> <munder> <mo>&amp;Sigma;</mo> <mi>x</mi> </munder> <munder> <mo>&amp;Sigma;</mo> <mi>y</mi> </munder> <mi>f</mi> <mrow> <mo>(</mo> <mi>x</mi> <mo>,</mo> <mi>y</mi> <mo>)</mo> </mrow> </mrow> </mfrac> <mo>,</mo> <msub> <mi>y</mi> <mi>i</mi> </msub> <mo>=</mo> <mfrac> <mrow> <munder> <mo>&amp;Sigma;</mo> <mi>x</mi> </munder> <munder> <mo>&amp;Sigma;</mo> <mi>y</mi> </munder> <mi>y</mi> <mi>f</mi> <mrow> <mo>(</mo> <mi>x</mi> <mo>,</mo> <mi>y</mi> <mo>)</mo> </mrow> </mrow> <mrow> <munder> <mo>&amp;Sigma;</mo> <mi>x</mi> </munder> <munder> <mo>&amp;Sigma;</mo> <mi>y</mi> </munder> <mi>f</mi> <mrow> <mo>(</mo> <mi>x</mi> <mo>,</mo> <mi>y</mi> <mo>)</mo> </mrow> </mrow> </mfrac> </mrow>
When point (x, y) is on efficiency frontier point set, f (x, y)=1;Otherwise f (x, y)=0;I=1,2 ..., N;N, which is represented, N Individual border point set;
Step 7: the efficiency frontier point set that step 4 is obtained is divided into TR member upper efficiency frontier point sets and TR elements according to α Two groups of bottom efficiency frontier point set;
Step 8: TR member upper efficiency frontiers point set, bottom efficiency frontier point set and step 6 that step 7 is obtained are obtained To carry out affine transformation according to the rough anglec of rotation α of element be to become a full member the center of each efficiency frontier point set;Simultaneously will be rough Centre coordinate (x0,y0) become a full member as (x '0,y′0);
Step 9: being detected to TR component types;If TR component types are standard TR types, continue step 10;Otherwise, stop Only and return to corresponding error code;
Step 10: by the TR member upper efficiency frontier point sets and bottom efficiency frontier point set of step 7 according to pin belonging relation Progress, which is classified, obtains the efficiency frontier point set of the first subseries, and the efficiency frontier point set of the first subseries is numbered;
Step 11: the foot that the efficiency frontier point set of the first subseries obtained to step 10 carries out same pin has with root The classification of border point set is imitated, the relation of pin-foot-root is determined;And first is set up in three containers, three containers The conventional pin efficiency frontier point set of container storage and conventional pin efficiency frontier point set numbering, second conventional pin of container storage Foot efficiency frontier point set and conventional pin foot efficiency frontier point set numbering, the 3rd container deposit special pin efficiency frontier Point set and special pin efficiency frontier point set numbering;
Step 12: asking in step 11 in first container the center point set of conventional pin efficiency frontier point set and the respectively The center point set of conventional pin foot efficiency frontier point set is in two containers:
The center point set of the conventional pin efficiency frontier point set in top is stored in the conventional pin central point container in top;
The center point set of the conventional pin foot efficiency frontier point set in top is stored in the conventional pin foot central point container in top In;
The center point set of the conventional pin efficiency frontier point set in bottom is stored in the conventional pin central point container in bottom;
The center point set of the conventional pin foot efficiency frontier point set in bottom is stored in the conventional pin foot central point container in bottom In;
Step 13: the center of the center point set and conventional pin foot efficiency frontier point set to conventional pin efficiency frontier point set Point set carries out least square fitting linear operating, obtains four straight lines, and the conventional pin efficiency frontier of TR element lower portions is remembered respectively Point set fitting a straight line Line_downpin, TR member upper routine pin efficiency frontier point set fitting a straight line Line_uppin, TR Element lower portions routine pin foot efficiency frontier point set fitting a straight line Line_downfoot and TR member upper routine pin foot Efficiency frontier point set fitting a straight line Line_upfoot;
Step 14: the efficiency frontier point set in three containers obtained according to step 11 determines the effective pin of TR member uppers Average length hpin_up, the effective pin average length h of TR element lower portionspin_down, the effective pin foot average length of TR member uppers hfoot_up, the effective pin foot average length h of TR element lower portionsfoot_down, the effective pin number s of TR member upperspin_upAnd TR The effective pin number s of element lower portionspin_down
Step 15: four that the efficiency frontier point set and step 13 in three containers obtained according to step 11 are obtained Straight line asks for the top accurate mean breadth w of effective pin foot of TR elementsfoot_up, TR elements the effective pin in bottom accurately put down Equal width wpin_down, TR elements the accurate spacing p of the effective pin in toppin_up, TR elements the accurate spacing of the effective pin in bottom ppin_down, TR element true center coordinates (xa,ya), the accurate anglec of rotation α of TR elementsa, TR element strict widths wbodyWith TR members Part precise length hbody
Step 16: checking the defect of TR component pins:
(1) check whether TR component pins bend:The anglec of rotation is carried out to each minimum enclosed rectangle obtained in step 5 Inspection, note i-th of pin the minimum enclosed rectangle anglec of rotation be βi, when | αai| think that TR component pins are normal when≤5, Do not bend;When | αai|>Think that i-th of pin anglec of rotation is excessive when 5, be bending pin;
(2) check whether TR component pins are symmetrical:Ask for the center of TR member uppers routine pin border point set in step 11 Point set center G0, the conventional pin border point set of TR element lower portions central point collection center G1, the special pin boundary point of TR member uppers The central point collection center G of collection2With the center G of the center point set of the special pin border point set of TR element lower portions3;Judge G0、G1、G2With G3This four points arrived TR element true centers (xa,ya) and parallel to the vertical major of TR elements accurate minimum enclosed rectangles The distance of straight line, as distance respectively less than wbodyThink that symmetry meets the requirements when/20, otherwise return to symmetry undesirable Error code;Complete the recognition methods of a kind of TR elements vision positioning and defects detection.
2. a kind of TR elements of view-based access control model are positioned and defect inspection method according to claim 1, it is characterised in that:Step The efficiency frontier point set that step 4 is obtained is divided into by TR member upper efficiency frontier point sets according to α in seven and TR element lower portions are effective The sorting technique that two groups of border point set is:
(1) if the rough anglec of rotation α of element that step 5 is obtained stops when outside positive and negative 30 degree, and it is excessive to export the anglec of rotation Error code, if α is in the range of positive and negative 30 degree, carry out step (2);
(2) obtain pointing to the unit vector of TR element lower portions efficiency frontier point sets by the rough anglec of rotation α of TR elements
(3) with the rough center (x of TR elements0,y0) it is initial point, point in each the efficiency frontier point set obtained in step 6 Heart coordinate (xi,yi) obtain Vector Groups
By unit vectorWith Vector GroupsIn each vector make dot productWork as s<0 judge it is corresponding i-th it is effective Border point set is TR member upper efficiency frontier point sets;s>0 judges that corresponding i-th of border point set is TR element lower portions effective edges Boundary's point set;S=0 judges that center selection is wrong, stops and returns to corresponding error code.
3. a kind of TR elements of view-based access control model are positioned and defect inspection method according to claim 1, it is characterised in that:Step It is to the method that TR component types are detected in nine:
(1) all efficient boundary points after asking for each efficient boundary point collection center point set after becoming a full member in step 8 and becoming a full member The minimum enclosed rectangle of collection;
(2) central point of the top efficiency frontier point set after becoming a full member in (1) and the bottom efficiency frontier point set after becoming a full member are asked for Central point;
(3) with (x '0,y′0) centered on, with 1/8 of minimum enclosed rectangle length in (1) be x-axis direction length value, with (1) most The 1/8 of small boundary rectangle width is y directions length value, makees a rectangle, is designated as detecting rectangle;
(4) checking the central point of the central point of (2) middle and upper part efficiency frontier point set and the bottom efficiency frontier point set after becoming a full member is It is no all in the detection rectangle that step (3) is obtained, if think if TR elements normally i.e. TR elements be standard TR types, under continuation One step;If not existing, stop and return to corresponding error code.
4. a kind of TR elements of view-based access control model are positioned and defect inspection method according to claim 1, it is characterised in that:Step The TR member upper efficiency frontier point sets and bottom efficiency frontier point set of step 7 are divided according to pin belonging relation in ten The method of class is specially:
(1) image is designated as TR member upper images after TR member uppers efficiency frontier point set in step 8 is become a full member, and by TR Image is designated as TR element lower portions images after element lower portions efficiency frontier point set is become a full member;
(2) TR member uppers image and TR element lower portions image are scanned along the x-axis direction respectively, are sequentially output on TR elements The corresponding x-axis coordinate { xup of pixel that portion's image pixel value is changed1,xup2,…,xupnAnd TR element lower portions image pixels The corresponding x-axis coordinate { xdown of pixel that value is changed1,xdown2,…,xdownn};
(3) interval in x-axis direction where the x-axis coordinate in step (2) determines pin, so as to be concentrated according to efficient boundary point The interval of x-axis direction where the x coordinate of the heart determines the corresponding pin of efficient boundary point collection, and efficiency frontier point set is compiled Number;The efficiency frontier point set of the first subseries is obtained;Wherein, the interval in x-axis direction where i-th of pin of TR member uppers For [xup2i-1,xup2i], the interval in x-axis direction is [xdown where i-th of pin of TR element lower portions2i-1,xdown2i]。
5. a kind of TR elements of view-based access control model are positioned and defect inspection method according to claim 1, it is characterised in that:Step The foot and root efficiency frontier point set point of same pin are carried out to the efficiency frontier point set of the subseries of step 10 first in 11 Class, the relation specific practice for determining pin-foot-root is:
(1) there is of the efficiency frontier point set of a certain numbering among the efficiency frontier point set for the first subseries that step 10 is obtained When number is 1, then it is assumed that the efficiency frontier point set of this numbering is a special pin efficiency frontier point set, and special pin is effective Border point set and special pin efficiency frontier point set numbering are stored among the 3rd container;
(3) there is of the efficiency frontier point set of a certain numbering among the efficiency frontier point set for the first subseries that step 10 is obtained When number is more than 1, then it is assumed that this corresponding numbering is a conventional pin, first carries out the efficiency frontier point set area of this numbering Sequence, filter out two maximum efficiency frontier point sets of area;Then two maximum efficiency frontier point sets of area are this volume Number conventional pin foot efficiency frontier point set and this numbering conventional pin root efficiency frontier point set, according to same numbering The conventional pin foot efficient boundary point collection center y-axis coordinate in top be less than the conventional pin root in top efficient boundary point collection center Y-axis coordinate and the foot efficient boundary point collection center y-axis coordinate of lower leg are more than root efficient boundary point collection center y-axis coordinate To judge the conventional pin foot border point set of this numbering and the conventional pin root border point set of this numbering;To routinely it draw Among pin foot efficiency frontier point set and conventional pin foot efficiency frontier point set numbering second container of deposit, by same numbering Conventional pin foot and root efficiency frontier point set and this numbering deposit first container among, so that it is determined that determining to draw The relation of pin-foot-root.
6. a kind of TR elements of view-based access control model are positioned and defect inspection method according to claim 1, it is characterised in that:Step The center point set of conventional pin efficiency frontier point set and second appearance in first container are asked in step 11 in 12 respectively The center point set specific practice of conventional pin foot efficiency frontier point set is in device:
(1) ask in each conventional pin foot efficiency frontier point set among second container that step 11 is obtained The heart;
(2) each conventional pin foot and root efficiency frontier point set among the first container that step 11 is obtained are asked for Center.
7. a kind of TR elements of view-based access control model are positioned and defect inspection method according to claim 1, it is characterised in that:Step The center point set of conventional pin efficiency frontier point set and the center point set of conventional pin foot efficiency frontier point set are entered in 13 Row least square fitting linear operating, wherein least square fitting straight line is specially:
P1,P2,…,PNCentered on point set N number of discrete point, remember i-th of discrete point Pi=(xi,yi), fitting a straight line expression formula y= Ax+b, utilizes least square method, the quadratic sum of deviationMinimum, that is, solve
<mfenced open = '{' close = ''> <mtable> <mtr> <mtd> <mfrac> <mrow> <mo>&amp;part;</mo> <mi>M</mi> </mrow> <mrow> <mo>&amp;part;</mo> <mi>a</mi> </mrow> </mfrac> <mo>=</mo> <mo>-</mo> <mn>2</mn> <mstyle> <munderover> <mo>&amp;Sigma;</mo> <mrow> <mi>i</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>N</mi> </munderover> </mstyle> <mo>&amp;lsqb;</mo> <msub> <mi>y</mi> <mi>i</mi> </msub> <mo>-</mo> <mo>(</mo> <mi>a</mi> <msub> <mi>x</mi> <mi>i</mi> </msub> <mo>+</mo> <mi>b</mi> <mo>)</mo> <mo>&amp;rsqb;</mo> <msub> <mi>x</mi> <mi>i</mi> </msub> <mo>=</mo> <mn>0</mn> </mtd> </mtr> <mtr> <mtd> <mfrac> <mrow> <mo>&amp;part;</mo> <mi>M</mi> </mrow> <mrow> <mo>&amp;part;</mo> <mi>b</mi> </mrow> </mfrac> <mo>=</mo> <mo>-</mo> <mn>2</mn> <mstyle> <munderover> <mo>&amp;Sigma;</mo> <mrow> <mi>i</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>N</mi> </munderover> </mstyle> <mo>&amp;lsqb;</mo> <msub> <mi>y</mi> <mi>i</mi> </msub> <mo>-</mo> <mo>(</mo> <mi>a</mi> <msub> <mi>x</mi> <mi>i</mi> </msub> <mo>+</mo> <mi>b</mi> <mo>)</mo> <mo>&amp;rsqb;</mo> <mo>=</mo> <mn>0</mn> </mtd> </mtr> </mtable> </mfenced>
By a after arrangement, b separation is obtained
<mfenced open = '{' close = ''> <mtable> <mtr> <mtd> <mrow> <mi>a</mi> <mo>=</mo> <mfrac> <mrow> <munderover> <mi>&amp;Sigma;</mi> <mrow> <mi>i</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>N</mi> </munderover> <msub> <mi>x</mi> <mi>i</mi> </msub> <munderover> <mi>&amp;Sigma;</mi> <mrow> <mi>i</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>N</mi> </munderover> <msub> <mi>y</mi> <mi>i</mi> </msub> <mo>-</mo> <mi>N</mi> <munderover> <mi>&amp;Sigma;</mi> <mrow> <mi>i</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>N</mi> </munderover> <msub> <mi>x</mi> <mi>i</mi> </msub> <msub> <mi>y</mi> <mi>i</mi> </msub> </mrow> <mrow> <munderover> <mi>&amp;Sigma;</mi> <mrow> <mi>i</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>N</mi> </munderover> <msub> <mi>x</mi> <mi>i</mi> </msub> <munderover> <mi>&amp;Sigma;</mi> <mrow> <mi>i</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>N</mi> </munderover> <msub> <mi>x</mi> <mi>i</mi> </msub> <mo>-</mo> <mi>N</mi> <munderover> <mi>&amp;Sigma;</mi> <mrow> <mi>i</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>N</mi> </munderover> <msub> <mi>x</mi> <mi>i</mi> </msub> <msub> <mi>x</mi> <mi>i</mi> </msub> </mrow> </mfrac> </mrow> </mtd> </mtr> <mtr> <mtd> <mrow> <mi>b</mi> <mo>=</mo> <mfrac> <mrow> <munderover> <mi>&amp;Sigma;</mi> <mrow> <mi>i</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>N</mi> </munderover> <msub> <mi>y</mi> <mi>i</mi> </msub> <mo>-</mo> <mi>a</mi> <munderover> <mi>&amp;Sigma;</mi> <mrow> <mi>i</mi> <mo>=</mo> <mn>1</mn> </mrow> <mi>N</mi> </munderover> <msub> <mi>x</mi> <mi>i</mi> </msub> </mrow> <mi>N</mi> </mfrac> </mrow> </mtd> </mtr> </mtable> </mfenced>
Wherein, center point set is the center point set or conventional pin foot efficiency frontier point set of conventional pin efficiency frontier point set Center point set.
8. a kind of TR elements of view-based access control model are positioned and defect inspection method according to claim 1, it is characterised in that:Step Efficiency frontier point set in three containers obtained in 14 according to step 11 determines that the effective pin of TR member uppers is averagely long Spend hpin_up, the effective pin average length h of TR element lower portionspin_down, the effective pin foot average length of TR member uppers hfoot_up, the effective pin foot average length h of TR element lower portionsfoot_down, the effective pin number s of TR member upperspin_upAnd TR The effective pin number s of element lower portionspin_downSpecific practice is:
(1) each conventional pin efficiency frontier point set of first container storage is asked for using the dual-axis rotation method in step 5 Minimum enclosed rectangle and the storage of the 3rd container each special pin efficiency frontier point set minimum enclosed rectangle;
(2) ask for second container using the dual-axis rotation method in step 5 and deposit conventional pin foot efficiency frontier point set most Small boundary rectangle;
(3) the conventional pin on the top of TR elements is effective pin if conventional pin is arranged at the top of TR elements;If TR elements Think there is conventional pin in bottom, then the conventional pin of the bottom of TR elements is effective pin;
When TR member uppers only have special pin, then it is assumed that special pin is that the special pin of TR member uppers is effectively to draw Pin;It is the effective pin in bottom that special pin is thought when bottom only special pin;
(4) average value of the length value of the minimum enclosed rectangle of the efficiency frontier point set of the effective pin of TR member uppers is asked for, it is fixed For hpin_up;The length value for similarly obtaining the minimum enclosed rectangle of the efficiency frontier point set of the effective pin of TR element lower portions is averaged Value hpin_down;The TR member uppers conventional effectively length values of the minimum enclosed rectangle of the efficiency frontier point set of pin foot is averaged Value hfoot_up;The TR element lower portions conventional effectively length values of the minimum enclosed rectangle of the efficiency frontier point set of pin foot is averaged Value hfoot_down;The minimum enclosed rectangle number of the efficiency frontier point set of the effective pin of TR member uppers is spin_up;Under TR elements The minimum enclosed rectangle number of the efficiency frontier point set of the effective pin in portion is spin_down
9. a kind of TR elements of view-based access control model are positioned and defect inspection method according to claim 1, it is characterised in that:Step Four straight lines that efficiency frontier point set and step 13 in three containers obtained in 15 according to step 11 are obtained are asked Take the top accurate mean breadth w of effective pin foot of TR elementsfoot_up, TR elements the accurate mean breadth of the effective pin in bottom wpin_down, TR elements the accurate spacing p of the effective pin in toppin_up, TR elements the accurate spacing p of the effective pin in bottompin_down、 TR element true center coordinates (xa,ya), the accurate anglec of rotation α of TR elementsa, TR element strict widths wbodyIt is accurate with TR elements Length hbodySpecific practice is as follows:
1) when fitting a straight line Line_downpin and Line_uppin are not present in step 13, with step 14 (3) average value of minimum enclosed rectangle width of effective pin of TR member uppers is calculated as the effective pin foot of TR member uppers The accurate mean breadth w in portionfoot_up=wpin_up;The minimum that effective pin of TR element lower portions is calculated with (3) in step 14 is outer The average value of rectangle width is connect as the accurate mean breadth w of the effective pin foot of TR element lower portionsfoot_down=wpin_down;wpin_up For the accurate mean breadth of the effective pin of TR member uppers;wpin_downFor the accurate mean breadth of the effective pin of TR element lower portions;
2) in the presence of fitting a straight line Line_downpin or Line_uppin in step 13, Line_uppin and TR members are obtained The intersection point point set P of part top routine pin foot border point setup={ (x1,y1),(x2,y2),…,(x2N,y2N) and Line_ Downpin and the conventional pin foot border point set of TR element lower portions intersection point point set Pdown={ (x1,y1),(x2,y2),…, (x2M,y2M)};
(1) makeAs the width of i-th of pin foot of TR member uppers, TR members are asked for All effective pin widths average values in part top are used as the accurate mean breadth w of the effective pin foot of TR member uppersfoot_up, TR members The accurate mean breadth w of the effective pin in part toppin_up=wfoot_up;Wherein, i=1,2 ..., N;
(2) makeAs the width of i-th of pin foot of TR element lower portions, TR members are asked for All effective pin widths average values in part bottom are used as the bottom accurate mean breadth w of effective pin footfoot_down, while TR is first The accurate mean breadth w of the effective pin in part bottompin_down=wfoot_down;I=1,2 ..., M
(3) makeAs on TR elements I-th of portion and the spacing of i+1 pin, ask for dI~i+1Average value is used as the accurate average headway p of the effective pin in toppin_up;i =1,2 ..., N
OrderIt is used as TR element lower portions I-th and the spacing of i+1 pin, ask for dI~i+1Average value is used as the accurate average headway of the effective pin of TR element lower portions ppin_down;I=1,2 ..., M;
3) when fitting a straight line Line_downpin and Line_uppin are not present in step 13, i.e. TR member uppers and TR When element lower portions only have special pin, it is believed that element central accurate coordinates (xa,ya)=(x0,y0), the accurate anglec of rotation of TR elements αaThe strict width w of=α, TR elementbodyEqual to the rough minimum extraneous rectangle width of TR elements in step 5;The essence of TR elements True length hbodyEqual to the rough minimum enclosed rectangle length of TR elements in step 5;
4) when fitting a straight line Line_downpin or Line_uppin only exist one in step 13, by the oblique of this straight line Rate obtains its anglec of rotation α1, it is believed that the accurate anglec of rotation of TR elementsAnd according to αaDo all efficiency frontiers The minimum enclosed rectangle of point set is the Accurate Curve-fitting minimum enclosed rectangle of TR elements, with the minimum external square of the Accurate Curve-fitting of TR elements The center of shape is the true center (x of TR elementsa,ya), using the width of the Accurate Curve-fitting minimum enclosed rectangle of TR elements as TR elements Strict width wbody;Using the length of the Accurate Curve-fitting minimum enclosed rectangle of TR elements as the length h of TR elementsbody
5) when in step 13 fitting a straight line Line_downpin and Line_uppin it is equal in the presence of, by Line_downpin slopes Anglec of rotation α1, by Line_uppin slope anglec of rotation α2, the accurate anglec of rotation of TR elementsAccording to rotation Gyration αaThe minimum enclosed rectangle of all efficiency frontier point sets is done, the minimum enclosed rectangle of all efficiency frontier point sets is TR members The Accurate Curve-fitting minimum enclosed rectangle of part, the center of the Accurate Curve-fitting minimum enclosed rectangle of TR elements is the true center of element (xa,ya), using the width of the Accurate Curve-fitting minimum enclosed rectangle of TR elements as the strict width w of TR elementsbody;With TR elements The length of Accurate Curve-fitting minimum enclosed rectangle is the precise length h of TR elementsbody
CN201510357803.7A 2015-06-25 2015-06-25 A kind of TR elements positioning of view-based access control model and defect inspection method Active CN104990926B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510357803.7A CN104990926B (en) 2015-06-25 2015-06-25 A kind of TR elements positioning of view-based access control model and defect inspection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510357803.7A CN104990926B (en) 2015-06-25 2015-06-25 A kind of TR elements positioning of view-based access control model and defect inspection method

Publications (2)

Publication Number Publication Date
CN104990926A CN104990926A (en) 2015-10-21
CN104990926B true CN104990926B (en) 2017-09-29

Family

ID=54302765

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510357803.7A Active CN104990926B (en) 2015-06-25 2015-06-25 A kind of TR elements positioning of view-based access control model and defect inspection method

Country Status (1)

Country Link
CN (1) CN104990926B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105424714B (en) * 2015-12-21 2018-04-27 南京河豚自动化科技有限公司 The defects of based on multi-pipe pin detection device and its detection method
CN105910536A (en) * 2016-06-23 2016-08-31 王越 Image acquisition method in plug-in electronic component vision positioning
CN106981061A (en) * 2017-03-06 2017-07-25 深圳市恒茂科技有限公司 A kind of spot area detection method
CN107478152A (en) * 2017-08-11 2017-12-15 哈尔滨工业大学 TR chip positionings method and detection method
CN107452006A (en) * 2017-08-11 2017-12-08 哈尔滨工业大学 Chip component localization method based on coding camera lens
CN107945194A (en) * 2017-10-31 2018-04-20 四川长虹电器股份有限公司 Bill dividing method based on OpenCV technologies
CN107909613B (en) * 2017-11-14 2020-05-22 哈尔滨工业大学 Vertex-based rectangular pin element positioning method
CN113070229B (en) * 2019-03-14 2023-09-12 安徽天兵电子科技股份有限公司 Operation method of rotary detection tool for TR (transmitter-receiver) component
CN111062317A (en) * 2019-12-16 2020-04-24 中国计量大学上虞高等研究院有限公司 Method and system for cutting edges of scanned document
CN111553885B (en) * 2020-04-08 2021-07-06 哈尔滨工业大学 SOT type chip pin parameter detection method based on rollback tree
CN111784674A (en) * 2020-07-02 2020-10-16 深圳明锐理想科技有限公司 Component detection method, component detection device, computer equipment and storage medium
CN113781447B (en) * 2021-09-13 2022-06-10 常州市宏发纵横新材料科技股份有限公司 Weft yarn gap detection method and device based on carbon fibers and storage medium
CN113592868B (en) * 2021-09-29 2021-12-31 常州市宏发纵横新材料科技股份有限公司 Method for detecting black and gray of glass fiber cloth cover
CN114814991A (en) * 2022-06-28 2022-07-29 成都信息工程大学 Method and device for identifying spatial distribution area of meteorological element field
CN116030053B (en) * 2023-03-27 2023-06-16 中江立江电子有限公司 Connector pin defect detection method, device, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0823037B1 (en) * 1995-04-27 2003-08-27 General Scanning, Inc. Method and system for triangulation-based 3-d imaging utilizing an angled scanning beam of radiant energy
CN101936708A (en) * 2010-08-13 2011-01-05 河海大学常州校区 Method for positioning and detecting QFP (Quad Flat Package) chip
CN103745475A (en) * 2014-01-22 2014-04-23 哈尔滨工业大学 Detection and positioning method used for spherical pin element
CN103761534A (en) * 2014-01-22 2014-04-30 哈尔滨工业大学 Method for detecting vision localization of QFP element
CN104359402A (en) * 2014-11-17 2015-02-18 南京工业大学 Detection method for rectangular pin component visual positioning

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0823037B1 (en) * 1995-04-27 2003-08-27 General Scanning, Inc. Method and system for triangulation-based 3-d imaging utilizing an angled scanning beam of radiant energy
CN101936708A (en) * 2010-08-13 2011-01-05 河海大学常州校区 Method for positioning and detecting QFP (Quad Flat Package) chip
CN103745475A (en) * 2014-01-22 2014-04-23 哈尔滨工业大学 Detection and positioning method used for spherical pin element
CN103761534A (en) * 2014-01-22 2014-04-30 哈尔滨工业大学 Method for detecting vision localization of QFP element
CN104359402A (en) * 2014-11-17 2015-02-18 南京工业大学 Detection method for rectangular pin component visual positioning

Also Published As

Publication number Publication date
CN104990926A (en) 2015-10-21

Similar Documents

Publication Publication Date Title
CN104990926B (en) A kind of TR elements positioning of view-based access control model and defect inspection method
Zhou et al. Automated visual inspection of glass bottle bottom with saliency detection and template matching
CN104915963B (en) A kind of detection and localization method for PLCC elements
CN107590498A (en) A kind of self-adapted car instrument detecting method based on Character segmentation level di- grader
CN111402226A (en) Surface defect detection method based on cascade convolution neural network
CN104933720A (en) SOP element positioning and defect detecting method based on vision
CN105157563B (en) A kind of medicated beer bottleneck localization method based on machine vision
US20170193649A1 (en) Multi-type BGA Chip Visual Recognition Method Using Line Based Clustering
CN110310262A (en) A kind of method, apparatus and system for detection wheel tyre defect
CN107622499A (en) A kind of identification and space-location method based on target two-dimensional silhouette model
CN104899892B (en) A kind of quickly star map image asterism extracting method
CN109800619B (en) Image recognition method for citrus fruits in mature period
CN105335973A (en) Visual processing method for strip steel processing production line
CN107369140A (en) High-accuracy target ball center extraction method under unstructured moving grids
CN106407924A (en) Binocular road identifying and detecting method based on pavement characteristics
CN102324032A (en) Texture feature extraction method for gray level co-occurrence matrix in polar coordinate system
CN103400373A (en) Method for automatically identifying and positioning coordinates of image point of artificial mark in camera calibration control field
CN108052886A (en) A kind of puccinia striiformis uredospore programming count method of counting
CN102708368A (en) Method for positioning bottle bodies on production line based on machine vision
CN106504262A (en) A kind of small tiles intelligent locating method of multiple features fusion
CN106097316A (en) The substrate position identifying processing method of laser scribing means image identification system
CN106546185A (en) A kind of profile quality determining method based on Machine Vision Detection
CN106250901A (en) A kind of digit recognition method based on image feature information
CN111260609A (en) Cigarette appearance defect detection method based on deep learning
CN106548195A (en) A kind of object detection method based on modified model HOG ULBP feature operators

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into 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: 20190911

Address after: 150001 No. 434, postal street, Nangang District, Heilongjiang, Harbin

Co-patentee after: Gao Hui Jun

Patentee after: Harbin Institute of Technology Asset Investment Management Co., Ltd.

Address before: 150001 Harbin, Nangang, West District, large straight street, No. 92

Patentee before: Harbin Institute of Technology

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20191017

Address after: 315200 No.189, Guangming Road, Zhuangshi street, Zhenhai District, Ningbo City, Zhejiang Province

Patentee after: Ningbo Intelligent Equipment Research Institute Co., Ltd.

Address before: 150001 No. 434, postal street, Nangang District, Heilongjiang, Harbin

Co-patentee before: Gao Hui Jun

Patentee before: Harbin Institute of Technology Asset Investment Management Co., Ltd.