CN104777176A - PCB detection method and apparatus thereof - Google Patents

PCB detection method and apparatus thereof Download PDF

Info

Publication number
CN104777176A
CN104777176A CN201510134717.XA CN201510134717A CN104777176A CN 104777176 A CN104777176 A CN 104777176A CN 201510134717 A CN201510134717 A CN 201510134717A CN 104777176 A CN104777176 A CN 104777176A
Authority
CN
China
Prior art keywords
pcb board
sample
picture
subwindow
local textural
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510134717.XA
Other languages
Chinese (zh)
Other versions
CN104777176B (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.)
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology Co Ltd
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 Guangzhou Shiyuan Electronics Thecnology Co Ltd filed Critical Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority to CN201510134717.XA priority Critical patent/CN104777176B/en
Publication of CN104777176A publication Critical patent/CN104777176A/en
Application granted granted Critical
Publication of CN104777176B publication Critical patent/CN104777176B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a PCB detection method. The method comprises the following steps: establishing a Gaussian discriminant analysis model based on local texture characteristics of a sample, wherein the sample comprises a first type of sample and a second type of sample, the first type of sample is a PCB without neglected loading of any elements, and the second type of sample is a PCB with neglected loading of at least one element; acquiring the picture of a PCB to be detected, and extracting the local texture characteristics of the picture of the PCB to be detected; and determining the type of the PCB to be detected according to the local texture characteristics of the picture of the PCB to be detected and the established Gaussian discriminant analysis model. The PCB detection method provided by the invention has the advantages of high discrimination efficiency and detection temperature.

Description

