CN104777176B - PCB detection method and device - Google Patents
PCB detection method and device Download PDFInfo
- Publication number
- CN104777176B CN104777176B CN201510134717.XA CN201510134717A CN104777176B CN 104777176 B CN104777176 B CN 104777176B CN 201510134717 A CN201510134717 A CN 201510134717A CN 104777176 B CN104777176 B CN 104777176B
- Authority
- CN
- China
- Prior art keywords
- pcb board
- sample
- picture
- window
- 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.)
- Active
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 34
- 238000004458 analytical method Methods 0.000 claims abstract description 46
- 238000011068 loading method Methods 0.000 claims abstract description 21
- 238000009826 distribution Methods 0.000 claims description 38
- 238000000605 extraction Methods 0.000 claims description 34
- 239000000284 extract Substances 0.000 claims description 7
- 238000004364 calculation method Methods 0.000 claims description 6
- 239000004744 fabric Substances 0.000 claims 1
- 230000008901 benefit Effects 0.000 abstract description 5
- 238000000034 method Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 9
- 230000006872 improvement Effects 0.000 description 8
- 238000004422 calculation algorithm Methods 0.000 description 4
- 238000004519 manufacturing process Methods 0.000 description 4
- 230000007547 defect Effects 0.000 description 3
- 238000005286 illumination Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 238000012549 training Methods 0.000 description 2
- 238000004590 computer program Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000004069 differentiation Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000009021 linear effect Effects 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 230000008439 repair process Effects 0.000 description 1
- 238000012552 review Methods 0.000 description 1
- 230000006641 stabilisation Effects 0.000 description 1
- 238000011105 stabilization Methods 0.000 description 1
- 238000003860 storage Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Landscapes
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses a PCB detection method, which comprises the following steps: establishing a Gaussian discriminant analysis model based on local texture features of samples, wherein the samples comprise a first type sample and a second type sample, the first type sample is a PCB without neglected loading elements, and the second type sample is a PCB with at least one neglected loading element; acquiring a picture of a PCB to be detected, and extracting 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 identification efficiency, temperature detection and the like.
Description
Technical field
The present invention relates to testing field more particularly to a kind of pcb board detection method and device.
Background technology
Printed circuit board (Printed Circuit Board, PCB) is the supplier of electronic component electrical connection,
On multiple element is installed, and these elements are formed by connecting according to pre-set Logic Circuit Design, to realize specific work(
Energy.Due to producing and processing or the various situations that are likely to occur in assembly, may cause on certain pcb boards neglected loading one or
Multiple element, to cause these pcb boards to can not work normally or run, these pcb boards that can not work normally or run need
It is detected, re-starts reparation.
Existing detection method mainly has artificial detection method and template matching method, for artificial detection method, due to pcb board
Element in quantity and every piece of pcb board is numerous, thus only relies on manual method and be difficult to pick out the PCB of these neglected loadings element
Plate, and be easy to cause detection result to decline due to artificial fatigue;And template matches are based on " having element " and " leakage is inserted " two point Linears
Matching, cannot make full use of known sample information, cause algorithm stability inadequate, cannot satisfy the use demand.
Invention content
In view of the above-mentioned problems, the purpose of the present invention is to provide a kind of pcb board detection method and device, high identification can be provided
The detection of efficiency, stabilization.
The embodiment of the present invention provides a kind of pcb board detection method, includes the following steps:
Local textural feature based on sample establishes Gauss discriminant analysis model, wherein the sample includes the first kind
Sample and Second Type sample, the first kind sample are the pcb board of no neglected loading element, and the Second Type sample is leakage
The pcb board of at least one element is filled;
The picture of pcb board to be detected is obtained, and extracts the Local textural feature of the picture of the pcb board to be detected;
And
According to the Local textural feature of the picture of the pcb board to be detected and the Gauss discriminant analysis mould of the foundation
Type determines the type of the pcb board to be detected.
As the improvement of said program, the Local textural feature based on sample establishes Gauss discriminant analysis model, packet
It includes:
Acquire the picture of several first kind samples and several Second Type samples;
Extract the Local textural feature of the samples pictures of the acquisition;And
Gauss discriminant analysis model is established using the Local textural feature of the extraction.
As the improvement of said program, the Local textural feature of the samples pictures of the extraction acquisition, including:
Utilize the picture of one 3 × 3 scanning window scanning collections, wherein the scanning window includes 9 child windows, each
Child window obtains the grey scale pixel value of the point on the picture that the child window is currently located in scanning;
By positioned at the grey scale pixel value of the grey scale pixel value of eight non-central child windows and centrally located child window into
Row compares, if being greater than or equal to the pixel grey scale of centrally located child window positioned at the grey scale pixel value of non-central child window
Value, then be set to 1 by the numerical value in the child window, be otherwise set to 0;
The mobile scanning window, obtains whole Local textural features of the picture on the picture.
As the improvement of said program, the Local textural feature using extraction establishes Gauss discriminant analysis model, has
Body includes:
The Local textural feature of extraction is projected in two-dimensional coordinate, is obtained about first kind sample and Second Type sample
This characteristic profile;And
The model of Gauss discrimination model is calculated according to the characteristic profile of the first kind sample and Second Type sample
Parameter obtains Gauss discriminant analysis model.
As the improvement of said program, the Local textural feature of the picture according to the pcb board to be detected and institute
The Gauss discriminant analysis model for stating foundation determines the type of the pcb board to be detected, including:
The Local textural feature of the picture of the pcb board to be detected is inputted to the distribution density of first kind sample respectively
The distribution density formula of formula and Second Type sample, wherein the distribution density formula is by Gauss discriminant analysis model and mould
Shape parameter provides;And
Calculate distribution density formula of the Local textural feature in first kind sample of the picture of the pcb board to be detected
Probability p0With the Probability p of the distribution density formula in Second Type sample1If p0< p1, it is determined that the PCB to be detected
Plate is first kind pcb board, is otherwise determined as Second Type pcb board.
The present invention also provides a kind of pcb board detection device, including model foundation unit, feature extraction unit and differentiation are single
Member, wherein:
The model foundation unit establishes Gauss discriminant analysis model for the Local textural feature based on sample, wherein
The sample includes first kind sample and Second Type sample, and the first kind sample is the pcb board of no neglected loading element,
The Second Type sample is the neglected loading pcb board of at least one element;
The feature extraction unit, the Local textural feature of the picture for extracting pcb board to be detected;And
The judgement unit is used for the Local textural feature of the picture according to the pcb board to be detected and the foundation
Gauss discriminant analysis model, determine the type of the pcb board to be detected.
As the improvement of said program, the model foundation unit includes:
Collecting unit, the picture for acquiring several first kind samples and several Second Type samples;
Extraction unit, the Local textural feature of the samples pictures for extracting the acquisition;And
Modeling unit, for establishing Gauss discriminant analysis model using the Local textural feature of the extraction.
As the improvement of said program, the feature extraction unit includes:
Scanning element, for the picture using one 3 × 3 scanning window scanning collections, wherein the scanning window includes 9
A child window, each child window obtain the grey scale pixel value of the point on the picture that the child window is currently located in scanning;
Comparing unit, the grey scale pixel value for eight non-central child windows will to be located at and centrally located child window
Grey scale pixel value is compared, if the grey scale pixel value positioned at non-central child window is greater than or equal to centrally located child window
Grey scale pixel value, then the numerical value in the child window be set to 1, be otherwise set to 0;
Mobile unit obtains whole local grains of the picture for the mobile scanning window on the picture
Feature.
As the improvement of said program, the modeling unit specifically includes:
Projecting cell is obtained for projecting to the Local textural feature of extraction in two-dimensional coordinate about first kind pattern
The characteristic profile of this and Second Type sample;
Parameter calculation unit is high for being calculated according to the characteristic profile of the first kind sample and Second Type sample
The model parameter of this discrimination model obtains Gauss discriminant analysis model.
As the improvement of said program, the judgement unit includes:
Input unit, for the Local textural feature of the picture of the pcb board to be detected to be inputted the first kind respectively
The distribution density formula of sample and the distribution density formula of Second Type sample, wherein the distribution density formula is sentenced by Gauss
Other analysis model and model parameter provide;And
Judging unit, for calculate the pcb board to be detected picture Local textural feature in first kind sample
Distribution density formula Probability p0With the Probability p of the distribution density formula in Second Type sample1If p0< p1, it is determined that institute
It is first kind pcb board to state pcb board to be detected, is otherwise determined as Second Type pcb board.
Pcb board detection method and device provided in an embodiment of the present invention, by extracting the Local textural feature of pcb board, and
The Gauss discriminant analysis model based on Local textural feature is established, first kind sample and Second Type sample are respectively built
Mould takes full advantage of the Given information of sample so that algorithmic stability, since model has considered the known letter of all samples
Breath, so algorithm institute is little affected when extreme case occurs in given sample.In addition, this method also has to illumination condition
It is insensitive, small, the advantages that not needing additional creation data, is interfered to production process, is solved in the prior art by manually knowing
The problem that recognition efficiency is low caused by the defect of other pcb board, subjectivity is strong.
Description of the drawings
In order to illustrate more clearly of technical scheme of the present invention, attached drawing needed in embodiment will be made below
Simply introduce, it should be apparent that, the accompanying drawings in the following description is only some embodiments of the present invention, general for this field
For logical technical staff, without creative efforts, other drawings may also be obtained based on these drawings.
Fig. 1 is the flow diagram that the embodiment of the present invention provides pcb board detection method.
Fig. 2 is the schematic diagram for the grey scale pixel value that scanning window scans.
Fig. 3 is to the schematic diagram after scanning window and then binarization.
Fig. 4 is the mark value schematic diagram of scanning window.
Fig. 5 is the histogram after being normalized to Local textural feature.
Fig. 6 is the characteristic profile of first kind sample and Second Type sample.
Fig. 7 is the structural schematic diagram that the embodiment of the present invention provides pcb board detection device.
Fig. 8 is the structural schematic diagram of model foundation unit shown in Fig. 7.
Fig. 9 is the structural schematic diagram of the second extraction unit shown in Fig. 8.
Figure 10 is the structural schematic diagram of modeling unit shown in Fig. 8.
Figure 11 is the structural schematic diagram of judgement unit shown in Fig. 7.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
Referring to Fig. 1, the embodiment of the present invention provides a kind of pcb board detection method, following steps are included at least:
S101, the Local textural feature based on sample establish Gauss discriminant analysis model, wherein the sample includes first
Type sample and Second Type sample, the first kind sample are the pcb board of no neglected loading element, the Second Type sample
For the pcb board of at least one element of neglected loading.
In embodiments of the present invention, multiple members are installed on printed circuit board (Printed Circuit Board, PCB)
Part, and these elements are formed by connecting according to pre-set Logic Circuit Design, to realize specific function.Wherein, due to life
Production processing or the various situations that are likely to occur in assembly may lead on certain pcb boards the one or more elements of neglected loading,
To cause these pcb boards to can not work normally or run, these pcb boards that can not work normally or run need to be detected
Come, re-starts reparation.However since the element in the quantity of pcb board and every piece of pcb board is numerous, thus only rely on manual method
It is difficult to detect by the pcb board of these neglected loadings element.
In embodiments of the present invention, can be used in conjunction with the Local textural feature of the picture of acquisition and Gauss discriminant analysis model
Judge whether one piece of pcb board the case where leaking inserted component occurs, specially:
S1011 acquires the picture of several first kind samples and several Second Type samples.
In embodiments of the present invention, camera (can be black and white or colour imagery shot), which acquires several, does not have neglected loading element
Pcb board (first kind sample) and several neglected loadings picture of the pcb board of at least one element (Second Type sample), with logical
It crosses and picture is handled, obtain the Local textural feature of picture, calculated to carry out subsequent analysis.Wherein, the figure of acquisition
The number of piece can be configured according to the actual needs, such as can be 20,30 or other quantity, and the present invention is not specifically limited.
S1012 extracts the Local textural feature of the samples pictures of the acquisition.
In embodiments of the present invention, after having acquired the samples pictures, the Local textural feature of these pictures need to be extracted, is had
Body is:
First, the picture of one 3 × 3 scanning window scanning collections is utilized, wherein the scanning window includes 9 child windows,
Each child window obtains the grey scale pixel value of the pixel on the picture that the child window is currently located in scanning.
Also referring to Fig. 2, in embodiments of the present invention, the scanning window can be soft by specific scanner or scanning
Scanning function is realized in the combination of part or the two.Wherein, which is in a square window shape, and big with 9
Small identical child window, wherein preferably, the size of each child window is the size of a pixel on picture, when this is swept
When retouching window and scanning the samples pictures, each child window is just corresponding and Covering samples picture on a pixel, and can
Obtain the grey scale pixel value of this pixel.As shown in Fig. 2, the scanning result that Fig. 2 is obtained after being scanned for the scanning window,
In, the number in each child window represents the grey scale pixel value for the pixel that this child window scans.
It secondly, will be positioned at the pixel grey scale of the grey scale pixel value and centrally located child window of eight non-central child windows
Value is compared, if being greater than or equal to the pixel ash of centrally located child window positioned at the grey scale pixel value of non-central child window
Numerical value in the child window is then set to 1, is otherwise set to 0 by angle value.
It need to be to the scanning window after obtaining the grey scale pixel value by scanned samples picture also referring to Fig. 3
Carry out binarization.Specifically, positioned at eight non-central child windows grey scale pixel value respectively with centrally located child window
Grey scale pixel value be compared, if positioned at non-central child window grey scale pixel value be greater than or equal to centrally located sub- window
Mouthful grey scale pixel value, then the numerical value in the child window be set to 1, be otherwise set to 0.As shown in figure 3, centrally located child window
Grey scale pixel value is 5, if the grey scale pixel value in non-central child window is greater than or equal to 5, by this child window
Numerical value is set to 1, if the grey scale pixel value in non-central child window is less than 5, the numerical value of this child window is set to 0.
In addition, after completing binarization, the numerical value for the child window that will also be located in center is set to sky, i.e., is not put into any numerical value.
Finally, the mobile scanning window on the picture, obtains whole Local textural features of the picture.
In embodiments of the present invention, shown scanning window continuous scanning on the picture, obtains the whole of the picture
Local textural feature.Wherein, the distance of each mobile pixel of the scanning window.For example, it is assumed that the picture is big
Small is 102 × 102, since the scanning window only moves a pixel, thus the direction that the scanning window will be expert at every time
With it is 100 times all mobile on the direction of row, i.e., scanning is obtained 100 × 100=10000 local grain spy by the described scanning window
Sign.As shown in figure 5, the Local textural feature can carry out statistics with histogram, and histogram feature is obtained by normalization,
In, the abscissa of histogram is the value (ranging from 0~255) of Local textural feature, and ordinate is probability (ranging from 0~1), and
It is that all ordinates add up and be 1.
S1013 establishes Gauss discriminant analysis model using the Local textural feature of the extraction.
Specially:
First, the Local textural feature of extraction is projected in two-dimensional coordinate, is obtained about first kind sample and second
The characteristic profile of type sample.
Also referring to Fig. 6, the Local textural feature extracted above is projected in two-dimensional coordinate, is obtained shown in fig. 6
Sample characteristics distribution map.Wherein label symbol be × expression first kind sample, label symbol be zero expression Second Type
Sample.
Then, Gauss discrimination model is calculated according to the characteristic profile of the first kind sample and Second Type sample
Model parameter obtains Gauss discriminant analysis model.
Specially:
Assuming that the Local textural feature x of input is continuous random variable, and Normal Distribution, and the output variable y that classifies
Bernoulli Jacob's distribution is obeyed, wherein y=0 indicates that Second Type sample, y=1 indicate first kind sample, then have following formula:
Y~Bernoulli (φ)
X | y=0~N (μ0,Σ) (1)
X | y=1~N (μ1,Σ)
Shown in specific probability density distribution such as formula (2):
P (y)=φy(1-φ)1-y
In formula, p (y) is the probability that output is y, and p (x | y=0) is to export the probability of y=0 at given x, and p (x | y
=1) it is to export the probability of y=1 at given x.Gauss discriminant analysis model parameter is calculated by formula (3):
Wherein, φ is the ratio that result y=1 occupies in training sample, μ0Be y=0 sample in characteristic mean, μ1It is y=
Characteristic mean in 1 sample, Σ are sample characteristics mean variances.M is the sample currently chosen, it is assumed for example that acquires 20 altogether
A first kind sample and 20 Second Type samples, then m=40.y(i)=1 indicates that the sample is first kind sample, y(i)=
0 indicates that the sample is Second Type sample.
In embodiments of the present invention, by calculating above-mentioned model parameter, you can obtain the Gauss discrimination model.
S102, obtains the picture of pcb board to be detected, and extracts the local grain of the picture of the pcb board to be detected
Feature.
In embodiments of the present invention, using method identical with the process of the Local textural feature of said extracted sample, i.e.,
It can extract the Local textural feature of the picture of pcb board to be detected.
S103 differentiates according to the Local textural feature of the picture of the pcb board to be detected and the Gauss of the foundation and divides
Model is analysed, determines the type of the pcb board to be detected.
Specially:
First, the Local textural feature of the picture of the pcb board to be detected is inputted into the general of first kind sample respectively
The distribution density formula of rate Density Distribution formula and Second Type sample, wherein the probability density distribution is differentiated by Gauss to be divided
Analysis model and model parameter provide.
In embodiments of the present invention, the Local textural feature x input formula (2) of the PCB image to be detected extracted are built
Vertical Gauss discriminant analysis model.
Then, the Local textural feature for calculating the picture of the pcb board to be detected is close in the distribution of first kind sample
Spend the Probability p of formula0With the Probability p of the distribution density formula in Second Type sample1If p0< p1, then described to be detected
Pcb board is first kind pcb board, is otherwise Second Type pcb board.
Specifically, calculating first:
P (x | y=0)=p0
P (x | y=1)=p1 (4)
Then compare the p for calculating and obtaining0And p1Size, if p0< p1, then it is assumed that pcb board to be detected is by detection, i.e.,
There is not the case where leaking inserted component (being first kind pcb board) in this pcb board to be detected;Otherwise, then it is assumed that this is to be checked
Surveying pcb board has leakage inserted component (being Second Type pcb board), needs to further review or repair.
Pcb board detection method provided in an embodiment of the present invention by extracting the Local textural feature of pcb board, and establishes base
In the Gauss discriminant analysis model of Local textural feature, first kind sample and Second Type sample are respectively modeled, filled
Divide the Given information that sample is utilized so that algorithmic stability, since model has considered the Given information of all samples, so
When extreme case occurs in given sample, algorithm institute is little affected.In addition, this method also have to illumination condition it is insensitive,
Small, the advantages that not needing additional creation data, is interfered to production process, is solved in the prior art through manual identified pcb board
Defect caused by recognition efficiency is low, subjectivity is strong problem.
Referring to Fig. 7, the embodiment of the present invention also provides a kind of pcb board detection device 100, the pcb board detection device 100
Including model foundation unit 10, the first extraction unit 20 and judgement unit 30, wherein:
The model foundation unit 10 establishes Gauss discriminant analysis model for the Local textural feature based on sample,
In, the sample includes first kind sample and Second Type sample, and the first kind sample is the PCB of no neglected loading element
Plate, the Second Type sample are the neglected loading pcb board of at least one element.
Also referring to Fig. 8, specifically, the model foundation unit 10 includes collecting unit 11, the second extraction unit 12
And modeling unit 13, wherein:
The collecting unit 11, the picture for acquiring several first kind samples and several Second Type samples.
In embodiments of the present invention, the collecting unit 11 can be camera, and being used to acquire several does not have neglected loading first
The pcb board (first kind sample) of part and several neglected loadings picture of the pcb board of at least one element (Second Type sample),
By handling picture, to obtain the Local textural feature of picture, be calculated to carry out subsequent analysis.Wherein, it acquires
The number of picture can be configured according to the actual needs, such as can be 20,30 or other quantity, the present invention does not do specific limit
It is fixed.
Second extraction unit 12, the Local textural feature of the samples pictures for extracting the acquisition.
Also referring to Fig. 9, specially:Second extraction unit 12 includes:
Scanning element 121, for the picture using one 3 × 3 scanning window scanning collections, wherein the scanning window packet
Containing 9 child windows, each child window obtains the grey scale pixel value of the point on the picture that the child window is currently located in scanning.
Also referring to Fig. 2, in embodiments of the present invention, the scanning element 121 can form one 3 × 3 scanning windows, institute
It is in a square window shape to state 3 × 3 scanning windows, and has the identical child window of 9 sizes, wherein preferably, every sub- window
The size of mouth is the size of a pixel on picture, when the scanning window scans the samples pictures, each child window
A just pixel on corresponding and Covering samples picture, and can get the grey scale pixel value of this pixel.Such as Fig. 2 institutes
Show, Fig. 2 is the scanning result obtained after the scanning window scans, wherein the number in each child window represents this sub- window
The grey scale pixel value for the pixel that mouth scans.
Comparing unit 122, the grey scale pixel value for eight non-central child windows will to be located at and centrally located sub- window
The grey scale pixel value of mouth is compared, if the grey scale pixel value positioned at non-central child window is greater than or equal to centrally located son
The grey scale pixel value of window, then the numerical value in the child window be set to 1, be otherwise set to 0.
Also referring to Fig. 3, after 121 scanned samples picture of the scanning element obtains the grey scale pixel value, need pair
The scanning window carries out binarization.Specifically, the comparing unit 122 will be positioned at the pixel of eight non-central child windows
Gray value is compared with the grey scale pixel value of centrally located child window respectively, if positioned at the pixel ash of non-central child window
Angle value is greater than or equal to the grey scale pixel value of centrally located child window, then the comparing unit 122 is by the number in the child window
Value is set to 1, is otherwise set to 0.As shown in figure 3, the grey scale pixel value of centrally located child window is 5, if being located at non-central son
Grey scale pixel value in window is greater than or equal to 5, then the numerical value of this child window is set to 1 by the comparing unit 122, if being located at
Grey scale pixel value in non-central child window is less than 5, then the numerical value of this child window is set to 0 by the comparing unit 122.This
Outside, after completing binarization, the numerical value that the comparing unit 122 will also be located in the child window at center is set to sky, i.e., is not put into
Any numerical value.
Mobile unit 124 obtains all local line of the picture for the mobile scanning window on the picture
Manage feature.
The modeling unit 13, for establishing Gauss discriminant analysis model using the Local textural feature of the extraction.
Also referring to Figure 10, specifically, the modeling unit 13 includes projecting cell 131 and parameter calculation unit 132,
Wherein:
The Local textural feature of extraction is projected in two-dimensional coordinate, is obtained about the first kind by the projecting cell 131
The characteristic profile of sample and Second Type sample.
Also referring to Fig. 6, the Local textural feature extracted above is projected to two-dimensional coordinate by the projecting cell 131
In, obtain sample characteristics distribution map shown in fig. 6.Wherein label symbol be × expression first kind sample, label symbol is
Zero expression Second Type sample.
The parameter calculation unit 132, for the feature distribution according to the first kind sample and Second Type sample
Figure calculates the model parameter of Gauss discrimination model, obtains Gauss discriminant analysis model.
Specifically, the parameter calculation unit 132 assumes that the Local textural feature x of input is continuous random variable, and take
From normal distribution, and the output variable y that classifies obeys Bernoulli Jacob's distribution, and wherein y=0 indicates Second Type sample, and y=1 indicates the
A kind of pattern sheet, then have following formula:
Y~Bernoulli (φ)
X | y=0~N (μ0,Σ) (1)
X | y=1~N (μ1,Σ)
Shown in specific probability density distribution such as formula (2):
P (y)=φy(1-φ)1-y
In formula, p (y) is the probability that output is y, and p (x | y=0) is to export the probability of y=0 at given x, and p (x | y
=1) it is to export the probability of y=1 at given x.Gauss discriminant analysis model parameter is calculated by formula (3):
Wherein, φ is the ratio that result y=1 occupies in training sample, μ0Be y=0 sample in characteristic mean, μ1It is y=
Characteristic mean in 1 sample, Σ are sample characteristics mean variances.M is the sample currently chosen, it is assumed for example that acquires 20 altogether
A first kind sample and 20 Second Type samples, then m=40.y(i)=1 indicates that the sample is first kind sample, y(i)=
0 indicates that the sample is Second Type sample.
First extraction unit 20, the Local textural feature of the picture for extracting pcb board to be detected.
In embodiments of the present invention, the operation principle of first extraction unit 20 and 12 class of the second extraction unit
Seemingly, details are not described herein.
The judgement unit 30, for according to the Local textural feature of the picture of the pcb board to be detected and described building
Vertical Gauss discriminant analysis model, determines the type of the pcb board to be detected.
Also referring to Figure 11, specifically, the judgement unit 30 includes feature input unit 31 and judging unit 32,
In,
The feature input unit 31, for the Local textural feature difference of the picture of the pcb board to be detected is defeated
Enter the distribution density formula of first kind sample and the distribution density formula of Second Type sample, wherein the distribution density is public
Formula is provided by Gauss discriminant analysis model and model parameter.
The judging unit 32, for calculate the pcb board to be detected picture Local textural feature in the first kind
The Probability p of the distribution density formula of pattern sheet0With the Probability p of the distribution density formula in Second Type sample1If p0< p1, then
The pcb board to be detected is first kind pcb board, is otherwise Second Type pcb board.
Pcb board detection device provided in an embodiment of the present invention by extracting the Local textural feature of pcb board, and establishes base
In the Gauss discriminant analysis model of Local textural feature, first kind sample and Second Type sample are respectively modeled, filled
Divide the Given information that sample is utilized so that algorithmic stability, since model has considered the Given information of all samples, so
When extreme case occurs in given sample, algorithm institute is little affected.In addition, this method also have to illumination condition it is insensitive,
Small, the advantages that not needing additional creation data, is interfered to production process, is solved in the prior art through manual identified pcb board
Defect caused by recognition efficiency is low, subjectivity is strong problem.
It is above disclosed to be only a preferred embodiment of the present invention, the power of the present invention cannot be limited with this certainly
Sharp range, those skilled in the art can understand all or part of the processes for realizing the above embodiment, and is weighed according to the present invention
Equivalent variations made by profit requirement, still belong to the scope covered by the invention.
One of ordinary skill in the art will appreciate that realizing all or part of flow in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the program can be stored in a computer read/write memory medium
In, the program is when being executed, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic
Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access
Memory, RAM) etc..
Claims (10)
1. a kind of pcb board detection method, which is characterized in that include the following steps:
Local textural feature based on sample establishes Gauss discriminant analysis model, wherein the sample includes first kind sample
With Second Type sample, the first kind sample is the pcb board of no neglected loading element, and the Second Type sample is neglected loading
The pcb board of at least one element;
The picture of pcb board to be detected is obtained, and extracts the Local textural feature of the picture of the pcb board to be detected;And
According to the Local textural feature of the picture of the pcb board to be detected and the Gauss discriminant analysis model of the foundation, really
The type of the fixed pcb board to be detected.
2. pcb board detection method according to claim 1, which is characterized in that the Local textural feature based on sample
Gauss discriminant analysis model is established, including:
Acquire the picture of several first kind samples and several Second Type samples;
Extract the Local textural feature of the samples pictures of the acquisition;And
Gauss discriminant analysis model is established using the Local textural feature of the extraction.
3. pcb board detection method according to claim 2, which is characterized in that the samples pictures of the extraction acquisition
Local textural feature, including:
Utilize the picture of one 3 × 3 scanning window scanning collections, wherein the scanning window includes 9 child windows, every sub- window
Mouth obtains the grey scale pixel value of the point on the picture that the child window is currently located in scanning;
It will compare positioned at the grey scale pixel value of the grey scale pixel value and centrally located child window of eight non-central child windows
Compared with, if being greater than or equal to the grey scale pixel value of centrally located child window positioned at the grey scale pixel value of non-central child window,
Numerical value in the child window is set to 1, is otherwise set to 0;
The Local textural feature of present scan window extraction is obtained using formula, whereinX is the numerical value in non-central child window, and p is the mark value of the child window, wherein is located at the upper left corner
The mark value of child window be 1, the mark value of remaining non-central child window is incremented by the direction of the clock, every time incrementally 1;And
The mobile scanning window, obtains whole Local textural features of the picture on the picture.
4. pcb board detection method according to claim 2, which is characterized in that the Local textural feature using extraction
Gauss discriminant analysis model is established, is specifically included:
The Local textural feature of extraction is projected in two-dimensional coordinate, is obtained about first kind sample and Second Type sample
Characteristic profile;And
The model parameter of Gauss discrimination model is calculated according to the characteristic profile of the first kind sample and Second Type sample,
Obtain Gauss discriminant analysis model.
5. pcb board detection method according to claim 1, which is characterized in that described according to the pcb board to be detected
The Local textural feature of picture and the Gauss discriminant analysis model of the foundation, determine the type of the pcb board to be detected, packet
It includes:
The Local textural feature of the picture of the pcb board to be detected is inputted to the distribution density formula of first kind sample respectively
With the distribution density formula of Second Type sample, wherein the distribution density formula is joined by Gauss discriminant analysis model and model
Number provides;And
Calculate the Local textural feature of the picture of the pcb board to be detected first kind sample distribution density formula it is general
Rate p0With the Probability p of the distribution density formula in Second Type sample1If p0< p1, it is determined that the pcb board to be detected is
Otherwise first kind pcb board is determined as Second Type pcb board.
6. a kind of pcb board detection device, which is characterized in that including model foundation unit, the first extraction unit and judgement unit,
In:
The model foundation unit establishes Gauss discriminant analysis model, wherein described for the Local textural feature based on sample
Sample includes first kind sample and Second Type sample, and the first kind sample is the pcb board of no neglected loading element, described
Second Type sample is the neglected loading pcb board of at least one element;
First extraction unit, the Local textural feature of the picture for extracting pcb board to be detected;And
The judgement unit is used for the Local textural feature according to the picture of the pcb board to be detected and the height of the foundation
This discriminant analysis model determines the type of the pcb board to be detected.
7. pcb board detection device according to claim 6, which is characterized in that the model foundation unit includes:
Collecting unit, the picture for acquiring several first kind samples and several Second Type samples;
Second extraction unit, the Local textural feature of the samples pictures for extracting the acquisition;And
Modeling unit, for establishing Gauss discriminant analysis model using the Local textural feature of the extraction.
8. pcb board detection device according to claim 7, which is characterized in that second extraction unit includes:
Scanning element, for the picture using one 3 × 3 scanning window scanning collections, wherein the scanning window includes 9 sons
Window, each child window obtain the grey scale pixel value of the point on the picture that the child window is currently located in scanning;
Comparing unit, for the pixel of the grey scale pixel value and centrally located child window of eight non-central child windows will to be located at
Gray value is compared, if being greater than or equal to the picture of centrally located child window positioned at the grey scale pixel value of non-central child window
Plain gray value, then the numerical value in the child window be set to 1, be otherwise set to 0;
Feature calculation unit, the local grain for calculating the extraction of present scan window using formula
Feature, whereinX is the numerical value in non-central child window, and p is the mark value of the child window, wherein
Mark value positioned at the child window in the upper left corner is 1, and the mark value of remaining non-central child window is incremented by the direction of the clock, passs every time
Increase 1;And
Mobile unit obtains whole Local textural features of the picture for the mobile scanning window on the picture.
9. pcb board detection device according to claim 7, which is characterized in that the modeling unit specifically includes:
Projecting cell, for the Local textural feature of extraction to be projected in two-dimensional coordinate, obtain about first kind sample and
The characteristic profile of Second Type sample;
Parameter calculation unit is sentenced for calculating Gauss according to the characteristic profile of the first kind sample and Second Type sample
The model parameter of other model obtains Gauss discriminant analysis model.
10. pcb board detection device according to claim 6, which is characterized in that the judgement unit includes:
Input unit, for the Local textural feature of the picture of the pcb board to be detected to be inputted first kind sample respectively
Distribution density formula and Second Type sample distribution density formula, wherein the distribution density formula by Gauss differentiate point
Analysis model and model parameter provide;And
Judging unit, for calculate the pcb board to be detected picture Local textural feature first kind sample point
The Probability p of cloth density formula0With the Probability p of the distribution density formula in Second Type sample1If p0< p1, it is determined that it is described to wait for
The pcb board of detection is first kind pcb board, is otherwise determined as Second Type pcb board.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510134717.XA CN104777176B (en) | 2015-03-25 | 2015-03-25 | PCB 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 | PCB detection method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104777176A CN104777176A (en) | 2015-07-15 |
CN104777176B true 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 | PCB detection method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104777176B (en) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105354816B (en) * | 2015-09-24 | 2017-12-19 | 广州视源电子科技股份有限公司 | Electronic component positioning method and device |
CN106556794A (en) * | 2016-11-18 | 2017-04-05 | 广州视源电子科技股份有限公司 | Method and device for realizing PCBA board detection |
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 |
CN111539354B (en) * | 2020-04-27 | 2020-12-15 | 易普森智慧健康科技(深圳)有限公司 | Liquid-based cytology slide scanning area identification method |
CN113808067B (en) * | 2020-06-11 | 2024-07-05 | 广东美的白色家电技术创新中心有限公司 | Circuit board detection method, visual detection equipment and device with storage function |
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 |
CN116026859B (en) * | 2023-01-30 | 2023-12-12 | 讯芸电子科技(中山)有限公司 | Method, device, equipment and storage medium for detecting installation of optoelectronic module |
Citations (4)
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 |
-
2015
- 2015-03-25 CN CN201510134717.XA patent/CN104777176B/en active Active
Patent Citations (4)
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)
Title |
---|
局部二进制模式方法综述;刘丽 等;《中国图像图形学报》;20141231;第19卷(第12期);第1697-1718页 * |
Also Published As
Publication number | Publication date |
---|---|
CN104777176A (en) | 2015-07-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104777176B (en) | PCB detection method and device | |
Odone et al. | Building kernels from binary strings for image matching | |
CN108596166A (en) | A kind of container number identification method based on convolutional neural networks classification | |
CN112766184B (en) | Remote sensing target detection method based on multi-level feature selection convolutional neural network | |
CN105574550A (en) | Vehicle identification method and device | |
US20060029257A1 (en) | Apparatus for determining a surface condition of an object | |
CN110059702B (en) | Object contour recognition method and device | |
CN110119680A (en) | A kind of electrical cabinet wiring automatic errordetecting system based on image recognition | |
CN112560675B (en) | Bird visual target detection method combining YOLO and rotation-fusion strategy | |
CN109948566A (en) | A kind of anti-fraud detection method of double-current face based on weight fusion and feature selecting | |
CN109087294A (en) | A kind of product defects detection method, system and computer readable storage medium | |
CN108268865A (en) | Licence plate recognition method and system under a kind of natural scene based on concatenated convolutional network | |
CN109738450A (en) | The detection method and device of keyboard of notebook computer | |
CN115170567B (en) | Method for detecting defects of waterproof steel plate for ship | |
CN117974601B (en) | Method and system for detecting surface defects of silicon wafer based on template matching | |
CN110175614A (en) | A kind of detection method of printed circuit board via hole inner wall quality | |
CN109426793A (en) | A kind of image behavior recognition methods, equipment and computer readable storage medium | |
CN116740758A (en) | Bird image recognition method and system for preventing misjudgment | |
CN111368775A (en) | Complex scene dense target detection method based on local context sensing | |
CN116777877A (en) | Circuit board defect detection method, device, computer equipment and storage medium | |
Lauziere et al. | A model-based road sign identification system | |
Imran et al. | Image-based automatic energy meter reading using deep learning | |
CN114120220A (en) | Target detection method and device based on computer vision | |
CN116486212A (en) | Water gauge identification method, system and storage medium based on computer vision | |
CN104298987B (en) | The Handwritten Digit Recognition method of online FCM clusters is weighted based on dot density |
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 |