CN105139397B - A kind of pcb board detection method and device - Google Patents
A kind of pcb board detection method and device Download PDFInfo
- Publication number
- CN105139397B CN105139397B CN201510527487.3A CN201510527487A CN105139397B CN 105139397 B CN105139397 B CN 105139397B CN 201510527487 A CN201510527487 A CN 201510527487A CN 105139397 B CN105139397 B CN 105139397B
- Authority
- CN
- China
- Prior art keywords
- pcb board
- designated area
- image
- threshold
- zero pixels
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
- Quality & Reliability (AREA)
Abstract
The invention discloses a kind of pcb board detection method, comprise the following steps:Gather the image of designated area on the transmission plane of conveyer belt;Described image is handled using Canny operators to obtain edge image, wherein, the Canny operators include two parameters of high threshold and Low threshold, and the high threshold and Low threshold are according to the Pixel Information adaptive generation of described image;Count the number of the non-zero pixels in the edge image;According to the number of the non-zero pixels and the magnitude relationship of at least one default threshold value, the degree that the pcb board enters the designated area is detected.The present invention also provides a kind of pcb board detection means.Pcb board detection method and device provided by the invention have very strong robustness, improve the efficiency and quality of PCB detections, realize the increasingly automated of PCB detections.
Description
Technical field
The present invention relates to PCB automatic optics inspections field, specifically a kind of pcb board detection method device.
Background technology
PCB detection means is used as using automatic optics inspection technology (Automatic Optical Inspection, AOI)
It has been trend of the times.The technology mainly includes:IMAQ, image procossing, feature extraction and decision-making judge four steps, its
In, generally require to carry out initial analysis to the original image collected in the step for image procossing, to judge original image
In whether include complete pcb board, this to improve PCB detection efficiency and quality play vital effect.It is but existing
Image procossing scheme the problems such as robustness is low, calculating speed is slow, complex operation often be present, requirement can not be met.
The content of the invention
In view of the above-mentioned problems, it is an object of the invention to provide a kind of pcb board detection method and device, realize it is quick,
Accurate pcb board detection, meets requirement.
The embodiment of the present invention provides a kind of pcb board detection method, comprises the following steps:
Gather the image of designated area on the transmission plane of conveyer belt;
Described image is handled using Canny operators to obtain edge image, wherein, the Canny operators include height
Two parameters of threshold value and Low threshold, and the high threshold and Low threshold are according to the Pixel Information adaptive generation of described image;
Count the number of the non-zero pixels in the edge image;
According to the number of the non-zero pixels and the magnitude relationship of at least one default threshold value, detect the pcb board and enter
Enter the degree of the designated area.
As the improvement of such scheme, on the transmission plane of the collection conveyer belt after the image of designated area, in institute
State before being handled to obtain edge image to described image using Canny operators, in addition to:
The size of described image is normalized.
It is described that described image is handled using Canny operators to obtain edge image as the improvement of such scheme, its
In, the Canny operators include two parameters of high threshold and Low threshold, and the high threshold and Low threshold are according to described image
Pixel Information adaptive generation, is specifically included:
The pixel span of described image is obtained, wherein, the pixel span is [Imin, Imax];
The pixel median m of described image is calculated, wherein, the pixel median m is to press each pixel value of described image
After size is ranked up, sequence number is positioned at middle pixel value;
The high threshold and Low threshold are generated, wherein, the high threshold takes ImaxSmaller in (1+ σ) both * m;Institute
State Low threshold and take IminThe greater in (1- σ) both * m, σ is empirical parameter;
Described image is handled as the threshold parameter of the Canny operators using the high threshold and Low threshold,
Obtain edge image.
As the improvement of such scheme, the empirical parameter σ values are 0.33.
As the improvement of such scheme, the number of the non-zero pixels in the statistics edge image, specifically include:
The all pixels in the edge image are traveled through, the pixel that pixel value is not zero is labeled as non-zero pixels, and unites
Meter obtains the number of non-zero pixels.
As the improvement of such scheme, the number according to the non-zero pixels is big with least one default threshold value
Small relation, the degree that the pcb board enters the designated area is detected, is:
When the number for judging the non-zero pixels in the edge image is less than first threshold, determine that the pcb board is located at
Outside the designated area.
As the improvement of such scheme, the designated area includes borderline region, wherein, the borderline region is the finger
The minimum range to two side vertical with conveyer belt direction of advance determined in region is less than or equal to a default length
The formed region of point;
The then number of the non-zero pixels in the statistics edge image, it is:
Count the number of the non-zero pixels corresponding to the borderline region in edge image;
The magnitude relationship of the number according to the non-zero pixels and at least one default threshold value, detects the PCB
Plate enters the degree of the designated area, is:
When the number for judging the non-zero pixels corresponding to the borderline region in edge image is more than default Second Threshold
When, determine that the pcb board part enters the designated area.
As the improvement of such scheme, the designated area also includes interior zone, and the interior zone is specified to be described
Region in region in addition to the borderline region;
The then number of the non-zero pixels in the statistics edge image, it is:
The number of the non-zero pixels corresponding to the borderline region in edge image and the interior zone pair are counted respectively
The number for the non-zero pixels in edge image answered;
The magnitude relationship of the number according to the non-zero pixels and at least one default threshold value, detects the PCB
Plate enters the degree of the designated area, is:
When the number for judging the non-zero pixels corresponding to the interior zone in edge image is more than default 3rd threshold value,
And the number of the non-zero pixels corresponding to the borderline region in edge image is when being less than default four threshold value, it is determined that described
Pcb board is completely into the designated area.
The present invention also provides a kind of pcb board detection means, including:
Collecting unit, the image of designated area on the transmission plane for gathering conveyer belt;
Graphics processing unit, for being handled described image to obtain edge image using Canny operators, wherein, institute
Stating Canny operators includes two parameters of high threshold and Low threshold, and the high threshold and Low threshold are according to the pixel of described image
Information self-adapting generates;
Statistic unit, for counting the number of the non-zero pixels in the edge image;
Detection unit, for the number according to the non-zero pixels and the magnitude relationship of at least one default threshold value, inspection
Survey the degree that the pcb board enters the designated area.
As the improvement of such scheme, the pcb board detection means also includes:
Normalization unit, for the size of described image to be normalized.
As the improvement of such scheme, described image processing unit specifically includes:
Pixel acquisition unit, for obtaining the pixel span of described image, wherein, the pixel span is
[Imin, Imax];
Computing unit, for calculating the pixel median m of described image, wherein, the pixel median m is by described image
After each pixel value is ranked up by size, sequence number is positioned at middle pixel value;
Threshold value generation unit, for generating the high threshold and Low threshold, wherein, the high threshold takes Imax(1+ σ) * m
Smaller in the two;The Low threshold takes IminThe greater in (1- σ) both * m, σ is empirical parameter;
Processing unit, for by the use of the high threshold and Low threshold as the threshold parameter of the Canny operators to described
Image is handled, and obtains edge image.
As the improvement of such scheme, the designated area includes borderline region, wherein, the borderline region is the finger
The minimum range to two side vertical with conveyer belt direction of advance determined in region is less than or equal to a default length
The formed region of point;
The statistic unit is specifically used for, and counts of the non-zero pixels corresponding to the borderline region in edge image
Number;
The detection unit is specifically used for, and is judging of the non-zero pixels corresponding to the borderline region in edge image
When number is more than default Second Threshold, determine that the pcb board part enters the designated area.
As the improvement of such scheme, the designated area also includes interior zone, wherein, the interior zone is described
Region in designated area in addition to the borderline region;
The statistic unit is specifically used for, and counts edge image corresponding to the interior zone respectively and borderline region is corresponding
Edge image non-zero pixels number;
The detection unit is specifically used for, and is judging of the non-zero pixels corresponding to the interior zone in edge image
Number is more than default 3rd threshold value, and the number of the non-zero pixels corresponding to the borderline region in edge image is less than default
During four threshold values, determine the pcb board completely into the designated area.
Pcb board detection method and device provided in an embodiment of the present invention, using adaptive Canny operators to collecting transmission
The image of designated area is analyzed on the transmission plane of band, and detection pcb board enters the degree of designated area, determines the pcb board
Completely into the image of the designated area, so as to filter out unnecessary invalid image for subsequent treatment, PCB detections are improved
Speed and the degree of accuracy.Due to the rim detection parameter of the adaptive Canny operators be according to the Pixel Information of described image from
Adapt to generation, it is not necessary to artificial adjusting parameter as the case may be, there is very strong robustness, realize the height of PCB detections
Automation.
Brief description of the drawings
In order to illustrate more clearly of technical scheme, the required accompanying drawing used in embodiment will be made below
Simply introduce, it should be apparent that, drawings in the following description are only some embodiments of the present invention, general for this area
For logical technical staff, on the premise of not paying creative work, other accompanying drawings can also be obtained according to these accompanying drawings.
Fig. 1 is the schematic flow sheet for the pcb board detection method that first embodiment of the invention provides.
Fig. 2 is the schematic diagram that the pcb board that first embodiment of the invention provides was introduced into or had been moved off designated area..
Fig. 3 is the schematic diagram that the pcb board part that first embodiment of the invention provides enters designated area.
Fig. 4 is schematic diagram of the pcb board completely into designated area of first embodiment of the invention offer
Fig. 5 is the schematic flow sheet for the pcb board detection method that second embodiment of the invention provides.
Fig. 6 is the structural representation for the pcb board detection means that third embodiment of the invention provides.
Fig. 7 is the structural representation of the graphics processing unit shown in Fig. 6.
Fig. 8 is the structural representation for the pcb board detection means that fourth embodiment of the invention provides.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained every other under the premise of creative work is not made
Embodiment, belong to the scope of protection of the invention.
The embodiment of the present invention provides a kind of pcb board detection method and device, enters the IMAQ visual field for detecting pcb board
Degree, improve PCB automatic optics inspections efficiency and quality.It is described in detail separately below.
Referring to Fig. 1, first embodiment of the invention provides a kind of pcb board detection method, the pcb board detection method by
Pcb board detection means is implemented, including at least following steps:
S101, gather the image of designated area on the transmission plane of conveyer belt.
In embodiments of the present invention, the conveyer belt can continuously convey pcb board along certain direction of transfer, described
Pcb board image in the collection conveying of pcb board detection means, specifically, the pcb board detection means includes camera, it is described to take the photograph
As head is set up in above conveyer belt, and the image of designated area on the transmission plane is gathered in real time, wherein, described image can be coloured silk
Color image or black white image.For relatively described camera, the pcb board is constantly moving, therefore, described
Pcb board part is there may be in the image for the designated area that camera collects and enters the designated area, pcb board is complete
The various situations such as the designated area are introduced into or have been moved off into the designated area, or pcb board.
S102, described image is handled using Canny operators to obtain edge image, wherein, the Canny operators bag
Two parameters of high threshold and Low threshold are included, and the high threshold and Low threshold are adaptively given birth to according to the Pixel Information of described image
Into.
In embodiments of the present invention, the Canny operators are widely used in the detection of image border, however, traditional
The high threshold and Low threshold of Canny operators are set in advance, can not do adaptive tune according to the concrete condition of current image
It is whole.
In embodiments of the present invention, the pcb board detection means uses the strategy of auto-adaptable image edge detection, according to the figure
The Pixel Information of picture automatically generates suitable high threshold and Low threshold, so as to provide preferably threshold value ginseng for the Canny operators
Number, specifically,
First, the pixel span of described image is obtained.
In embodiments of the present invention, the pcb board detection means obtains the gray value of each pixel of described image, and
Maximum I is read out from these gray valuesmaxWith minimum value Imin, now, the pixel span is labeled as [Imin,
Imax]。
Then, the pixel median m of described image is calculated, wherein, the pixel median m is by each pixel of described image
After value is ranked up by size, sequence number is positioned at middle pixel value.
Then, the high threshold t is generatedhighWith Low threshold tlow, wherein, the high threshold thighTake Imax(1+ σ) * m bis-
Smaller in person, the Low threshold tlowTake IminThe greater in (1- σ) both * m.
In embodiments of the present invention, the high threshold thighTake ImaxSmaller in (1+ σ) both * m, the low threshold
Value tlowTake IminThe greater in (1- σ) both * m, i.e. thigh=min (Imax, (1+ σ) * m), tlow=max (Imin, (1-
σ) * m), σ is empirical parameter.
In embodiments of the present invention, it is preferable that the empirical parameter σ values are 0.33.It is understood that the experience
Parameter σ can also value be 0.2,0.3,0.4 or other any appropriate numerical value, these can be configured according to the actual needs,
The present invention does not do specific restriction.
Finally, described image is carried out as the threshold parameter of the Canny operators using the high threshold and Low threshold
Processing, obtains edge image.
Specifically, in embodiments of the present invention, the pcb board detection means is used as institute by the use of the high threshold and Low threshold
The threshold parameter for stating Canny operators is handled described image, obtains edge image.Wherein, the canny operators are to described
The process that image procossing obtains edge image refers to the Computing Principles of Canny operators, and the present invention is not described herein.
S103, count the number of the non-zero pixels in the edge image.
In embodiments of the present invention, the pcb board detection means travels through all pixels in the edge image, and by picture
After the pixel that plain value is not zero is labeled as non-zero pixels, the number of the non-zero pixels is counted.
S104, according to the number of the non-zero pixels and the magnitude relationship of at least one default threshold value, detect the PCB
Plate enters the degree of the designated area.
In embodiments of the present invention, the relation of the pcb board and the designated area may include to be introduced into or from
Open, partly enter, completely into, below the embodiment of the present invention the above situation will be described one by one.
Also referring to Fig. 2, sentencing for the situation of designated area 10 is introduced into or has been moved off for the pcb board 20
It is disconnected:
In embodiments of the present invention, the pcb board detection means is counted corresponding to the designated area 10 in edge image
Non-zero pixels number after, and the number of the non-zero pixels in the edge image and default first threshold are carried out respectively
Compare, when the number of the non-zero pixels in the edge image is less than the first threshold, it is determined that the pcb board 20 is introduced into
Or have been moved off the designated area 10, wherein, the first threshold can be zero, or close to zero numerical value.
Also referring to Fig. 3, the judgement of the situation of designated area 10 is entered for the part of pcb board 20:The finger
Determining region 10 includes borderline region 11, wherein, the borderline region 11 is arriving with transmitting tape travel in the designated area 10
The minimum range on two vertical sides of direction is less than or equal to the region that the point of a default length is formed, for example, can incite somebody to action
The default length is arranged to 1/10th or 20/first-class of the width of the designated area.The pcb board detection
After device counts the number of the non-zero pixels in edge image corresponding to the borderline region 11, by the correspondence of borderline region 11
Edge image in non-zero pixels number compared with default Second Threshold.When corresponding to the borderline region 11
When the number of non-zero pixels in edge image is more than the Second Threshold, it is determined that the part of pcb board 20 enters the finger
Determine region 10.
Also referring to Fig. 4, the judgement for the pcb board 20 completely into the situation of designated area 10:
In embodiments of the present invention, the designated area 10 may also include interior zone 12, wherein, the interior zone 12
For the region in the designated area 10 in addition to the borderline region 11.In the pcb board detection means counts described respectively
After the number of non-zero pixels in edge image corresponding to portion region 12 and corresponding to the borderline region 11 in edge image, and
Respectively by the number of the non-zero pixels corresponding to the interior zone 12 in edge image compared with default 3rd threshold value,
And by the number of non-zero pixels interior in edge image corresponding to the borderline region 11 compared with default 4th threshold value.
When the number of the non-zero pixels corresponding to the interior zone 12 in edge image is more than the 3rd threshold value, and the frontier district
When the number of non-zero pixels corresponding to domain 11 in edge image is less than four threshold value, it is determined that the pcb board 20 is complete
Into the designated area 10.
Pcb board detection method provided in an embodiment of the present invention, using adaptive Canny operators to collecting the biography of conveyer belt
The image of designated area on face is sent to be analyzed, detection pcb board enters the degree of designated area, determines that the pcb board enters completely
Enter the image of the designated area, so as to filter out unnecessary invalid image for subsequent treatment, improve PCB detections speed and
The degree of accuracy.Because the rim detection parameter of the adaptive Canny operators is adaptively given birth to according to the Pixel Information of described image
Into, it is not necessary to artificial adjusting parameter as the case may be, there is very strong robustness, realize the increasingly automated of PCB detections.
Referring to Fig. 5, Fig. 5 is the schematic flow sheet for the PCB detection methods that second embodiment of the invention provides.The PCB
Board detecting method includes:
S201, gather the image of designated area on the transmission plane of conveyer belt.
S202, the size of described image is normalized.
In embodiments of the present invention, the pcb board detection means first can carry out down-sampling to described image, and reduce image
Resolution ratio to predetermined size, wherein, the predetermined big I for keep image height pixel value it is constant, reduce width picture
Element value is to default threshold value or keeps the width pixel value of image constant, reduces height pixel value to default threshold value, Huo Zhetong
When reduce image width and height pixel value to default threshold value, these can be configured according to the actual needs, the present invention
Specific restriction is not done.
S203, described image is handled using Canny operators to obtain edge image, wherein, the Canny operators bag
Two parameters of high threshold and Low threshold are included, and the high threshold and Low threshold are adaptively given birth to according to the Pixel Information of described image
Into.
S204, count the number of the non-zero pixels in the edge image.
S205, according to the number of the non-zero pixels and the magnitude relationship of at least one default threshold value, detect the PCB
Plate enters the degree of the designated area.
Pcb board detection method provided in an embodiment of the present invention, by carrying out down-sampling to the image of collection, so as to realize figure
The normalized of picture, improve the efficiency of detection.
Also referring to Fig. 6, Fig. 6 is the structural representation for the pcb board detection means that third embodiment of the invention provides.Institute
Stating pcb board detection means 300 includes collecting unit 310, graphics processing unit 320, statistic unit 330 and detection unit 340, its
In:
The collecting unit 310, the image of designated area on the transmission plane for gathering conveyer belt.
Described image processing unit 320, for being handled described image to obtain edge image using Canny operators,
Wherein, the Canny operators include two parameters of high threshold and Low threshold, and the high threshold and Low threshold are according to described image
Pixel Information adaptive generation.
Also referring to Fig. 6, in embodiments of the present invention, described image processing unit 320 includes:
Pixel acquisition unit 321, for obtaining the pixel span of described image, wherein, the pixel span
For [Imin, Imax]。
Computing unit 322, for calculating the pixel median m of described image, wherein, the pixel median m is by the figure
After each pixel value of picture is ranked up by size, sequence number is positioned at middle pixel value.
Threshold value generation unit 323, for generating the high threshold and Low threshold, wherein, the high threshold takes Imax(1+
σ) the smaller in both * m;The Low threshold takes IminThe greater in (1- σ) both * m, σ is empirical parameter.
Processing unit 324, for by the use of the high threshold and Low threshold as the threshold parameter of the Canny operators to institute
State image to be handled, obtain edge image, wherein, the edge image includes first edge image and second edge image,
The high threshold acts on described image and obtains the first edge image, the Low threshold act on described image obtain it is described
Second edge image.
The statistic unit 330, for counting the number of the non-zero pixels in the edge image.
The detection unit 340, for the number according to the non-zero pixels and the size of at least one default threshold value
Relation, detect the degree that the pcb board enters the designated area.
In embodiments of the present invention, the relation of the pcb board and the designated area may include to be introduced into or from
Open, partly enter, completely into, below the embodiment of the present invention the above situation will be described one by one.
Also referring to Fig. 2, sentencing for the situation of designated area 10 is introduced into or has been moved off for the pcb board 20
It is disconnected:
In embodiments of the present invention, the statistic unit 330 is counted corresponding to the designated area 10 in edge image
After the number of non-zero pixels, the detection unit 340 is by the non-zero pixels corresponding to the designated area 10 in edge image
Number is compared with default first threshold, when the number of the non-zero pixels corresponding to the designated area 10 in edge image
Less than the first threshold, then the detection unit 340 determines that the pcb board 20 is introduced into or had been moved off the designated area
10, wherein, the first threshold can be zero, or close to zero numerical value.
Also referring to Fig. 3, the judgement of the situation of designated area 10 is entered for the part of pcb board 20:
The designated area 10 includes borderline region 11, wherein, the borderline region 11 is in the designated area 10
What the point that the minimum range to two side vertical with conveyer belt direction of advance is less than or equal to a default length was formed
Region, for example, the default length can be arranged to 1/10th or 20/first-class of the width of the designated area.
After the statistic unit 330 counts the number of the non-zero pixels in edge image corresponding to the borderline region 11, the detection
Unit 340 is compared the number of the non-zero pixels corresponding to the borderline region 11 in edge image with default Second Threshold
Compared with.It is when the number of the non-zero pixels corresponding to the borderline region 11 in edge image is more than the Second Threshold, then described
Detection unit 340 determines that the part of pcb board 20 enters the designated area 10.
Also referring to Fig. 4, the judgement for the pcb board 20 completely into the situation of designated area 10:
In embodiments of the present invention, the designated area 10 may also include interior zone 12, wherein, the interior zone 12
For the region in the designated area 10 in addition to the borderline region 11.The statistic unit 330 counts the inside respectively
After the number of the non-zero pixels of edge image corresponding to edge image corresponding to region 12 and the borderline region 11, the detection
Unit 340 respectively enters the number of the non-zero pixels corresponding to the interior zone 12 in edge image and default 3rd threshold value
Row compares, and the number of the non-zero pixels corresponding to the borderline region 11 in edge image and default 4th threshold value are carried out
Compare.When the number of the non-zero pixels corresponding to the interior zone 12 in edge image is more than the 3rd threshold value, and it is described
When the number of non-zero pixels corresponding to borderline region 11 in edge image is less than four threshold value, then the detection unit
340 determine the pcb board 20 completely into the designated area 10.
Pcb board detection means 300 provided in an embodiment of the present invention, by described image processing unit 320 to the collection
The image that unit 310 gathers is handled to obtain edge image, recycles the statistic unit 330 to count described image processing single
The number of the non-zero pixels for the edge image that member 320 obtains, pcb board is detected by the detection unit 340 and enters IMAQ
The degree in the visual field, determine that the pcb board gathers the image in the visual field completely into described image, so as to be filtered out not for subsequent treatment
Necessary invalid image, improve speed and the degree of accuracy of PCB detections.Due to described image processing unit 320 use it is adaptive
The rim detection parameter of Canny operators is the Pixel Information adaptive generation according to described image, it is not necessary to artificial according to specific
Situation adjusting parameter, there is very strong robustness, realize the increasingly automated of PCB detections.
Also referring to Fig. 8, Fig. 8 is the structural representation for the pcb board detection means that fourth embodiment of the invention provides.Institute
State pcb board detection means 400 include collecting unit 410, normalization unit 420, graphics processing unit 430, statistic unit 440 and
Detection unit 450, wherein:
The collecting unit 410, the image of designated area on the transmission plane for gathering conveyer belt.
The normalization unit 420, for the size of described image to be normalized.
In embodiments of the present invention, the normalization unit 420 first to the image of collecting unit 410 can adopt
Sample, and reduce image resolution ratio to predetermined size, wherein, the predetermined big I is keeps the height pixel value of image not
Become, reduce width pixel value to default threshold value or keep the width pixel value of image constant, reduce height pixel value to default
Threshold value, or reduce simultaneously image width and height pixel value to default threshold value, these can enter according to the actual needs
Row is set, and the present invention does not do specific restriction.
Described image processing unit 430, for being handled described image to obtain edge image using Canny operators,
Wherein, the Canny operators include two parameters of high threshold and Low threshold, and the high threshold and Low threshold are according to described image
Pixel Information adaptive generation.
The statistic unit 440, for counting the number of the non-zero pixels in the edge image.
The detection unit 450, for the number according to the non-zero pixels and the size of at least one default threshold value
Relation, detect the degree that the pcb board enters the designated area.
Pcb board detection means 400 provided in an embodiment of the present invention, it is single to the collection by the normalization unit 420
The image of the collection of member 410 carries out down-sampling, so as to realize the normalized of image, improves the efficiency of detection.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show
The description of example " or " some examples " etc. means specific features, structure, material or the spy for combining the embodiment or example description
Point is contained at least one embodiment or example of the present invention.In this manual, to the schematic representation of above-mentioned term not
Identical embodiment or example must be directed to.Moreover, specific features, structure, material or the feature of description can be with office
Combined in an appropriate manner in one or more embodiments or example.In addition, in the case of not conflicting, the skill of this area
Art personnel can be tied the different embodiments or example and the feature of different embodiments or example described in this specification
Close and combine.
In addition, term " first ", " second " are only used for describing purpose, and it is not intended that instruction or hint relative importance
Or the implicit quantity for indicating indicated technical characteristic.Thus, define " first ", the feature of " second " can be expressed or
Implicitly include at least one this feature.In the description of the invention, " multiple " are meant that at least two, such as two, three
It is individual etc., unless otherwise specifically defined.
Any process or method described otherwise above description in flow chart or herein is construed as, and represents to include
Module, fragment or the portion of the code of the executable instruction of one or more the step of being used to realize specific logical function or process
Point, and the scope of the preferred embodiment of the present invention includes other realization, wherein can not press shown or discuss suitable
Sequence, including according to involved function by it is basic simultaneously in the way of or in the opposite order, carry out perform function, this should be of the invention
Embodiment person of ordinary skill in the field understood.
Expression or logic and/or step described otherwise above herein in flow charts, for example, being considered use
In the order list for the executable instruction for realizing logic function, may be embodied in any computer-readable medium, for
Instruction execution system, device or equipment (such as computer based system including the system of processor or other can be held from instruction
The system of row system, device or equipment instruction fetch and execute instruction) use, or combine these instruction execution systems, device or set
It is standby and use.For the purpose of this specification, " computer-readable medium " can any can be included, store, communicate, propagate or pass
Defeated software is for instruction execution system, device or equipment or the dress used with reference to these instruction execution systems, device or equipment
Put.The more specifically example (non-exhaustive list) of computer-readable medium includes following:Electricity with one or more wiring
Connecting portion (electronic installation), portable computer diskette box (magnetic device), random access memory (RAM), read-only storage
(ROM), erasable edit read-only storage (EPROM or flash memory), fiber device, and portable optic disk is read-only deposits
Reservoir (CDROM).In addition, computer-readable medium can even is that paper that the software can be printed thereon or other are suitable
Medium, because can then enter edlin, interpretation or if necessary with it for example by carrying out optical scanner to paper or other media
His suitable method is handled electronically to obtain the software, is then stored in computer storage.
In the above-described embodiment, multiple steps or method can be answered in memory and by suitably instructing to hold with storage
Work as understanding, each several part of the invention can be realized with hardware, software, firmware or combinations thereof.The software that row system performs
Or firmware is realized.If, and in another embodiment, can be with well known in the art for example, realized with hardware
Any one of row technology or their combination are realized:With the logic gates for realizing logic function to data-signal
Discrete logic, have suitable combinational logic gate circuit application specific integrated circuit, programmable gate array (PGA), scene
Programmable gate array (FPGA) etc..
Those skilled in the art are appreciated that to realize all or part of step that above-described embodiment method carries
Suddenly it is that by software the hardware of correlation can be instructed to complete, described software can be stored in a kind of computer-readable storage medium
In matter, the software upon execution, including one or a combination set of the step of embodiment of the method.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing module, can also
That unit is individually physically present, can also two or more units be integrated in a module.Above-mentioned integrated mould
Block can both be realized in the form of hardware, can also be realized in the form of software function module.The integrated module is such as
Fruit is realized in the form of software function module and as independent production marketing or in use, can also be stored in a computer
In read/write memory medium.
Storage medium mentioned above can be read-only storage, disk or CD etc..Although have been shown and retouch above
Embodiments of the invention are stated, it is to be understood that above-described embodiment is exemplary, it is impossible to be interpreted as the limit to the present invention
System, one of ordinary skill in the art can be changed to above-described embodiment, change, replace and become within the scope of the invention
Type.
Claims (13)
1. a kind of pcb board detection method, it is characterised in that comprise the following steps:
Gather the image of designated area on the transmission plane of conveyer belt;Wherein, the designated area includes borderline region, the border
Region is that the minimum range to two side vertical with conveyer belt direction of advance in the designated area is less than or equal to one
The region that the point of default length is formed;
Described image is handled using Canny operators to obtain edge image, wherein, the Canny operators include high threshold
With two parameters of Low threshold, and the high threshold and Low threshold are according to the Pixel Information adaptive generation of described image;
Count the number of the non-zero pixels in the edge image;Wherein, including:Count edge graph corresponding to the borderline region
The number of non-zero pixels as in;
According to the number of the non-zero pixels and the magnitude relationship of at least one default threshold value, detect the pcb board and enter institute
State the degree of designated area;Wherein, including:Preset according to the number of non-zero pixels corresponding to the borderline region with least one
Threshold value magnitude relationship, detect the pcb board enter the designated area degree.
2. pcb board detection method according to claim 1, it is characterised in that on the transmission plane of the collection conveyer belt
After the image of designated area, it is described described image is handled to obtain edge image using Canny operators before, also wrap
Include:
The size of described image is normalized.
3. pcb board detection method according to claim 1, it is characterised in that described to utilize Canny operators to described image
Handled to obtain edge image, wherein, the Canny operators include two parameters of high threshold and Low threshold, and the high threshold
Value and Low threshold specifically include according to the Pixel Information adaptive generation of described image:
The pixel span of described image is obtained, wherein, the pixel span is [Imin, Imax];
Calculate described image pixel median m, wherein, the pixel median m be by each pixel value of described image by size
After being ranked up, sequence number is positioned at middle pixel value;
The high threshold and Low threshold are generated, wherein, the high threshold takes ImaxSmaller in (1+ σ) both * m;It is described low
Threshold value takes IminThe greater in (1- σ) both * m, σ is empirical parameter;
Described image is handled as the threshold parameter of the Canny operators using the high threshold and Low threshold, obtained
Edge image.
4. pcb board detection method according to claim 3, it is characterised in that the empirical parameter σ values are 0.33.
5. pcb board detection method according to claim 1, it is characterised in that non-in the statistics edge image
The number of zero pixel, including:
The all pixels in the edge image are traveled through, the pixel that pixel value is not zero is labeled as non-zero pixels, and counts and obtain
Take the number of non-zero pixels.
6. pcb board detection method according to claim 5, it is characterised in that the number according to the non-zero pixels
With the magnitude relationship of at least one default threshold value, the degree that the pcb board enters the designated area is detected, in addition to:
When the number for judging the non-zero pixels in the edge image is less than first threshold, determine the pcb board positioned at described
Outside designated area.
7. pcb board detection method according to claim 1, it is characterised in that described according to corresponding to the borderline region
The magnitude relationship of the number of non-zero pixels and at least one default threshold value, the pcb board is detected into the designated area
Degree, including:
When the number for judging the non-zero pixels corresponding to the borderline region in edge image is more than default Second Threshold, really
The fixed pcb board part enters the designated area.
8. pcb board detection method according to claim 1, it is characterised in that the designated area also includes interior zone,
The interior zone is the region in addition to the borderline region in the designated area;
The then number of the non-zero pixels in the statistics edge image, in addition to:
Count the number of the non-zero pixels corresponding to the interior zone in edge image;
The magnitude relationship of the number of the non-zero pixels according to corresponding to the borderline region and at least one default threshold value, inspection
The degree that the pcb board enters the designated area is surveyed, including:
When the number for judging the non-zero pixels corresponding to the interior zone in edge image is more than default 3rd threshold value, and institute
When stating the numbers of the non-zero pixels corresponding to borderline region in edge image and being less than default four threshold value, the pcb board is determined
Completely into the designated area.
A kind of 9. pcb board detection means, it is characterised in that including:
Collecting unit, the image of designated area on the transmission plane for gathering conveyer belt;Wherein, the designated area includes border
Region, the borderline region are that the minimum range to two sides vertical with conveyer belt direction of advance in the designated area is small
In or equal to a default length the region that is formed of point;
Graphics processing unit, for being handled described image to obtain edge image using Canny operators, wherein, it is described
Canny operators include two parameters of high threshold and Low threshold, and the high threshold and Low threshold are believed according to the pixel of described image
Cease adaptive generation;
Statistic unit, for counting the number of the non-zero pixels in the edge image;Wherein, including:Count the frontier district
The number of non-zero pixels corresponding to domain in edge image;
Detection unit, for the number according to the non-zero pixels and the magnitude relationship of at least one default threshold value, detect institute
State the degree that pcb board enters the designated area;Wherein, detection unit, for the non-zero picture according to corresponding to the borderline region
The number of element and the magnitude relationship of at least one default threshold value, detect the degree that the pcb board enters the designated area.
10. pcb board detection means according to claim 9, it is characterised in that the pcb board detection means also includes:
Normalization unit, for the size of described image to be normalized.
11. pcb board detection means according to claim 9, it is characterised in that described image processing unit specifically includes:
Pixel acquisition unit, for obtaining the pixel span of described image, wherein, the pixel span is [Imin,
Imax];
Computing unit, for calculating the pixel median m of described image, wherein, the pixel median m is by each of described image
After pixel value is ranked up by size, sequence number is positioned at middle pixel value;
Threshold value generation unit, for generating the high threshold and Low threshold, wherein, the high threshold takes Imax(1+ σ) both * m
In smaller;The Low threshold takes IminThe greater in (1- σ) both * m, σ is empirical parameter;
Processing unit, for by the use of the high threshold and Low threshold as the threshold parameter of the Canny operators to described image
Handled, obtain edge image.
12. pcb board detection means according to claim 9, it is characterised in that
The detection unit is used for, and is more than in the number for judging the non-zero pixels corresponding to the borderline region in edge image pre-
If Second Threshold when, determine that the pcb board part enters the designated area.
13. pcb board detection means according to claim 9, it is characterised in that the designated area also includes inner area
Domain, wherein, the interior zone is the region in addition to the borderline region in the designated area;
The statistic unit is additionally operable to, and counts the number of the non-zero pixels of edge image corresponding to the interior zone;
The detection unit is additionally operable to, and is more than in the number for judging the non-zero pixels corresponding to the interior zone in edge image
Default 3rd threshold value, and the number of the non-zero pixels corresponding to the borderline region in edge image is less than default 4th threshold
During value, determine the pcb board completely into the designated area.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510527487.3A CN105139397B (en) | 2015-08-25 | 2015-08-25 | A kind of pcb board detection method and device |
PCT/CN2016/096546 WO2017032308A1 (en) | 2015-08-25 | 2016-08-24 | Pcb board detection method and apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510527487.3A CN105139397B (en) | 2015-08-25 | 2015-08-25 | A kind of pcb board detection method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105139397A CN105139397A (en) | 2015-12-09 |
CN105139397B true CN105139397B (en) | 2017-12-19 |
Family
ID=54724729
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510527487.3A Active CN105139397B (en) | 2015-08-25 | 2015-08-25 | A kind of pcb board detection method and device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN105139397B (en) |
WO (1) | WO2017032308A1 (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105139397B (en) * | 2015-08-25 | 2017-12-19 | 广州视源电子科技股份有限公司 | A kind of pcb board detection method and device |
CN106469482A (en) * | 2016-09-05 | 2017-03-01 | 深圳怡化电脑股份有限公司 | Bank note crosses the border detection method, device and Banknote deposting/drawing out equipment |
CN109035236B (en) * | 2018-07-27 | 2024-02-23 | 深圳市闿思科技有限公司 | Casting burr detection method and device |
CN112215827A (en) * | 2020-10-20 | 2021-01-12 | 中广核核电运营有限公司 | Electromigration region detection method and device, computer equipment and storage medium |
CN113252625B (en) * | 2021-04-27 | 2022-08-16 | 歌尔光学科技有限公司 | Glue path detection method for glue with fluorescence effect |
CN115131287A (en) * | 2022-05-16 | 2022-09-30 | 奥蒂玛光学科技(深圳)有限公司 | Image processing method, area detection method, detection device and storage medium |
CN115601364B (en) * | 2022-12-14 | 2023-04-07 | 惠州威尔高电子有限公司 | Golden finger circuit board detection method based on image analysis |
CN116703889B (en) * | 2023-07-31 | 2023-10-03 | 深圳市普能达电子有限公司 | Flexible circuit board patch abnormality detection method |
CN116758077B (en) * | 2023-08-18 | 2023-10-20 | 山东航宇游艇发展有限公司 | Online detection method and system for surface flatness of surfboard |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102436656A (en) * | 2011-09-05 | 2012-05-02 | 同济大学 | Animal-diversity monitoring method based on computer vision |
CN102456131A (en) * | 2010-11-02 | 2012-05-16 | 屏东科技大学 | Obstacle sensing method |
CN102496161A (en) * | 2011-12-13 | 2012-06-13 | 浙江欧威科技有限公司 | Method for extracting contour of image of printed circuit board (PCB) |
CN103600707A (en) * | 2013-11-06 | 2014-02-26 | 同济大学 | Parking position detecting device and method of intelligent parking system |
CN104268857A (en) * | 2014-09-16 | 2015-01-07 | 湖南大学 | Rapid sub pixel edge detection and locating method based on machine vision |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4454428B2 (en) * | 2004-07-30 | 2010-04-21 | 富士通株式会社 | Component edge detection method, component edge detection program, and inspection apparatus |
CN102034101B (en) * | 2010-10-22 | 2014-11-05 | 广东工业大学 | Method for quickly positioning circular mark in PCB visual detection |
CN105139397B (en) * | 2015-08-25 | 2017-12-19 | 广州视源电子科技股份有限公司 | A kind of pcb board detection method and device |
-
2015
- 2015-08-25 CN CN201510527487.3A patent/CN105139397B/en active Active
-
2016
- 2016-08-24 WO PCT/CN2016/096546 patent/WO2017032308A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102456131A (en) * | 2010-11-02 | 2012-05-16 | 屏东科技大学 | Obstacle sensing method |
CN102436656A (en) * | 2011-09-05 | 2012-05-02 | 同济大学 | Animal-diversity monitoring method based on computer vision |
CN102496161A (en) * | 2011-12-13 | 2012-06-13 | 浙江欧威科技有限公司 | Method for extracting contour of image of printed circuit board (PCB) |
CN103600707A (en) * | 2013-11-06 | 2014-02-26 | 同济大学 | Parking position detecting device and method of intelligent parking system |
CN104268857A (en) * | 2014-09-16 | 2015-01-07 | 湖南大学 | Rapid sub pixel edge detection and locating method based on machine vision |
Also Published As
Publication number | Publication date |
---|---|
CN105139397A (en) | 2015-12-09 |
WO2017032308A1 (en) | 2017-03-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105139397B (en) | A kind of pcb board detection method and device | |
US11221107B2 (en) | Method for leakage detection of underground pipeline corridor based on dynamic infrared thermal image processing | |
CN107133943B (en) | A kind of visible detection method of stockbridge damper defects detection | |
CN107833221A (en) | A kind of water leakage monitoring method based on multi-channel feature fusion and machine learning | |
CN103530878B (en) | A kind of edge extracting method based on convergence strategy | |
CN102673979B (en) | Method and device for judging deviation of conveying belt | |
CN100376889C (en) | Intelligent digital graphics context detection system and detection method | |
CN101751572A (en) | Pattern detection method, device, equipment and system | |
CN102169093A (en) | Multi-station machine vision imaging detection method and system based on graphics processor | |
CN108896278A (en) | A kind of optical filter silk-screen defect inspection method, device and terminal device | |
CN109389599A (en) | A kind of defect inspection method and device based on deep learning | |
CN105225523B (en) | A kind of parking space state detection method and device | |
CN108449525B (en) | The acquisition methods and automatic optical checking equipment of automatic visual inspection Plays image | |
CN109087363B (en) | HSV color space-based sewage discharge detection method | |
CN106780473A (en) | A kind of magnet ring defect multi-vision visual detection method and system | |
CN104729426A (en) | Automatic angle iron online detecting system and method based on machine vision | |
CN105426894B (en) | Railway plug pin image detecting method and device | |
EP3904868A1 (en) | Learned model generation method, learned model, surface defect inspection method, steel manufacturing method, pass/fail determination method, grade determination method, surface defect determination program, pass/fail determination program, determination system, and steel manufacturing equipment | |
CN102749034B (en) | Railway switch gap offset detection method based on image processing | |
CN108037132A (en) | A kind of visual sensor system and method for the detection of dry cell pulp layer paper winding defect | |
CN103049743B (en) | Bowl end character machining system and detection method | |
CN109724993A (en) | Detection method, device and the storage medium of the degree of image recognition apparatus | |
CN111275705A (en) | Intelligent cloth inspecting method and device, electronic equipment and storage medium | |
WO2024055796A1 (en) | Defect detection system, method and apparatus, electronic device, and storage medium | |
CN109636801A (en) | Automatic method, equipment and the medium for obtaining HER2 fluorescence in situ hybridization result |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20181106 Address after: 510663 3, 310, No. 192, Ke Zhu Road, Guangzhou high tech Industrial Development Zone, Guangdong Patentee after: Guangzhou Kun Electronic Technology Co. Ltd. Address before: 510663, 4, No. 192, Ke Zhu Road, science and Technology City, Guangzhou high tech Industrial Development Zone, Guangdong Patentee before: Guangzhou CVT Electronics Technology Co., Ltd. |