A kind of pcb board detection method and device
Technical field
The present invention relates to field tests, particularly relate to a kind of pcb board detection method and device.
Background technology
Printed circuit board (PCB) (Printed Circuit Board, PCB) is the supplier of electronic devices and components electrical connection, it is provided with multiple element, and these elements is formed by connecting according to the Logic Circuit Design pre-set, to realize specific function.Due to production and processing or the various situations that may occur in assembling, the one or more element of neglected loading may to be caused on some pcb board, thus causing these pcb boards normally to work or to run, these pcb boards that cannot normally work or run need be detected, and re-start reparation.
Existing detection method mainly contains manual detection method and template matching method, for manual detection method, because the element in the quantity of pcb board and every block pcb board is numerous, thus manual method is only relied on to be difficult to the pcb board picking out these neglected loadings element, and easily because artificial fatigue causes Detection results to decline; And template matches is mated based on " having element " and " leak and insert " two point Linears, known sample information can not be made full use of, cause algorithm stability inadequate, can not user demand be met.
Summary of the invention
For the problems referred to above, the object of the present invention is to provide a kind of pcb board detection method and device, high recognition efficiency, stable detection can be provided.
The embodiment of the present invention provides a kind of pcb board detection method, comprises the steps:
Local textural feature based on sample sets up Gauss's discriminatory analysis model, wherein, described sample comprises first kind sample and Second Type sample, and described first kind sample is the pcb board not having neglected loading element, and described Second Type sample is the pcb board of at least one element of neglected loading;
Obtain the picture of pcb board to be detected, and extract the Local textural feature of the picture of described pcb board to be detected; And
According to the Local textural feature of the picture of described pcb board to be detected and Gauss's discriminatory analysis model of described foundation, determine the type of described pcb board to be detected.
As the improvement of such scheme, the described Local textural feature based on sample sets up Gauss's discriminatory analysis model, comprising:
Gather the picture of some first kind samples and some Second Type samples;
Extract the Local textural feature of the samples pictures of described collection; And
The Local textural feature of described extraction is utilized to set up Gauss's discriminatory analysis model.
As the improvement of such scheme, the Local textural feature of the samples pictures of the described collection of described extraction, comprising:
Utilize the picture of one 3 × 3 scanning window scanning collection, wherein, described scanning window comprises 9 subwindows, and each subwindow obtains the grey scale pixel value of the point on the picture at the current place of described subwindow when scanning;
The grey scale pixel value of the grey scale pixel value being positioned at acentric eight subwindows with the subwindow being positioned at center is compared, if the grey scale pixel value being positioned at acentric subwindow is more than or equal to the grey scale pixel value of the subwindow being positioned at center, then the numerical value in this subwindow is set to 1, otherwise is set to 0;
Utilize formula obtain the Local textural feature that present scan window extracts, wherein, s ( x ) = 1 if x ≥ 0 0 else , X is the numerical value in acentric subwindow, and p is the mark value of this subwindow, and wherein, the mark value being positioned at the subwindow in the upper left corner is 1, and the mark value of all the other non-central subwindows increases progressively in the direction of the clock, increases progressively 1 at every turn; And
On described picture, mobile described scanning window, obtains whole Local textural features of described picture.
As the improvement of such scheme, the Local textural feature that described utilization is extracted sets up Gauss's discriminatory analysis model, specifically comprises:
The Local textural feature of extraction is projected in two-dimensional coordinate, obtains the characteristic profile about first kind sample and Second Type sample; And
Calculate the model parameter of Gauss's discrimination model according to the characteristic profile of described first kind sample and Second Type sample, obtain Gauss's discriminatory analysis model.
As the improvement of such scheme, the Local textural feature of the described picture according to described pcb board to be detected and Gauss's discriminatory analysis model of described foundation, determine the type of described pcb board to be detected, comprising:
The Local textural feature of the picture of described pcb board to be detected is inputted respectively the distribution density formula of first kind sample and the distribution density formula of Second Type sample, wherein, described distribution density formula is provided by Gauss's discriminatory analysis model and model parameter; And
Calculate the Probability p of Local textural feature at the distribution density formula of first kind sample of the picture of described pcb board to be detected 0with the Probability p of the distribution density formula at Second Type sample 1if, p 0< p 1, then determine that described pcb board to be detected is first kind pcb board, otherwise be defined as Second Type pcb board.
The present invention also provides a kind of pcb board pick-up unit, comprises model and sets up unit, feature extraction unit and judgement unit, wherein:
Unit set up by described model, for setting up Gauss's discriminatory analysis model based on the Local textural feature of sample, wherein, described sample comprises first kind sample and Second Type sample, described first kind sample is the pcb board not having neglected loading element, and described Second Type sample is the pcb board of at least one element of neglected loading;
Described feature extraction unit, for extracting the Local textural feature of the picture of pcb board to be detected; And
Described judgement unit, for the Local textural feature of the picture according to described pcb board to be detected and Gauss's discriminatory analysis model of described foundation, determines the type of described pcb board to be detected.
As the improvement of such scheme, described model is set up unit and is comprised:
Collecting unit, for gathering the picture of some first kind samples and some Second Type samples;
Extraction unit, for extracting the Local textural feature of the samples pictures of described collection; And
Modeling unit, sets up Gauss's discriminatory analysis model for utilizing the Local textural feature of described extraction.
As the improvement of such scheme, described feature extraction unit comprises:
Scanning element, for utilizing the picture of one 3 × 3 scanning window scanning collection, wherein, described scanning window comprises 9 subwindows, and each subwindow obtains the grey scale pixel value of the point on the picture at the current place of described subwindow when scanning;
Comparing unit, for the grey scale pixel value of the grey scale pixel value being positioned at acentric eight subwindows with the subwindow being positioned at center is compared, if the grey scale pixel value being positioned at acentric subwindow is more than or equal to the grey scale pixel value of the subwindow being positioned at center, numerical value then in this subwindow is set to 1, otherwise is set to 0;
Feature calculation unit, for utilizing formula calculate the Local textural feature that present scan window extracts, wherein, s ( x ) = 1 if x &GreaterEqual; 0 0 else , X is the numerical value in acentric subwindow, and p is the mark value of this subwindow, and wherein, the mark value being positioned at the subwindow in the upper left corner is 1, and the mark value of all the other non-central subwindows increases progressively in the direction of the clock, increases progressively 1 at every turn; And
Mobile unit, for described scanning window mobile on described picture, obtains whole Local textural features of described picture.
As the improvement of such scheme, described modeling unit specifically comprises:
Projecting cell, for projecting in two-dimensional coordinate by the Local textural feature of extraction, obtains the characteristic profile about first kind sample and Second Type sample;
Parameter calculation unit, for calculating the model parameter of Gauss's discrimination model according to the characteristic profile of described first kind sample and Second Type sample, obtains Gauss's discriminatory analysis model.
As the improvement of such scheme, described judgement unit comprises:
Input block, Local textural feature for the picture by described pcb board to be detected inputs the distribution density formula of first kind sample and the distribution density formula of Second Type sample respectively, wherein, described distribution density formula is provided by Gauss's discriminatory analysis model and model parameter; And
Judging unit, for calculating the Probability p of Local textural feature at the distribution density formula of first kind sample of the picture of described pcb board to be detected 0with the Probability p of the distribution density formula at Second Type sample 1if, p 0< p 1, then determine that described pcb board to be detected is first kind pcb board, otherwise be defined as Second Type pcb board.
The pcb board detection method that the embodiment of the present invention provides and device, by extracting the Local textural feature of pcb board, and the Gauss's discriminatory analysis model set up based on Local textural feature, separately modeling is carried out to first kind sample and Second Type sample, take full advantage of the Given information of sample, make algorithmic stability, because model has considered the Given information of all samples, so the impact when extreme case appears in given sample suffered by algorithm is very little.In addition, this method also has illumination condition insensitive, little to production run interference, does not need the advantages such as extra production data, solves in prior art by the problem that recognition efficiency is low, subjectivity is strong that the defect of artificial cognition pcb board is brought.
Accompanying drawing explanation
In order to be illustrated more clearly in technical scheme of the present invention, be briefly described to the accompanying drawing used required in embodiment below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the schematic flow sheet that the embodiment of the present invention provides pcb board detection method.
Fig. 2 is the schematic diagram that scanning window scans the grey scale pixel value obtained.
Fig. 3 be to scanning window and then binarization after schematic diagram.
Fig. 4 is the mark value schematic diagram of scanning window.
Fig. 5 be to Local textural feature normalization after histogram.
Fig. 6 is the characteristic profile of first kind sample and Second Type sample.
Fig. 7 is the structural representation that the embodiment of the present invention provides pcb board pick-up unit.
Fig. 8 is the structural representation that unit set up by the model shown in Fig. 7.
Fig. 9 is the structural representation of the second extraction unit shown in Fig. 8.
Figure 10 is the structural representation of the modeling unit shown in Fig. 8.
Figure 11 is the structural representation of the judgement unit shown in Fig. 7.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Refer to Fig. 1, the embodiment of the present invention provides a kind of pcb board detection method, and it at least comprises the steps:
S101, Local textural feature based on sample sets up Gauss's discriminatory analysis model, and wherein, described sample comprises first kind sample and Second Type sample, described first kind sample is the pcb board not having neglected loading element, and described Second Type sample is the pcb board of at least one element of neglected loading.
In embodiments of the present invention, printed circuit board (PCB) (Printed Circuit Board, PCB) is provided with multiple element, and these elements are formed by connecting according to the Logic Circuit Design pre-set, to realize specific function.Wherein, due to production and processing or the various situations that may occur in assembling, the one or more element of neglected loading may to be caused on some pcb board, thus cause these pcb boards normally to work or to run, these pcb boards that cannot normally work or run need be detected, and re-start reparation.But due to the element in the quantity of pcb board and every block pcb board numerous, thus only rely on manual method to be difficult to the pcb board detecting these neglected loadings element.
In embodiments of the present invention, can be used for judging whether one piece of pcb board occurs leaking the situation of inserted component, is specially in conjunction with the Local textural feature of picture gathered and Gauss's discriminatory analysis model:
S1011, gathers the picture of some first kind samples and some Second Type samples.
In embodiments of the present invention, camera (can be black and white or colour imagery shot) gathers the picture of several pcb boards not having neglected loading element (first kind sample) and several neglected loadings pcb board of at least one element (Second Type sample), with by processing picture, obtain the Local textural feature of picture, thus carry out follow-up analytical calculation.Wherein, the number of the picture of collection can be arranged according to the actual needs, as can be 20, and 30 or other quantity, the present invention is not specifically limited.
S1012, extracts the Local textural feature of the samples pictures of described collection.
In embodiments of the present invention, after having gathered described samples pictures, the Local textural feature of these pictures need be extracted, be specially:
First, utilize the picture of one 3 × 3 scanning window scanning collection, wherein, described scanning window comprises 9 subwindows, and each subwindow obtains the grey scale pixel value of the pixel on the picture at the current place of described subwindow when scanning.
See also Fig. 2, in embodiments of the present invention, described scanning window realizes scan function by specific scanner or scanning software or the combination of the two.Wherein, this 3 × 3 scanning window is a square window shape, and there is the identical subwindow of 9 sizes, wherein, preferably, the size of each subwindow is the size of a pixel on picture, when this scanning window scans described samples pictures, the pixel of each subwindow just in time on corresponding and Covering samples picture, and the grey scale pixel value of this pixel can be obtained.As shown in Figure 2, Fig. 2 is the scanning result obtained after the scanning of described scanning window, wherein, and the grey scale pixel value of the pixel that this subwindow of the digitized representation in each subwindow scans.
Secondly, the grey scale pixel value of the grey scale pixel value being positioned at acentric eight subwindows with the subwindow being positioned at center is compared, if the grey scale pixel value being positioned at acentric subwindow is more than or equal to the grey scale pixel value of the subwindow being positioned at center, then the numerical value in this subwindow is set to 1, otherwise is set to 0.
See also Fig. 3, after obtaining described grey scale pixel value by scanned samples picture, binarization need be carried out to described scanning window.Be specially, the grey scale pixel value being positioned at acentric eight subwindows compares with the grey scale pixel value of the subwindow being positioned at center respectively, if the grey scale pixel value being positioned at acentric subwindow is more than or equal to the grey scale pixel value of the subwindow being positioned at center, numerical value then in this subwindow is set to 1, otherwise is set to 0.As shown in Figure 3, the grey scale pixel value being positioned at the subwindow at center is 5, if the grey scale pixel value being arranged in acentric subwindow is more than or equal to 5, then the numerical value of this subwindow is set to 1, if the grey scale pixel value being arranged in acentric subwindow is less than 5, then the numerical value of this subwindow is set to 0.In addition, after completing binarization, also the numerical value of the subwindow being positioned at center is set to sky, does not namely put into any numerical value.
Then, formula is utilized obtain the Local textural feature that present scan window extracts, wherein, s ( x ) = 1 if x &GreaterEqual; 0 0 else , X is the numerical value in acentric subwindow, and p is the mark value of this subwindow, and wherein, the mark value being positioned at the subwindow in the upper left corner is 1, and the mark value of all the other non-central subwindows increases progressively in the direction of the clock, increases progressively 1 successively.
See also Fig. 4, be specially, the Local textural feature that present scan window extracts is by formula calculate, wherein feature is Local textural feature, s ( x ) = 1 if x &GreaterEqual; 0 0 else , X is the numerical value in acentric subwindow, and p is the mark value of this subwindow, wherein, the mark value being positioned at the subwindow in the upper left corner is 1, the mark value of all the other non-central subwindows increases progressively in the direction of the clock, increases progressively 1 (as shown in Figure 4, Fig. 4 gives the mark value of each window) at every turn.Calculate for Fig. 3 and Fig. 4, then now, Local textural feature feature = &Sigma; p = 1 8 2 p - 1 s ( x ) = 1 &times; 2 3 + 1 &times; 2 6 + 1 &times; 2 7 = 200 .
Finally, on described picture, mobile described scanning window, obtains whole Local textural features of described picture.
In embodiments of the present invention, the continuous sweep on described picture of shown scanning window, obtains whole Local textural features of described picture.Wherein, described scanning window moves the distance of a pixel at every turn.Such as, suppose that the size of described picture is 102 × 102, due to a described scanning window only mobile pixel at every turn, thus this scanning window all moves 100 times by the direction of the direction of being expert at and row, and namely described scanning window is by scanning acquisition 100 × 100=10000 Local textural feature.As shown in Figure 5, described Local textural feature can carry out statistics with histogram, and obtain histogram feature by normalization, wherein, histogrammic horizontal ordinate is the value (scope is 0 ~ 255) of Local textural feature, ordinate is probability (scope is 0 ~ 1), and all ordinates add up and be 1.
S1013, utilizes the Local textural feature of described extraction to set up Gauss's discriminatory analysis model.
Be specially:
First, the Local textural feature of extraction is projected in two-dimensional coordinate, obtain the characteristic profile about first kind sample and Second Type sample.
See also Fig. 6, the Local textural feature extracted above is projected in two-dimensional coordinate, obtain the sample characteristics distribution plan shown in Fig. 6.Wherein label symbol be × expression first kind sample, label symbol is the expression Second Type sample of zero.
Then, calculate the model parameter of Gauss's discrimination model according to the characteristic profile of described first kind sample and Second Type sample, obtain Gauss's discriminatory analysis model.
Be specially:
Suppose that the Local textural feature x inputted is continuous random variable, and Normal Distribution, and classification output variable y obeys Bernoulli Jacob's distribution, wherein y=0 represents Second Type sample, and y=1 represents first kind sample, then have following formula:
y~Bernoulli(φ)
x|y=0~N(μ 0,Σ) (1)
x|y=1~N(μ 1,Σ)
Concrete probability density distribution is as shown in formula (2):
p(y)=φ y(1-φ) 1-y
p ( x | y = 0 ) = 1 ( 2 &pi; ) n / 2 | &Sigma; | 1 / 2 exp ( - 1 2 ( x - &mu; 0 ) T &Sigma; - 1 ( x - &mu; 0 ) )
p ( x | y = 1 ) = 1 ( 2 &pi; ) n / 2 | &Sigma; | 1 / 2 exp ( - 1 2 ( x - &mu; 1 ) T &Sigma; - 1 ( x - &mu; 1 ) ) - - - ( 2 )
In formula, p (y) exports the probability for y, and p (x|y=0) is under given x, and export the probability of y=0, p (x|y=1) is under given x, exports the probability of y=1.Gauss's discriminatory analysis model parameter is calculated by formula (3):
&phi; = 1 m &Sigma; i = 1 m 1 { y ( i ) = 1 }
&mu; 0 = &Sigma; i = 1 m 1 { y ( i ) = 0 } x ( i ) &Sigma; i = 1 m 1 { y ( i ) = 0 }
&mu; 1 = &Sigma; i = 1 m 1 { y ( i ) = 1 } x ( i ) &Sigma; i = 1 m 1 { y ( i ) = 1 }
&Sigma; = 1 m &Sigma; i = 1 m ( x ( i ) - &mu; y ( i ) ) ( x ( i ) - &mu; y ( i ) ) T - - - ( 3 )
Wherein, φ is the ratio that in training sample, result y=1 occupies, μ 0characteristic mean in the sample of y=0, μ 1be characteristic mean in the sample of y=1, Σ is sample characteristics mean variance.M is the current sample chosen, such as, suppose to acquire altogether 20 first kind samples and 20 Second Type samples, then m=40.Y (i)=1 represents that this sample is first kind sample, y (i)=0 represents that this sample is Second Type sample.
In embodiments of the present invention, by calculating above-mentioned model parameter, described Gauss's discrimination model can be obtained.
S102, obtains the picture of pcb board to be detected, and extracts the Local textural feature of the picture of described pcb board to be detected.
In embodiments of the present invention, adopt the method identical with the process of the Local textural feature of said extracted sample, the Local textural feature of the picture of pcb board to be detected can be extracted.
S103, according to the Local textural feature of the picture of described pcb board to be detected and Gauss's discriminatory analysis model of described foundation, determines the type of described pcb board to be detected.
Be specially:
First, the Local textural feature of the picture of described pcb board to be detected is inputted respectively the probability density distribution formula of first kind sample and the distribution density formula of Second Type sample, wherein, described probability density distribution is provided by Gauss's discriminatory analysis model and model parameter.
In embodiments of the present invention, the Local textural feature x of the PCB image to be detected extracted is inputted Gauss's discriminatory analysis model that formula (2) is set up.
Then, the Probability p of Local textural feature at the distribution density formula of first kind sample of the picture of described pcb board to be detected is calculated 0with the Probability p of the distribution density formula at Second Type sample 1if, p 0< p 1, then described pcb board to be detected is first kind pcb board, otherwise is Second Type pcb board.
Be specially, first calculate:
p(x|y=0)=p 0
p(x|y=1)=p 1(4)
Then the p calculating and obtain is compared 0and p 1size, if p 0< p 1, then think that pcb board to be detected is by detecting, namely there is not the situation (being first kind pcb board) of leaking inserted component in this pcb board to be detected; Otherwise, then think that this pcb board to be detected has leakage inserted component (being Second Type pcb board), need check or reparation etc. further.
The pcb board detection method that the embodiment of the present invention provides, by extracting the Local textural feature of pcb board, and the Gauss's discriminatory analysis model set up based on Local textural feature, separately modeling is carried out to first kind sample and Second Type sample, take full advantage of the Given information of sample, make algorithmic stability, because model has considered the Given information of all samples, so the impact when extreme case appears in given sample suffered by algorithm is very little.In addition, this method also has illumination condition insensitive, little to production run interference, does not need the advantages such as extra production data, solves in prior art by the problem that recognition efficiency is low, subjectivity is strong that the defect of artificial cognition pcb board is brought.
Refer to Fig. 7, the embodiment of the present invention also provides a kind of pcb board pick-up unit 100, and described pcb board pick-up unit 100 comprises model and sets up unit 10, first extraction unit 20 and judgement unit 30, wherein:
Unit 10 set up by described model, for setting up Gauss's discriminatory analysis model based on the Local textural feature of sample, wherein, described sample comprises first kind sample and Second Type sample, described first kind sample is the pcb board not having neglected loading element, and described Second Type sample is the pcb board of at least one element of neglected loading.
See also Fig. 8, be specially, described model is set up unit 10 and is comprised collecting unit 11, second extraction unit 12 and modeling unit 13, wherein:
Described collecting unit 11, for gathering the picture of some first kind samples and some Second Type samples.
In embodiments of the present invention, described collecting unit 11 can be camera, it is for the pcb board (first kind sample) that gathers several and do not have neglected loading element and several neglected loadings picture of the pcb board of at least one element (Second Type sample), with by processing picture, obtain the Local textural feature of picture, thus carry out follow-up analytical calculation.Wherein, the number of the picture of collection can be arranged according to the actual needs, as can be 20, and 30 or other quantity, the present invention is not specifically limited.
Described second extraction unit 12, for extracting the Local textural feature of the samples pictures of described collection.
See also Fig. 9, be specially: described second extraction unit 12 comprises:
Scanning element 121, for utilizing the picture of one 3 × 3 scanning window scanning collection, wherein, described scanning window comprises 9 subwindows, and each subwindow obtains the grey scale pixel value of the point on the picture at the current place of described subwindow when scanning.
See also Fig. 2, in embodiments of the present invention, described scanning element 121 can form one 3 × 3 scanning windows, and described 3 × 3 scanning windows are a square window shape, and has the identical subwindow of 9 sizes, wherein, preferably, the size of each subwindow is the size of a pixel on picture, when this scanning window scans described samples pictures, the pixel of each subwindow just in time on corresponding and Covering samples picture, and the grey scale pixel value of this pixel can be obtained.As shown in Figure 2, Fig. 2 is the scanning result obtained after the scanning of described scanning window, wherein, and the grey scale pixel value of the pixel that this subwindow of the digitized representation in each subwindow scans.
Comparing unit 122, for the grey scale pixel value of the grey scale pixel value being positioned at acentric eight subwindows with the subwindow being positioned at center is compared, if the grey scale pixel value being positioned at acentric subwindow is more than or equal to the grey scale pixel value of the subwindow being positioned at center, numerical value then in this subwindow is set to 1, otherwise is set to 0.
See also Fig. 3, after described scanning element 121 scanned samples picture obtains described grey scale pixel value, binarization need be carried out to described scanning window.Be specially, the grey scale pixel value being positioned at acentric eight subwindows compares with the grey scale pixel value of the subwindow being positioned at center by described comparing unit 122 respectively, if the grey scale pixel value being positioned at acentric subwindow is more than or equal to the grey scale pixel value of the subwindow being positioned at center, then the numerical value in this subwindow is set to 1 by described comparing unit 122, otherwise is set to 0.As shown in Figure 3, the grey scale pixel value being positioned at the subwindow at center is 5, if the grey scale pixel value being arranged in acentric subwindow is more than or equal to 5, then the numerical value of this subwindow is set to 1 by described comparing unit 122, if the grey scale pixel value being arranged in acentric subwindow is less than 5, then the numerical value of this subwindow is set to 0 by described comparing unit 122.In addition, after completing binarization, the numerical value of the subwindow being positioned at center is also set to sky by described comparing unit 122, does not namely put into any numerical value.
Feature calculation unit 123, for utilizing formula calculate the Local textural feature that present scan window extracts, wherein, s ( x ) = 1 if x &GreaterEqual; 0 0 else , X is the numerical value in acentric subwindow, and p is the mark value of this subwindow, and wherein, the mark value being positioned at the subwindow in the upper left corner is 1, and the mark value of all the other non-central subwindows increases progressively in the direction of the clock, increases progressively 1 at every turn.
See also Fig. 4, be specially, described feature calculation unit 123 is by formula calculate described Local textural feature, wherein feature is Local textural feature, s ( x ) = 1 if x &GreaterEqual; 0 0 else , X is the numerical value in acentric subwindow, and p is the mark value of this subwindow, wherein, the mark value being positioned at the subwindow in the upper left corner is 1, the mark value of all the other non-central subwindows increases progressively in the direction of the clock, increases progressively 1 (as shown in Figure 4, Fig. 4 gives the mark value of each window) at every turn.Calculate for Fig. 3 and Fig. 4, then now, Local textural feature feature = &Sigma; p = 1 8 2 p - 1 s ( x ) = 1 &times; 2 3 + 1 &times; 2 6 + 1 &times; 2 7 = 200 .
Mobile unit 124, for described scanning window mobile on described picture, obtains whole Local textural features of described picture.
Described modeling unit 13, sets up Gauss's discriminatory analysis model for utilizing the Local textural feature of described extraction.
See also Figure 10, be specially, described modeling unit 13 comprises projecting cell 131 and parameter calculation unit 132, wherein:
Described projecting cell 131, projects in two-dimensional coordinate by the Local textural feature of extraction, obtains the characteristic profile about first kind sample and Second Type sample.
See also Fig. 6, the Local textural feature extracted above projects in two-dimensional coordinate by described projecting cell 131, obtains the sample characteristics distribution plan shown in Fig. 6.Wherein label symbol be × expression first kind sample, label symbol is the expression Second Type sample of zero.
Described parameter calculation unit 132, for calculating the model parameter of Gauss's discrimination model according to the characteristic profile of described first kind sample and Second Type sample, obtains Gauss's discriminatory analysis model.
Be specially, described parameter calculation unit 132 supposes that the Local textural feature x of input is continuous random variable, and Normal Distribution, and classification output variable y obeys Bernoulli Jacob's distribution, wherein y=0 represents Second Type sample, and y=1 represents first kind sample, then have following formula:
y~Bernoulli(φ)
x|y=0~N(μ 0,Σ) (1)
x|y=1~N(μ 1,Σ)
Concrete probability density distribution is as shown in formula (2):
p(y)=φ y(1-φ) 1-y
p ( x | y = 0 ) = 1 ( 2 &pi; ) n / 2 | &Sigma; | 1 / 2 exp ( - 1 2 ( x - &mu; 0 ) T &Sigma; - 1 ( x - &mu; 0 ) )
p ( x | y = 1 ) = 1 ( 2 &pi; ) n / 2 | &Sigma; | 1 / 2 exp ( - 1 2 ( x - &mu; 1 ) T &Sigma; - 1 ( x - &mu; 1 ) ) - - - ( 2 )
In formula, p (y) exports the probability for y, and p (x|y=0) is under given x, and export the probability of y=0, p (x|y=1) is under given x, exports the probability of y=1.Gauss's discriminatory analysis model parameter is calculated by formula (3):
&phi; = 1 m &Sigma; i = 1 m 1 { y ( i ) = 1 }
&mu; 0 = &Sigma; i = 1 m 1 { y ( i ) = 0 } x ( i ) &Sigma; i = 1 m 1 { y ( i ) = 0 }
&mu; 1 = &Sigma; i = 1 m 1 { y ( i ) = 1 } x ( i ) &Sigma; i = 1 m 1 { y ( i ) = 1 }
&Sigma; = 1 m &Sigma; i = 1 m ( x ( i ) - &mu; y ( i ) ) ( x ( i ) - &mu; y ( i ) ) T - - - ( 3 )
Wherein, φ is the ratio that in training sample, result y=1 occupies, μ 0characteristic mean in the sample of y=0, μ 1be characteristic mean in the sample of y=1, Σ is sample characteristics mean variance.M is the current sample chosen, such as, suppose to acquire altogether 20 first kind samples and 20 Second Type samples, then m=40.Y (i)=1 represents that this sample is first kind sample, y (i)=0 represents that this sample is Second Type sample.
Described first extraction unit 20, for extracting the Local textural feature of the picture of pcb board to be detected.
In embodiments of the present invention, principle of work and described second extraction unit 12 of described first extraction unit 20 are similar, do not repeat them here.
Described judgement unit 30, for the Local textural feature of the picture according to described pcb board to be detected and Gauss's discriminatory analysis model of described foundation, determines the type of described pcb board to be detected.
See also Figure 11, be specially, described judgement unit 30 comprises feature input block 31 and judging unit 32, wherein,
Described feature input block 31, Local textural feature for the picture by described pcb board to be detected inputs the distribution density formula of first kind sample and the distribution density formula of Second Type sample respectively, wherein, described distribution density formula is provided by Gauss's discriminatory analysis model and model parameter.
Described judging unit 32, for calculating the Probability p of Local textural feature at the distribution density formula of first kind sample of the picture of described pcb board to be detected 0with the Probability p of the distribution density formula at Second Type sample 1if, p 0< p 1, then described pcb board to be detected is first kind pcb board, otherwise is Second Type pcb board.
The pcb board pick-up unit that the embodiment of the present invention provides, by extracting the Local textural feature of pcb board, and the Gauss's discriminatory analysis model set up based on Local textural feature, separately modeling is carried out to first kind sample and Second Type sample, take full advantage of the Given information of sample, make algorithmic stability, because model has considered the Given information of all samples, so the impact when extreme case appears in given sample suffered by algorithm is very little.In addition, this method also has illumination condition insensitive, little to production run interference, does not need the advantages such as extra production data, solves in prior art by the problem that recognition efficiency is low, subjectivity is strong that the defect of artificial cognition pcb board is brought.
Above disclosedly be only a kind of preferred embodiment of the present invention, certainly the interest field of the present invention can not be limited with this, one of ordinary skill in the art will appreciate that all or part of flow process realizing above-described embodiment, and according to the equivalent variations that the claims in the present invention are done, still belong to the scope that invention is contained.
One of ordinary skill in the art will appreciate that all or part of flow process realized in above-described embodiment method, that the hardware that can carry out instruction relevant by computer program has come, described program can be stored in a computer read/write memory medium, this program, when performing, can comprise the flow process of the embodiment as above-mentioned each side method.Wherein, described storage medium can be magnetic disc, CD, read-only store-memory body (Read-Only Memory, ROM) or random store-memory body (Random Access Memory, RAM) etc.

Claims (10)

1. a pcb board detection method, is characterized in that, comprises the steps:
Local textural feature based on sample sets up Gauss's discriminatory analysis model, wherein, described sample comprises first kind sample and Second Type sample, and described first kind sample is the pcb board not having neglected loading element, and described Second Type sample is the pcb board of at least one element of neglected loading;
Obtain the picture of pcb board to be detected, and extract the Local textural feature of the picture of described pcb board to be detected; And
According to the Local textural feature of the picture of described pcb board to be detected and Gauss's discriminatory analysis model of described foundation, determine the type of described pcb board to be detected.
2. pcb board detection method according to claim 1, is characterized in that, the described Local textural feature based on sample sets up Gauss's discriminatory analysis model, comprising:
Gather the picture of some first kind samples and some Second Type samples;
Extract the Local textural feature of the samples pictures of described collection; And
The Local textural feature of described extraction is utilized to set up Gauss's discriminatory analysis model.
3. pcb board detection method according to claim 2, is characterized in that, the Local textural feature of the samples pictures of the described collection of described extraction, comprising:
Utilize the picture of one 3 × 3 scanning window scanning collection, wherein, described scanning window comprises 9 subwindows, and each subwindow obtains the grey scale pixel value of the point on the picture at the current place of described subwindow when scanning;
The grey scale pixel value of the grey scale pixel value being positioned at acentric eight subwindows with the subwindow being positioned at center is compared, if the grey scale pixel value being positioned at acentric subwindow is more than or equal to the grey scale pixel value of the subwindow being positioned at center, then the numerical value in this subwindow is set to 1, otherwise is set to 0;
Utilize formula obtain the Local textural feature that present scan window extracts, wherein, s ( x ) = 1 if x &GreaterEqual; 0 0 else , X is the numerical value in acentric subwindow, and p is the mark value of this subwindow, and wherein, the mark value being positioned at the subwindow in the upper left corner is 1, and the mark value of all the other non-central subwindows increases progressively in the direction of the clock, increases progressively 1 at every turn; And
On described picture, mobile described scanning window, obtains whole Local textural features of described picture.
4. pcb board detection method according to claim 2, is characterized in that, the described Local textural feature extracted that utilizes sets up Gauss's discriminatory analysis model, specifically comprises:
The Local textural feature of extraction is projected in two-dimensional coordinate, obtains the characteristic profile about first kind sample and Second Type sample; And
Calculate the model parameter of Gauss's discrimination model according to the characteristic profile of described first kind sample and Second Type sample, obtain Gauss's discriminatory analysis model.
5. pcb board detection method according to claim 1, is characterized in that, the Local textural feature of the described picture according to described pcb board to be detected and Gauss's discriminatory analysis model of described foundation, determines the type of described pcb board to be detected, comprising:
The Local textural feature of the picture of described pcb board to be detected is inputted respectively the distribution density formula of first kind sample and the distribution density formula of Second Type sample, wherein, described distribution density formula is provided by Gauss's discriminatory analysis model and model parameter; And
Calculate the Probability p of Local textural feature at the distribution density formula of first kind sample of the picture of described pcb board to be detected 0with the Probability p of the distribution density formula at Second Type sample 1if, p 0< p 1, then determine that described pcb board to be detected is first kind pcb board, otherwise be defined as Second Type pcb board.
6. a pcb board pick-up unit, is characterized in that, comprises model and sets up unit, the first extraction unit and judgement unit, wherein:
Unit set up by described model, for setting up Gauss's discriminatory analysis model based on the Local textural feature of sample, wherein, described sample comprises first kind sample and Second Type sample, described first kind sample is the pcb board not having neglected loading element, and described Second Type sample is the pcb board of at least one element of neglected loading;
Described first extraction unit, for extracting the Local textural feature of the picture of pcb board to be detected; And
Described judgement unit, for the Local textural feature of the picture according to described pcb board to be detected and Gauss's discriminatory analysis model of described foundation, determines the type of described pcb board to be detected.
7. pcb board pick-up unit according to claim 6, is characterized in that, described model is set up unit and comprised:
Collecting unit, for gathering the picture of some first kind samples and some Second Type samples;
Second extraction unit, for extracting the Local textural feature of the samples pictures of described collection; And
Modeling unit, sets up Gauss's discriminatory analysis model for utilizing the Local textural feature of described extraction.
8. pcb board pick-up unit according to claim 7, is characterized in that, described second extraction unit comprises:
Scanning element, for utilizing the picture of one 3 × 3 scanning window scanning collection, wherein, described scanning window comprises 9 subwindows, and each subwindow obtains the grey scale pixel value of the point on the picture at the current place of described subwindow when scanning;
Comparing unit, for the grey scale pixel value of the grey scale pixel value being positioned at acentric eight subwindows with the subwindow being positioned at center is compared, if the grey scale pixel value being positioned at acentric subwindow is more than or equal to the grey scale pixel value of the subwindow being positioned at center, numerical value then in this subwindow is set to 1, otherwise is set to 0;
Feature calculation unit, for utilizing formula calculate the Local textural feature that present scan window extracts, wherein, s ( x ) = 1 if x &GreaterEqual; 0 0 else , X is the numerical value in acentric subwindow, and p is the mark value of this subwindow, and wherein, the mark value being positioned at the subwindow in the upper left corner is 1, and the mark value of all the other non-central subwindows increases progressively in the direction of the clock, increases progressively 1 at every turn; And
Mobile unit, for described scanning window mobile on described picture, obtains whole Local textural features of described picture.
9. pcb board pick-up unit according to claim 7, is characterized in that, described modeling unit specifically comprises:
Projecting cell, for projecting in two-dimensional coordinate by the Local textural feature of extraction, obtains the characteristic profile about first kind sample and Second Type sample;
Parameter calculation unit, for calculating the model parameter of Gauss's discrimination model according to the characteristic profile of described first kind sample and Second Type sample, obtains Gauss's discriminatory analysis model.
10. pcb board pick-up unit according to claim 6, is characterized in that, described judgement unit comprises:
Input block, Local textural feature for the picture by described pcb board to be detected inputs the distribution density formula of first kind sample and the distribution density formula of Second Type sample respectively, wherein, described distribution density formula is provided by Gauss's discriminatory analysis model and model parameter; And
Judging unit, for calculating the Probability p of Local textural feature at the distribution density formula of first kind sample of the picture of described pcb board to be detected 0with the Probability p of the distribution density formula at Second Type sample 1if, p 0< p 1, then determine that described pcb board to be detected is first kind pcb board, otherwise be defined as Second Type pcb board.
CN201510134717.XA 2015-03-25 2015-03-25 A kind of pcb board detection method and device Active CN104777176B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510134717.XA CN104777176B (en) 2015-03-25 2015-03-25 A kind of pcb board detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510134717.XA CN104777176B (en) 2015-03-25 2015-03-25 A kind of pcb board detection method and device

Publications (2)

Publication Number Publication Date
CN104777176A true CN104777176A (en) 2015-07-15
CN104777176B CN104777176B (en) 2018-08-24

Family

ID=53618779

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510134717.XA Active CN104777176B (en) 2015-03-25 2015-03-25 A kind of pcb board detection method and device

Country Status (1)

Country Link
CN (1) CN104777176B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105354816A (en) * 2015-09-24 2016-02-24 广州视源电子科技股份有限公司 Electronic element positioning method and apparatus
CN106556794A (en) * 2016-11-18 2017-04-05 广州视源电子科技股份有限公司 Method and apparatus for realizing PCBA board detection
CN106815425A (en) * 2017-01-12 2017-06-09 侯海亭 Multi-layer PCB board fault detection method and system
CN110006903A (en) * 2018-01-05 2019-07-12 皓琪科技股份有限公司 Printed circuit board rechecks system, marker method and reinspection method
CN110348268A (en) * 2018-04-02 2019-10-18 鲁班嫡系机器人(深圳)有限公司 A kind of characteristic recognition method, device and the equipment of the part of electronic component
CN111539354A (en) * 2020-04-27 2020-08-14 易普森智慧健康科技(深圳)有限公司 Liquid-based cytology slide scanning area identification method
CN112504509A (en) * 2020-11-25 2021-03-16 广东电网有限责任公司佛山供电局 Power equipment temperature monitoring system and method
CN112945986A (en) * 2021-02-04 2021-06-11 鼎勤科技(深圳)有限公司 Double-sided appearance detection method of circuit board
CN113808067A (en) * 2020-06-11 2021-12-17 广东美的白色家电技术创新中心有限公司 Circuit board detection method, visual detection equipment and device with storage function
CN116026859A (en) * 2023-01-30 2023-04-28 讯芸电子科技(中山)有限公司 Method, device, equipment and storage medium for detecting installation of optoelectronic module

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101915769A (en) * 2010-06-29 2010-12-15 华南理工大学 Automatic optical inspection method for printed circuit board comprising resistance element
CN102937595A (en) * 2012-11-13 2013-02-20 浙江省电力公司电力科学研究院 Method, device and system for detecting printed circuit board (PCB)
CN103559486A (en) * 2013-11-11 2014-02-05 东南大学 Method for detecting front and back of floor through videos
CN104034729A (en) * 2014-05-19 2014-09-10 上海兴彦影像科技有限公司 Five-dimensional imaging system for circuit board separation and imaging method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101915769A (en) * 2010-06-29 2010-12-15 华南理工大学 Automatic optical inspection method for printed circuit board comprising resistance element
CN102937595A (en) * 2012-11-13 2013-02-20 浙江省电力公司电力科学研究院 Method, device and system for detecting printed circuit board (PCB)
CN103559486A (en) * 2013-11-11 2014-02-05 东南大学 Method for detecting front and back of floor through videos
CN104034729A (en) * 2014-05-19 2014-09-10 上海兴彦影像科技有限公司 Five-dimensional imaging system for circuit board separation and imaging method thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘丽 等: "局部二进制模式方法综述", 《中国图像图形学报》 *

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105354816A (en) * 2015-09-24 2016-02-24 广州视源电子科技股份有限公司 Electronic element positioning method and apparatus
WO2017050088A1 (en) * 2015-09-24 2017-03-30 广州视源电子科技股份有限公司 Method and device for locating electronic component
CN105354816B (en) * 2015-09-24 2017-12-19 广州视源电子科技股份有限公司 A kind of electronic units fix method and device
CN106556794A (en) * 2016-11-18 2017-04-05 广州视源电子科技股份有限公司 Method and apparatus for realizing PCBA board detection
CN106815425A (en) * 2017-01-12 2017-06-09 侯海亭 Multi-layer PCB board fault detection method and system
CN106815425B (en) * 2017-01-12 2018-04-27 侯海亭 multi-layer PCB board fault detection method and system
CN110006903A (en) * 2018-01-05 2019-07-12 皓琪科技股份有限公司 Printed circuit board rechecks system, marker method and reinspection method
CN110348268A (en) * 2018-04-02 2019-10-18 鲁班嫡系机器人(深圳)有限公司 A kind of characteristic recognition method, device and the equipment of the part of electronic component
CN111539354A (en) * 2020-04-27 2020-08-14 易普森智慧健康科技(深圳)有限公司 Liquid-based cytology slide scanning area identification method
CN113808067A (en) * 2020-06-11 2021-12-17 广东美的白色家电技术创新中心有限公司 Circuit board detection method, visual detection equipment and device with storage function
CN112504509A (en) * 2020-11-25 2021-03-16 广东电网有限责任公司佛山供电局 Power equipment temperature monitoring system and method
CN112504509B (en) * 2020-11-25 2023-01-24 广东电网有限责任公司佛山供电局 Power equipment temperature monitoring system and method
CN112945986A (en) * 2021-02-04 2021-06-11 鼎勤科技(深圳)有限公司 Double-sided appearance detection method of circuit board
CN116026859A (en) * 2023-01-30 2023-04-28 讯芸电子科技(中山)有限公司 Method, device, equipment and storage medium for detecting installation of optoelectronic module
CN116026859B (en) * 2023-01-30 2023-12-12 讯芸电子科技(中山)有限公司 Method, device, equipment and storage medium for detecting installation of optoelectronic module

Also Published As

Publication number Publication date
CN104777176B (en) 2018-08-24

Similar Documents

Publication Publication Date Title
CN104777176A (en) PCB detection method and apparatus thereof
Liu et al. DeepCrack: A deep hierarchical feature learning architecture for crack segmentation
CN110060237B (en) Fault detection method, device, equipment and system
CN102937595B (en) Method, device and system for detecting printed circuit board (PCB)
CN108596166A (en) A kind of container number identification method based on convolutional neural networks classification
CN109447076A (en) A kind of vehicle VIN code recognition detection method for vehicle annual test
CN107389701A (en) A kind of PCB visual defects automatic checkout system and method based on image
CN106203415B (en) bank card number automatic identification device based on digital image processing
CN105574550A (en) Vehicle identification method and device
CN107016394B (en) Cross fiber feature point matching method
CN111445459A (en) Image defect detection method and system based on depth twin network
CN111539330B (en) Transformer substation digital display instrument identification method based on double-SVM multi-classifier
CN113936280B (en) Automatic character recognition system and method for code disc of embedded instrument
CN104200215A (en) Method for identifying dust and pocking marks on surface of big-caliber optical element
CN112052730B (en) 3D dynamic portrait identification monitoring equipment and method
CN110781913A (en) Zipper cloth belt defect detection method
CN111626249A (en) Method and device for identifying geometric figure in topic image and computer storage medium
Bappy et al. Real estate image classification
CN105989600A (en) Characteristic point distribution statistics-based power distribution network device appearance detection method and system
CN111553176A (en) Wireless transmission checking method and system suitable for wiring of transformer substation cubicle
CN114429445A (en) PCB defect detection and identification method based on MAIRNet
CN110175614A (en) A kind of detection method of printed circuit board via hole inner wall quality
Zhang et al. An automatic defect detection method for TO56 semiconductor laser using deep convolutional neural network
CN115597494B (en) Precision detection method and system for prefabricated part preformed hole based on point cloud
CN109376738A (en) Altering detecting method based on vehicle VIN code start-stop symbol type

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant