CN105184778B - A kind of detection method and device - Google Patents
A kind of detection method and device Download PDFInfo
- Publication number
- CN105184778B CN105184778B CN201510527486.9A CN201510527486A CN105184778B CN 105184778 B CN105184778 B CN 105184778B CN 201510527486 A CN201510527486 A CN 201510527486A CN 105184778 B CN105184778 B CN 105184778B
- Authority
- CN
- China
- Prior art keywords
- image
- template
- sample set
- template image
- test
- 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)
- Quality & Reliability (AREA)
Abstract
The embodiment of the invention discloses a kind of detection method and device, the method, including:Template image and test image are inputted into the Siamese networks after training, and obtain the feature vector of the template image and the test image as forward calculation respectively;Calculate the template image and the similarity of the feature vector of the test image;Determine whether the test image matches with the template image according to the similarity.Since Siamese networks can extract the advanced features of image, for the embodiment of the present invention by the way that whether Siamese network of the image input after training judge templet image can be matched with test image exactly, judging nicety rate is high.
Description
Technical field
The present invention relates to AOI fields, and in particular to a kind of detection method and device.
Background technology
Images match refers to judge the whether similar technology of two images using characteristics of image, is applied to various necks at present
Domain, such as carries out element testing, recognition of face using image matching technology, but at present due to for carrying out images match
The robustness of characteristics of image is low, is easily influenced by environment such as illumination and causes matching error occur, matching accuracy rate is low.
By taking the images match in element testing field as an example:Printed wiring board (Printed circuit board, abbreviation PCB
Plate) refer to circuit board that connection is provided for various electronic components, with electronic equipment become increasingly complex, it is necessary to part it is natural
More and more, the circuit of PCB tops is also more and more intensive with being connected, so as to inevitably go out when welding/hand plug-in subcomponent
Existing missing part phenomenon, then whether needs missing part occur after pcb board welds to pcb board is detected.
At present, detecting some to the missing part of pcb board electronic component is carried out by artificial detection, and such a scheme takes
More, of high cost and efficiency is low, so typically now being carried out using automatic testing method, most common automatic testing method is
Missing part detection method based on template matches, but the program is easily influenced by environment such as illumination and causes detection error,
Some are realizing based on color histogram or some low-level features, but these schemes are due to the colouring information of electronic component
Unreliable or electronic component low-level feature unobvious and cause detection error.
The content of the invention
It is accurate to which the approx imately-detecting of image can be improved an embodiment of the present invention provides a kind of detection method and device
Rate, reliability are high.
First aspect of the embodiment of the present invention provides a kind of detection method, including:
Template image and test image are inputted into the Siamese networks after training, and obtained respectively as forward calculation
The template image and the feature vector of the test image;
Calculate the template image and the similarity of the feature vector of the test image;
Determine whether the test image matches with the template image according to the similarity.
Second aspect of the embodiment of the present invention provides a kind of detection device, including:
Image input module, for template image and test image to be inputted the Siamese networks after training, and divides
The feature vector of the template image and the test image is not obtained as forward calculation;
Computing module, for calculating the template image and the similarity of the feature vector of the test image;
Determining module, for determining whether the test image matches with the template image according to the similarity.
As can be seen that in technical solution provided in an embodiment of the present invention, template image and test image input are passed through
Siamese networks after training, and respectively the feature vector of the template image and the test image is obtained as forward calculation;
Calculate the template image and the similarity of the feature vector of the test image;The test chart is determined according to the similarity
As whether being matched with the template image.Since Siamese networks can extract the advanced features of image, image is inputted and is passed through
Whether the Siamese networks crossed after training judge templet image can match with test image exactly, and judging nicety rate is high.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is attached drawing needed in technology description to be briefly described, it should be apparent that, drawings in the following description are only this
Some embodiments of invention, for those of ordinary skill in the art, without creative efforts, can be with
Other attached drawings are obtained according to these attached drawings.
Fig. 1-a are the network structures of Siamese networks provided in an embodiment of the present invention;
Fig. 1-b are a kind of flow diagrams for detection method that first embodiment of the invention provides;
Fig. 2 is a kind of flow diagram for detection method that second embodiment of the invention provides;
Fig. 3 is a kind of structure diagram for detection device that third embodiment of the invention provides;
Fig. 4 is a kind of structure diagram for detection device that fourth embodiment of the invention provides;
Fig. 5 is a kind of structure diagram for detection device that fifth embodiment of the invention provides.
Embodiment
An embodiment of the present invention provides an embodiment of the present invention provides a kind of detection method and device, to which figure can be improved
The approx imately-detecting accuracy rate of picture, reliability are high.
In order to make those skilled in the art more fully understand the present invention program, below in conjunction with the embodiment of the present invention
Attached drawing, is clearly and completely described the technical solution in the embodiment of the present invention, it is clear that described embodiment is only
The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people
Member's all other embodiments obtained without making creative work, should all belong to the model that the present invention protects
Enclose.
Term " first ", " second " and " the 3rd " in description and claims of this specification and above-mentioned attached drawing etc. is
For distinguishing different objects, not for description particular order.In addition, term " comprising " and their any deformations, it is intended that
Non-exclusive included in covering.Such as process, method, system, product or the equipment for containing series of steps or unit do not have
The step of having listed or unit are defined in, but alternatively further includes the step of not listing or unit, or is alternatively further included
For the intrinsic other steps of these processes, method, product or equipment or unit.
A kind of detection method of the embodiment of the present invention, a kind of detection method include:
Template image and test image are inputted into the Siamese networks after training, and obtained respectively as forward calculation
The template image and the feature vector of the test image;Calculate the feature vector of the template image and the test image
Similarity;Determine whether the test image matches with the template image according to the similarity.
Referring first to Fig. 1, Fig. 1-a are the network structures of Siamese networks provided in an embodiment of the present invention;Fig. 1-b are
A kind of flow diagram for detection method that first embodiment of the invention provides.Wherein, as shown in Fig. 1-b, the present invention first is real
Applying a kind of detection method of example offer can include:
S101, the Siamese networks by the template image and test image input after training, and make respectively
Forward calculation obtains the feature vector of the template image and the test image.Wherein, it is referring to Fig. 1-a, Siamese networks
A kind of deep neural network, according to the characteristics of Siamese networks, can calculate image feature at all levels, including low layer
Feature and high-level characteristic, so that more accurate result will be obtained when being analyzed according to the high-level characteristic of image image.For
Carry out images match, design Siamese networks include that two structures are the same and the convolutional neural networks of shared parameter, are utilizing
When Siamese networks carry out images match, the template image and test image of difference input picture, so as to calculate respectively
The feature vector of two input pictures, then the similarity of two feature vectors is calculated, so as to judge two width according to the value of similarity
The similarity degree of image judges whether two images match.
Wherein, the Siamese networks after training are provided with standard due to the training study by substantial amounts of sample image
The ability of images match really is carried out to template image and test image.
Wherein, template image is the picture of the standard for control, and test image is by being compareed with template image
So as to judge whether match with template image.
S102, calculate the template image and the similarity of the feature vector of the test image.
Wherein, similarity is the parameter for judge templet image and test image similar programs.
Alternatively, can be in computing module image and the spy of test image in some possible embodiments of the present invention
Sign vector after, then calculate feature vector Euclidean distance obtain template image and test image feature vector similarity.
S103, according to the similarity determine whether the test image matches with the template image.
Wherein, since similarity is the measurement to the similar situation of the feature of two images of Siamese network inputs, institute
With can whether similar to test image come judge templet image by similarity, namely judge templet image and test image whether
Matching.
As can be seen that in the scheme of the present embodiment, template image and test image are inputted into the Siamese after training
Network, and respectively the feature vector of the template image and the test image is obtained as forward calculation;Calculate the Prototype drawing
As the similarity with the feature vector of the test image;The test image and the Prototype drawing are determined according to the similarity
It seem no matching.Since Siamese networks can extract the advanced features of image, by image input after training
Whether Siamese networks judge templet image can match with test image exactly, and judging nicety rate is high.
Alternatively, in some possible embodiments of the present invention, the template image exists for element and in mark
Corresponding part drawing picture when level is put, the test image is part drawing picture that needs to be tested, described according to described similar
Degree determines whether the test image matches with the template image, including:
Determine that the corresponding element of the test image whether there is according to the similarity.
Wherein, which can be PCB Prototype drawings, so that the part drawing picture or test image of corresponding input
For PCB image, which can also be the image for including each independent component respectively being truncated to from PCB image, so that
The test image of corresponding input is also the image for including each independent component.
Alternatively, in some possible embodiments of the present invention, due to being to carry out missing part detection, institute to each element
Using the template image generally inputted in Siamese networks as the image for including an independent component, then defeated in the training stage
The part drawing picture entered is also the part drawing picture for the position being truncated to from PCB image, is also in the image of test phase input
The part drawing picture for the position being truncated under different situations from PCB image.
Alternatively,, can when template image is the template image of element in some possible embodiments of the present invention
To understand, template image exists for element and the position of element is in the part drawing picture of a correct position, and test image is then
Missing part is judged whether according to template image.
It is appreciated that since Siamese networks may determine that whether test image matches with template image, so working as template
Image and test image for part drawing as when, can be determined according to similarity part drawing picture test image whether with template image
Whether match, namely the corresponding element of definite test image whether there is.
Alternatively, it is described by the template image and the test chart in some possible embodiments of the present invention
Before Siamese network of the input after training, the method further includes:
The position of the template image and element in the test image is obtained using template matches and to the Prototype drawing
As aliging with the test image;
The template image and the test image are normalized, with triggering perform it is described by the template image with
The test image inputs the step of Siamese networks after training.
It is appreciated that since part drawing seems the block diagram picture that intercepts to get off from template image, in order to make testing result
It is more accurate, it is necessary to the element in the part drawing picture for making to be truncated to is located at the center of image, and at the same time to the size of image
It is normalized, so to ensure the accuracy of subsequent treatment.The process is known as preprocessing process.
Alternatively, in some possible embodiments of the present invention, image can not also be pre-processed.
Alternatively, it is described by the template image and the test chart in some possible embodiments of the present invention
Before Siamese network of the input after training, the method further includes:
Create the part drawing picture and align sample set and negative sample set, wherein, the positive sample set includes institute
Template image and the part drawing picture pair of the element image construction in the presence of the element are stated, the negative sample set includes institute
The part drawing picture pair of element image construction when template image is not present with the element is stated, the negative sample set is also wrapped
Include the template image and the part drawing picture pair of the element image construction in the presence of other elements;
The Siamese networks are trained using the positive sample set and the negative sample set, institute is performed to trigger
State the step of template image and the test image are inputted into the Siamese networks after training.
It is to be appreciated that alternatively, in some possible embodiments of the present invention, when template image and test image are
During PCB image, then the positive sample set in sample set includes template image with being included on each position of components on template image
Be correct element when element image construction part drawing picture pair, negative sample set includes template image and each position of components
On element image construction when may be not present element part drawing picture pair, negative sample set further includes template image and each element
The part drawing picture pair of element image construction when element on position exists but may insert the element of mistake.
Alternatively, in other possible embodiments of the present invention, when template image and test image are from PCB
What is be truncated on image includes the image of each independent component respectively, so that the positive sample set in sample set includes Prototype drawing
As the part drawing picture pair with the image construction comprising the element in the template image, negative sample set includes template image with not wrapping
The part drawing picture pair of element-cont image construction, it is not in template image that negative sample set, which further includes template image and contains,
Element but the part drawing picture pair for containing the element image construction of other wrong components.
Alternatively, in some possible embodiments of the present invention, the positive sample set includes the template image,
And the sample that element exists and shot under each scene, the positive sample image such as shot in the case where light is bad,
And from different positions or the positive sample image of angle shot, or the positive sample image shot under other complex scenes, it is sharp
Siamese networks are trained with the positive sample image shot under each scene, so that Siamese networks are with stronger
Recognition capability, the part drawing picture for the non-missing part that can be shot in the case where the follow-up test stage is to different scenes are correctly detected,
Improve discrimination.
It is appreciated that when carrying out missing part detection to image using Siamese networks, it is necessary first to Siamese networks
Study is trained using sample, obtains the parameter of Siamese networks, so as to recycle the Siamese networks after training to member
Part image carries out missing part detection exactly.And when being trained to Siamese networks, it is necessary to be utilized respectively under various scenes
Positive sample set and negative sample set are trained, and it is not missing part that just Siamese networks can so, which fully learnt to element,
When picture situation, and picture situation when making the Siamese networks fully learn to element missing part, subsequently could correctly into
Row missing part detects.
Alternatively, in some possible embodiments of the present invention, the negative sample set includes the template image,
And image of element when being not present, or element exists, but situation when welding position is substantially wrong, or is not correct
Element when image etc..
It is appreciated that positive sample set and negative sample set as much as possible under different scenes are taken to Siamese nets
Network is trained, and may be such that the learning effect of Siamese networks is more preferable, so that follow-up missing part detection recognition accuracy is high.
Alternatively, in some possible embodiments of the present invention, the positive sample set of the part drawing picture and negative sample
This set includes training sample and test sample.
Wherein, training sample refers to be trained Siamese networks, and test sample refers to test after training
The effect of Siamese networks, both form the sample of the training stage to Siamese networks together.
Alternatively, in some possible embodiments of the present invention, the establishment part drawing picture aligns sample set
Conjunction and negative sample set, including:
Gather printed circuit board image;
Using printed circuit board (PCB) template image as reference, part drawing picture is intercepted on the printed circuit board image;
Gather the part drawing picture and align sample set and negative sample set.
Alternatively, in a little possible embodiments of the present invention, after printed circuit board diagram puts on interception part drawing picture
The part drawing picture can be labeled.
It is appreciated that due to being to need to carry out missing part detection to each element, so being trained to Siamese networks
When, it is necessary to which the sample set for intercepting the image of each element above printed circuit board image is trained.Also, in order in training
When each part drawing picture is distinguished, so needing to be labeled each part drawing picture before training to distinguish not
Same element.
Alternatively, in some possible embodiments of the present invention, camera can be set up in the production line, is adopted in batches
Collect the pcb board card graphic of different model, and avoid repeating to shoot a certain pcb board card with board tracking technique.So each model
Pcb board card include multiple images sample, each image pattern corresponds to certain pcb board card of a certain model, so as to so exist
The part drawing picture on pcb board card got also on different boards, ensures that sample possesses diversity.
Alternatively, it is described to intercept element in the plated circuit in some possible embodiments of the present invention
Image, including:
Part drawing picture is intercepted automatically using the positional information of the element above printing plate figure picture.
It is appreciated that after the positional information of element is known, then part drawing picture can be intercepted automatically according to the positional information.
Alternatively, in some possible embodiments of the present invention, the positional information for obtaining part drawing picture can be with
By the positional information of the element recorded in board-like file, or positional information by manually marking obtains.
Alternatively, the present invention some possible embodiments in, it is described part drawing picture is labeled including:
It is labeled according to element class information.
It is appreciated that, it is necessary to distinguished to the classification of element, thus when training recording element classification ability
Missing part detection is carried out to element exactly.
Alternatively, in other possible embodiments of the present invention, area can also be carried out to element by other
The mode divided is labeled element.
Alternatively, in some possible embodiments of the present invention, the collection part drawing picture aligns sample set
Before conjunction and negative sample set, the method further includes:
The position of element in the part drawing picture is obtained using template matches and is alignd to the part drawing picture;
The part drawing picture is normalized, with triggering perform the collection part drawing picture align sample set with
And the step of negative sample set.
It is appreciated that it is similar with the process tested Siamese networks, in the sample graph of collection Siamese networks
As when alignd to image so that element is located at the center of image, and image is normalized, which is known as pair
The preprocessing process of image, pretreatment is carried out to image will make Siamese network training effects more preferable.
Alternatively, in some possible embodiments of the present invention, if be trained to Siamese networks
Part drawing picture is pre-processed, then when the Siamese networks after using training carry out missing part detection, it is also desirable to element
Image is pre-processed, if do not pre-processed when being trained to Siamese networks to part drawing picture, then in profit
Also part drawing picture is not pre-processed when carrying out missing part detection with the Siamese networks after training.
Alternatively, it is described that the test is determined according to the similarity in some possible embodiments of the present invention
The corresponding element of image whether there is, including:
Judge the similarity whether within a preset range;
If the similarity is within a preset range, it is determined as that the element exists;
If the similarity within a preset range, is not determined as that the element is not present.
It is appreciated that since the similarity is the similarity degree for characterizing template image and test image, so working as
Similarity within a preset range when, pattern of descriptive parts image is similar to test image, then part drawing picture then exists, that is, element
Not missing part, otherwise, element missing part.
Alternatively, in some possible embodiments of the present invention, when the similarity is greater than or equal to preset value,
Then element exists, that is, element not missing part;When the similarity is less than preset value, then element is not present.
For the ease of being best understood from and implementing the such scheme of the embodiment of the present invention, with reference to some specific applied fields
Scape is illustrated.
Fig. 2 is referred to, Fig. 2 is a kind of flow diagram for detection method that second embodiment of the invention provides, wherein, such as
Shown in Fig. 2, a kind of detection method that second embodiment of the invention provides can include:
S201, collection printed circuit board image.
It is appreciated that due to being to need to carry out missing part detection using Siamese networks, so firstly the need of collecting sample figure
Picture.
Wherein, Siamese networks refer to a kind of deep neural network, according to the characteristics of Siamese networks, can calculate
Element feature at all levels, including low-level feature and high-level characteristic, so as to be divided according to the high-level characteristic of image image
More accurate result will be obtained during analysis.In order to carry out missing part detection to element, design Siamese networks include two structures one
The convolutional neural networks of sample and shared parameter, when carrying out missing part detection using Siamese networks, the template of difference input picture
Image and part drawing picture, so as to calculate the feature vector of two input pictures respectively, then calculate two feature vectors
Similarity, so as to determine whether a class component according to the value of similarity so as to judge whether missing part.Firstly the need of to Siamese
Network is trained, and obtains the parameter of Siamese networks, and the image collected in the case of various is utilized during the training
Sample, so as to situation existing for training different situations hypograph missing part and image.Then further according to training after
Siamese networks carry out missing part detection to element, the two convolutional neural networks are inputted in training stage and test phase
Image is all different, in the training stage, one of input template figure, and another input element image, in test phase
When, one of input template figure, another input test image.It is also, preceding to meter by making respectively in the training stage
Calculation obtains the feature vector of two images, then calculates the Euclidean distances of two feature vectors and obtain similarity.
Wherein, Prototype drawing is the picture of the standard for control.The Prototype drawing can be PCB Prototype drawings, so that right with it
The part drawing picture or test image that should be inputted also are PCB image, which can also be the difference being truncated to from PCB image
The image of each independent component is included, so that the image of corresponding input is also the image for including each independent component.
Alternatively, in some possible embodiments of the present invention, due to being to carry out missing part detection, institute to each element
Using the template image generally inputted in Siamese networks as the image for including an independent component, then defeated in the training stage
The part drawing picture entered is also the part drawing picture for the position being truncated to from PCB image, is also in the image of test phase input
The part drawing picture for the position being truncated under different situations from PCB image.
It is appreciated that, it is necessary first to PCB image is gathered, element image pattern could be intercepted.
Alternatively, in some possible embodiments of the present invention, camera can be set up in the production line, is adopted in batches
Collect the pcb board card graphic of different model, and avoid repeating to shoot a certain pcb board card with board tracking technique.So each model
Pcb board card include multiple images sample, each image pattern corresponds to certain pcb board card of a certain model, so as to so exist
The part drawing picture on pcb board card got also on different boards, ensures that sample possesses diversity.
S202, using printed circuit board (PCB) template image as reference, part drawing picture and to member is intercepted on printed circuit board image
Part image is labeled.
It is appreciated that due to being to need to carry out missing part detection to each element, so being trained to Siamese networks
When, it is necessary to which the sample set for intercepting the image of each element above printed circuit board image is trained.Also, in order in training
When each part drawing picture is distinguished, so needing to be labeled each part drawing picture before training to distinguish not
Same element.
Alternatively, it is described to intercept element in the plated circuit in some possible embodiments of the present invention
Image, including:
Part drawing picture is intercepted automatically using the positional information of the element above printing plate figure picture.
It is appreciated that after the positional information of element is known, then part drawing picture can be intercepted automatically according to the positional information.
Alternatively, in some possible embodiments of the present invention, the positional information for obtaining part drawing picture can be with
By the positional information of the element recorded in board-like file, or positional information by manually marking obtains.
Alternatively, the present invention some possible embodiments in, it is described part drawing picture is labeled including:
It is labeled according to element class information.
It is appreciated that, it is necessary to distinguished to the classification of element, thus when training recording element classification ability
Missing part detection is carried out to element exactly.
Alternatively, in other possible embodiments of the present invention, area can also be carried out to element by other
The mode divided is labeled element.
S203, acquisition elements image align sample set and negative sample set.
Wherein, the positive sample set includes the template image and the element image construction in the presence of the element
Part drawing picture pair, the negative sample set includes the part drawing when template image and the element are not present as structure
Into part drawing picture pair, the negative sample set further includes the element image construction in the presence of the template image and other elements
Part drawing picture pair.
It is to be appreciated that alternatively, in some possible embodiments of the present invention, when template image and test image are
During PCB image, then the positive sample set in sample set includes template image with being included on each position of components on template image
Be correct element when element image construction part drawing picture pair, negative sample set includes template image and each position of components
On element image construction when may be not present element part drawing picture pair, negative sample set further includes template image and each element
The part drawing picture pair of element image construction when element on position exists but may insert the element of mistake.
Alternatively, in other possible embodiments of the present invention, when template image and test image are from PCB
What is be truncated on image includes the image of each independent component respectively, so that the positive sample set in sample set includes Prototype drawing
As the part drawing picture pair with the image construction comprising the element in the template image, negative sample set includes template image with not wrapping
The part drawing picture pair of element-cont image construction, it is not in template image that negative sample set, which further includes template image and contains,
Element but the part drawing picture pair for containing the element image construction of other wrong components.
Alternatively, in some possible embodiments of the present invention, the positive sample set includes the template image,
And the sample that element exists and shot under each scene, the positive sample image such as shot in the case where light is bad,
And from different positions or the positive sample image of angle shot, or the positive sample image shot under other complex scenes, it is sharp
Siamese networks are trained with the positive sample image shot under each scene, so that Siamese networks are with stronger
Recognition capability, the part drawing picture for the non-missing part that can be shot in the case where the follow-up test stage is to different scenes are correctly detected,
Improve discrimination.
It is appreciated that when carrying out missing part detection to image using Siamese networks, it is necessary first to Siamese networks
Study is trained using sample, obtains the parameter of Siamese networks, so as to recycle the Siamese networks after training to member
Part image carries out missing part detection exactly.And when being trained to Siamese networks, it is necessary to be utilized respectively under various scenes
Positive sample set and negative sample set are trained, and it is not missing part that just Siamese networks can so, which fully learnt to element,
When picture situation, and picture situation when making the Siamese networks fully learn to element missing part, subsequently could correctly into
Row missing part detects.
Alternatively, in some possible embodiments of the present invention, the negative sample set includes the template image,
And image of element when being not present, or element exists, but situation when welding position is substantially wrong, or is not correct
Element when image etc..
It is appreciated that positive sample set and negative sample set as much as possible under different scenes are taken to Siamese nets
Network is trained, and may be such that the learning effect of Siamese networks is more preferable, so that follow-up missing part detection recognition accuracy is high.
Alternatively, in some possible embodiments of the present invention, the positive sample set of the part drawing picture and negative sample
This set includes training sample and test sample.
Wherein, training sample refers to be trained Siamese networks, and test sample refers to test after training
The effect of Siamese networks, both form the sample of the training stage to Siamese networks together.
Alternatively, in some possible embodiments of the present invention, the collection part drawing picture aligns sample set
Before conjunction and negative sample set, the method further includes:
The position of element in the part drawing picture is obtained using template matches and is alignd to the part drawing picture;
The part drawing picture is normalized.
It is appreciated that since part drawing seems the block diagram picture that intercepts to get off from template image, in order to make testing result
It is more accurate, it is necessary to the element in the part drawing picture for making to be truncated to is located at the center of image, and at the same time to the size of image
It is normalized, so to ensure the accuracy of subsequent treatment.The process is known as preprocessing process.
Alternatively, in some possible embodiments of the present invention, image can not also be pre-processed.
S204, utilize positive sample set and negative sample set training Siamese networks.
It is appreciated that, it is necessary to be trained using positive sample set and negative sample set to Siamese networks, so that
Siamese networks have missing part detectability.
S205, the Siamese networks by template image and test image input after training, and make forward calculation respectively
Obtain the feature vector of template image and test image.
The similarity of the feature vector of S206, computing module image and test image.
Wherein, the template image exists for element and is in corresponding part drawing picture, the test chart during normal place
As being part drawing picture that needs to be tested
Wherein, the similarity is the template image feelings similar to the feature of test image to Siamese network inputs
The measurement of condition, similarity be using Siamese e-learnings to template image and test image advanced features come judge templet
The value of the image degree whether similar to test image.
Alternatively, it is described by the template image and the test chart in some possible embodiments of the present invention
Before Siamese network of the input after training, the method further includes:
The position of the template image and element in the test image is obtained using template matches and to the Prototype drawing
As aliging with the test image;
The template image and the test image are normalized.
It is appreciated that since part drawing seems the block diagram picture that intercepts to get off from template image, in order to make testing result
It is more accurate, it is necessary to the element in the part drawing picture for making to be truncated to is located at the center of image, and at the same time to the size of image
It is normalized, so to ensure the accuracy of subsequent treatment.The process is known as preprocessing process.
Alternatively, in some possible embodiments of the present invention, image can not also be pre-processed.
Alternatively, in some possible embodiments of the present invention, if be trained to Siamese networks
Part drawing picture is pre-processed, then when the Siamese networks after using training carry out missing part detection, it is also desirable to element
Image is pre-processed, if do not pre-processed when being trained to Siamese networks to part drawing picture, then in profit
Also part drawing picture is not pre-processed when carrying out missing part detection with the Siamese networks after training.
S207, according to similarity determine that the corresponding element of test image whether there is.
It is appreciated that since similarity is to utilize the template image that Siamese e-learnings arrive and the advanced spy of test image
Sign come the judge templet image degree whether similar to test image value, so as to similarity come determine element whether mould
Whether plate image is similar to test image, namely determines that the corresponding element of the test image whether there is, i.e., judgment component is
No missing part.
Alternatively, it is described that the test is determined according to the similarity in some possible embodiments of the present invention
The corresponding element of image whether there is, including:
Judge the similarity whether within a preset range;
If the similarity is within a preset range, the element exists;
If not within a preset range, the element is not present the similarity.
It is appreciated that since the similarity is the similarity degree for characterizing template image and test image, so working as
Similarity within a preset range when, pattern of descriptive parts image is similar to test image, then part drawing picture then exists, that is, element
Not missing part, otherwise, element missing part.
Alternatively, in some possible embodiments of the present invention, when the similarity is greater than or equal to preset value,
Then element exists, that is, element not missing part;When the similarity is less than preset value, then element is not present.
As can be seen that in the scheme of the present embodiment, the template image and the test image are inputted after training
Siamese networks, and obtain the feature vector of the template image and the test image as forward calculation respectively, finally count
The similarity of two feature vectors is calculated, wherein, corresponding element when the template image exists for element and is in normal place
Image, the test image are part drawing picture that needs to be tested;Determine that the test image corresponds to according to the similarity
Element whether there is.Since Siamese networks can extract the advanced features of image, by image input after training
Siamese networks can exactly judgment component image whether missing part, recognition accuracy is high.
The embodiment of the present invention also provides a kind of inspection device for components, which includes:
Image input module, for template image and test image to be inputted the Siamese networks after training, and divides
The feature vector of the template image and the test image is not obtained as forward calculation, wherein, the template image is element
In the presence of and corresponding part drawing picture when being in normal place, the test image is part drawing picture that needs to be tested;
Computing module, for calculating the module map picture and the similarity of the feature vector of the test image;
Determining module, for determining that the corresponding element of the test image whether there is according to the similarity.
Specifically, referring to Fig. 3, Fig. 3 is a kind of structure diagram for detection device that third embodiment of the invention provides,
Wherein, as shown in figure 3, a kind of detection device 300 that third embodiment of the invention provides can include:
Image input module 310, computing module 320 and determining module 330.
Wherein, image input module 310, for inputting the template image and the test image after training
Siamese networks, and respectively the feature vector of the template image and the test image is obtained as forward calculation.
Wherein, referring to Fig. 1-a, Siamese networks are a kind of deep neural networks, can according to the characteristics of Siamese networks
Image feature at all levels, including low-level feature and high-level characteristic are calculated, so that according to the high-level characteristic of image to figure
As more accurate result will be obtained when being analyzed.In order to carry out images match, design Siamese networks include two structures
The same and shared parameter convolutional neural networks, when carrying out images match using Siamese networks, the mould of difference input picture
Plate image and test image, so as to calculate the feature vector of two input pictures respectively, then calculate two feature vectors
Similarity so that the similarity degree for judging two images according to the value of similarity judges whether two images match.
Wherein, the Siamese networks after training are provided with standard due to the training study by substantial amounts of sample image
The ability of images match really is carried out to template image and test image.
Wherein, template image is the picture of the standard for control, and test image is by being compareed with template image
So as to judge whether match with template image.
Computing module 320, for calculating the template image and the similarity of the feature vector of the test image.
Wherein, similarity is the parameter for judge templet image and test image similar programs.
Alternatively, can be in computing module image and the spy of test image in some possible embodiments of the present invention
Sign vector after, then calculate feature vector Euclidean distance obtain template image and test image feature vector similarity.
Determining module 330, for determining whether the test image matches with the template image according to the similarity.
Wherein, since similarity is the measurement to the similar situation of the feature of two images of Siamese network inputs, institute
With can whether similar to test image come judge templet image by similarity, namely judge templet image and test image whether
Matching.It is understood that the function of each function module of the detection device 300 of the present embodiment can be according to above method embodiment
In method specific implementation, its specific implementation process is referred to the associated description of above method embodiment, and details are not described herein again.
As can be seen that in the scheme of the present embodiment, detection device 300 is by template image and test image input by training
Siamese networks afterwards, and respectively the feature vector of the template image and the test image is obtained as forward calculation;Detection
Device 300 calculates the template image and the similarity of the feature vector of the test image;Detection device 300 is according to the phase
Determine whether the test image matches with the template image like degree.Since Siamese networks can extract the height of image
Level feature, by Siamese network of the image input after training can exactly judge templet image and test image whether
Matching, judging nicety rate are high.
Fig. 4 is referred to, Fig. 4 is a kind of structure diagram for detection device that fourth embodiment of the invention provides, wherein, such as
Shown in Fig. 4, a kind of detection device 400 that fourth embodiment of the invention provides can include:
Image input module 410, computing module 420 and determining module 430.
Wherein, image input module 410, for inputting the template image and the test image after training
Siamese networks, and respectively the feature vector of the template image and the test image is obtained as forward calculation.
Wherein, referring to Fig. 1-a, Siamese networks are a kind of deep neural networks, can according to the characteristics of Siamese networks
Image feature at all levels, including low-level feature and high-level characteristic are calculated, so that according to the high-level characteristic of image to figure
As more accurate result will be obtained when being analyzed.In order to carry out images match, design Siamese networks include two structures
The same and shared parameter convolutional neural networks, when carrying out images match using Siamese networks, the mould of difference input picture
Plate image and test image, so as to calculate the feature vector of two input pictures respectively, then calculate two feature vectors
Similarity so that the similarity degree for judging two images according to the value of similarity judges whether two images match.
Wherein, the Siamese networks after training are provided with standard due to the training study by substantial amounts of sample image
The ability of images match really is carried out to template image and test image.
Wherein, template image is the picture of the standard for control, and test image is by being compareed with template image
So as to judge whether match with template image.
Computing module 420, for calculating the template image and the similarity of the feature vector of the test image.
Wherein, similarity is the parameter for judge templet image and test image similar programs.
Alternatively, can be in computing module image and the spy of test image in some possible embodiments of the present invention
Sign vector after, then calculate feature vector Euclidean distance obtain template image and test image feature vector similarity.
Determining module 430, for determining whether the test image matches with the template image according to the similarity.
Wherein, since similarity is the measurement to the similar situation of the feature of two images of Siamese network inputs, institute
With can whether similar to test image come judge templet image by similarity, namely judge templet image and test image whether
Matching.
Alternatively, in some possible embodiments of the present invention, the template image exists for element and in mark
Corresponding part drawing picture when level is put, the test image are part drawing picture that needs to be tested, and the determining module 430 has
Body is used for:
Determine that the corresponding element of the test image whether there is according to the similarity.
Wherein, which can be PCB Prototype drawings, so that the part drawing picture or test image of corresponding input
For PCB image, which can also be the image for including each independent component respectively being truncated to from PCB image, so that
The test image of corresponding input is also the image for including each independent component.
Alternatively, in some possible embodiments of the present invention, due to being to carry out missing part detection, institute to each element
Using the template image generally inputted in Siamese networks as the image for including an independent component, then defeated in the training stage
The part drawing picture entered is also the part drawing picture for the position being truncated to from PCB image, is also in the image of test phase input
The part drawing picture for the position being truncated under different situations from PCB image.
Alternatively,, can when template image is the template image of element in some possible embodiments of the present invention
To understand, template image exists for element and the position of element is in the part drawing picture of a correct position, and test image is then
Missing part is judged whether according to template image.
It is appreciated that since Siamese networks may determine that whether test image matches with template image, so working as template
Image and test image for part drawing as when, can be determined according to similarity part drawing picture test image whether with template image
Whether match, namely the corresponding element of definite test image whether there is.
Alternatively, in some possible embodiments of the present invention, the inspection device for components 400 further includes:
Pretreatment module 440, for obtaining the template image and element in the test image using template matches
Simultaneously align to the template image with the test image position;
The template image and the test image are normalized, to trigger described in the execution of described image input module
The step of template image and the test image are inputted into the Siamese networks after training.
It is appreciated that since part drawing seems the block diagram picture that intercepts to get off from template image, in order to make testing result
It is more accurate, it is necessary to the element in the part drawing picture for making to be truncated to is located at the center of image, and at the same time to the size of image
It is normalized, so to ensure the accuracy of subsequent treatment.The process is known as preprocessing process.
Alternatively, in some possible embodiments of the present invention, image can not also be pre-processed.
Alternatively, in some possible embodiments of the present invention, the inspection device for components 400 further includes:
Sample creation module 450, sample set and negative sample set are aligned for creating the part drawing picture, wherein,
The positive sample set includes the template image and the part drawing picture pair of the element image construction in the presence of the element,
The negative sample set includes the part drawing picture of the element image construction when template image is not present with the element
Right, the negative sample set further includes the template image and the part drawing picture of the element image construction in the presence of other elements
It is right;
Training module 460, for training the Siamese nets using the positive sample set and the negative sample set
Network, to trigger, the execution of described image input module is described to input the template image and the test image after training
The step of Siamese networks.
It is to be appreciated that alternatively, in some possible embodiments of the present invention, when template image and test image are
During PCB image, then the positive sample set in sample set includes template image with being included on each position of components on template image
Be correct element when element image construction part drawing picture pair, negative sample set includes template image and each position of components
On element image construction when may be not present element part drawing picture pair, negative sample set further includes template image and each element
The part drawing picture pair of element image construction when element on position exists but may insert the element of mistake.
Alternatively, in other possible embodiments of the present invention, when template image and test image are from PCB
What is be truncated on image includes the image of each independent component respectively, so that the positive sample set in sample set includes Prototype drawing
As the part drawing picture pair with the image construction comprising the element in the template image, negative sample set includes template image with not wrapping
The part drawing picture pair of element-cont image construction, it is not in template image that negative sample set, which further includes template image and contains,
Element but the part drawing picture pair for containing the element image construction of other wrong components.
Alternatively, in some possible embodiments of the present invention, the positive sample set includes the template image,
And the sample that element exists and shot under each scene, the positive sample image such as shot in the case where light is bad,
And from different positions or the positive sample image of angle shot, or the positive sample image shot under other complex scenes, it is sharp
Siamese networks are trained with the positive sample image shot under each scene, so that Siamese networks are with stronger
Recognition capability, the part drawing picture for the non-missing part that can be shot in the case where the follow-up test stage is to different scenes are correctly detected,
Improve discrimination.
It is appreciated that when carrying out missing part detection to image using Siamese networks, it is necessary first to Siamese networks
Study is trained using sample, obtains the parameter of Siamese networks, so as to recycle the Siamese networks after training to member
Part image carries out missing part detection exactly.And when being trained to Siamese networks, it is necessary to be utilized respectively under various scenes
Positive sample set and negative sample set are trained, and it is not missing part that just Siamese networks can so, which fully learnt to element,
When picture situation, and picture situation when making the Siamese networks fully learn to element missing part, subsequently could correctly into
Row missing part detects.
Alternatively, in some possible embodiments of the present invention, the negative sample set includes the template image,
And image of element when being not present, or element exists, but situation when welding position is substantially wrong, or is not correct
Element when image etc..
It is appreciated that positive sample set and negative sample set as much as possible under different scenes are taken to Siamese nets
Network is trained, and may be such that the learning effect of Siamese networks is more preferable, so that follow-up missing part detection recognition accuracy is high.
Alternatively, in some possible embodiments of the present invention, the positive sample set of the part drawing picture and negative sample
This set includes training sample and test sample.
Wherein, training sample refers to be trained Siamese networks, and test sample refers to test after training
The effect of Siamese networks, both form the sample of the training stage to Siamese networks together.
Alternatively, in some possible embodiments of the present invention, the sample creation module 450 includes:
Image acquisition units 451, gather printed circuit board image;
Interception unit 452, for using printed circuit board (PCB) template image as reference, being intercepted on the printed circuit board image
Part drawing picture;
Sample collection unit 453, sample set and negative sample set are aligned for gathering the part drawing picture.
Alternatively, in a little possible embodiments of the present invention, after printed circuit board diagram puts on interception part drawing picture
The part drawing picture can be labeled.
It is appreciated that due to being to need to carry out missing part detection to each element, so being trained to Siamese networks
When, it is necessary to which the sample set for intercepting the image of each element above printed circuit board image is trained.Also, in order in training
When each part drawing picture is distinguished, so needing to be labeled each part drawing picture before training to distinguish not
Same element.
Alternatively, in some possible embodiments of the present invention, camera can be set up in the production line, is adopted in batches
Collect the pcb board card graphic of different model, and avoid repeating to shoot a certain pcb board card with board tracking technique.So each model
Pcb board card include multiple images sample, each image pattern corresponds to certain pcb board card of a certain model, so as to so exist
The part drawing picture on pcb board card got also on different boards, ensures that sample possesses diversity.
Alternatively, in some possible embodiments of the present invention, the interception unit 452 is in the plated circuit
It is upper interception part drawing picture be specially:
Part drawing picture is intercepted automatically using the positional information of the element above printing plate figure picture.
It is appreciated that after the positional information of element is known, then part drawing picture can be intercepted automatically according to the positional information.
Alternatively, in some possible embodiments of the present invention, the positional information for obtaining part drawing picture can be with
By the positional information of the element recorded in board-like file, or positional information by manually marking obtains.
Alternatively, in some possible embodiments of the present invention, the interception unit 452 is to part drawing picture into rower
Note is specially:
It is labeled according to element class information.
It is appreciated that, it is necessary to distinguished to the classification of element, thus when training recording element classification ability
Missing part detection is carried out to element exactly.
Alternatively, in other possible embodiments of the present invention, area can also be carried out to element by other
The mode divided is labeled element.
Alternatively, in some possible embodiments of the present invention, the sample creation module 450 further includes:
Pretreatment unit 454, for obtaining in the part drawing picture position of element and to the member using template matches
Part image aligns;
The part drawing picture is normalized, the collection part drawing is performed to trigger the sample collection unit
As the step of aligning sample set and negative sample set.
It is appreciated that it is similar with the process tested Siamese networks, in the sample graph of collection Siamese networks
As when alignd to image so that element is located at the center of image, and image is normalized, which is known as pair
The preprocessing process of image, pretreatment is carried out to image will make Siamese network training effects more preferable.
Alternatively, in some possible embodiments of the present invention, if be trained to Siamese networks
Part drawing picture is pre-processed, then when the Siamese networks after using training carry out missing part detection, it is also desirable to element
Image is pre-processed, if do not pre-processed when being trained to Siamese networks to part drawing picture, then in profit
Also part drawing picture is not pre-processed when carrying out missing part detection with the Siamese networks after training.
Alternatively, in some possible embodiments of the present invention, the determining module 430 is specifically used for:
Judge the similarity whether within a preset range;
If the similarity is within a preset range, it is determined as that the element exists;
If the similarity within a preset range, is not determined as that the element is not present.
It is appreciated that since the similarity is the similarity degree for characterizing template image and test image, so working as
Similarity within a preset range when, pattern of descriptive parts image is similar to test image, then part drawing picture then exists, that is, element
Not missing part, otherwise, element missing part.
Alternatively, in some possible embodiments of the present invention, when the similarity is greater than or equal to preset value,
Then element exists, that is, element not missing part;When the similarity is less than preset value, then element is not present.
It is understood that the function of each function module of the detection device 400 of the present embodiment can be real according to the above method
The method specific implementation in example is applied, its specific implementation process is referred to the associated description of above method embodiment, herein no longer
Repeat.
As can be seen that in the scheme of the present embodiment, detection device 400 is by template image and test image input by training
Siamese networks afterwards, and respectively the feature vector of the template image and the test image is obtained as forward calculation;Detection
Device 400 calculates the template image and the similarity of the feature vector of the test image;Detection device 400 is according to the phase
Determine whether the test image matches with the template image like degree.Since Siamese networks can extract the height of image
Level feature, by Siamese network of the image input after training can exactly judge templet image and test image whether
Matching, judging nicety rate are high.
Referring to Fig. 5, Fig. 5 is a kind of structure diagram for detection device that fifth embodiment of the invention provides.Such as Fig. 5 institutes
Show, fifth embodiment of the invention, which provides a kind of detection device 500, to be included:At least one bus 501, be connected with bus to
A few processor 502 and at least one processor 503 being connected with bus.Wherein, processor 502 is adjusted by bus 501
With the code stored in memory 503 for template image and test image are inputted the Siamese networks after training,
And the feature vector of the template image and the test image is obtained as forward calculation respectively;Calculate the template image and institute
State the similarity of the feature vector of test image;Determine whether are the test image and the template image according to the similarity
Matching.
Wherein, the Siamese networks after training are provided with standard due to the training study by substantial amounts of sample image
The ability of images match really is carried out to template image and test image.
Wherein, template image is the picture of the standard for control, and test image is by being compareed with template image
So as to judge whether match with template image.
Wherein, similarity is the parameter for judge templet image and test image similar programs.
Alternatively, in some possible embodiments of the present invention, the template image exists for element and in mark
Corresponding part drawing picture when level is put, the test image are part drawing picture that needs to be tested, 502 basis of processor
When the similarity determines whether the test image matches with the template image, it is additionally operable to:
Determine that the corresponding element of the test image whether there is according to the similarity.
Wherein, which can be PCB Prototype drawings, so that the part drawing picture or test image of corresponding input
For PCB image, which can also be the image for including each independent component respectively being truncated to from PCB image, so that
The test image of corresponding input is also the image for including each independent component.
Alternatively, in some possible embodiments of the present invention, due to being to carry out missing part detection, institute to each element
Using the template image generally inputted in Siamese networks as the image for including an independent component, then defeated in the training stage
The part drawing picture entered is also the part drawing picture for the position being truncated to from PCB image, is also in the image of test phase input
The part drawing picture for the position being truncated under different situations from PCB image.
Wherein, the similarity is the measurement to the similar situation of the feature of two images of Siamese network inputs, and
And since the Siamese networks after training can preparatively identify that the part drawing shot under different scenes seems no missing part feelings
Condition, thus can according to the similarity value judgment component whether missing part.
Alternatively, it is described by the template image and the test chart in some possible embodiments of the present invention
Before Siamese network of the input after training, the processor 502 is additionally operable to:
The position of the template image and element in the test image is obtained using template matches and to the Prototype drawing
As aliging with the test image;
The template image and the test image are normalized, with triggering perform it is described by the template image with
The test image inputs the step of Siamese networks after training.
Alternatively, it is described by the template image and the test chart in some possible embodiments of the present invention
Before Siamese network of the input after training, the processor 502 is additionally operable to:
Create the part drawing picture and align sample set and negative sample set, wherein, the positive sample set includes institute
Template image and the part drawing picture pair of the element image construction in the presence of the element are stated, the negative sample set includes institute
The part drawing picture pair of element image construction when template image is not present with the element is stated, the negative sample set is also wrapped
Include the template image and the part drawing picture pair of the element image construction in the presence of other elements;
The Siamese networks are trained using the positive sample set and the negative sample set, institute is performed to trigger
State the step of template image and the test image are inputted into the Siamese networks after training.
Alternatively, in some possible embodiments of the present invention, the positive sample set of the part drawing picture and negative sample
This set includes training sample and test sample.
Wherein, training sample refers to be trained Siamese networks, and test sample refers to test after training
The effect of Siamese networks, both form the sample of the training stage to Siamese networks together.
Alternatively, in some possible embodiments of the present invention, the establishment part drawing picture aligns sample set
When conjunction and negative sample set, the processor 502 is specifically used for:
Gather printed circuit board image;
Using printed circuit board (PCB) template image as reference, part drawing picture is intercepted on the printed circuit board image;
Gather the part drawing picture and align sample set and negative sample set.
Alternatively, in some possible embodiments of the present invention, camera can be set up in the production line, is adopted in batches
Collect the pcb board card graphic of different model, and avoid repeating to shoot a certain pcb board card with board tracking technique.So each model
Pcb board card include multiple images sample, each image pattern corresponds to certain pcb board card of a certain model, so as to so exist
The part drawing picture on pcb board card got also on different boards, ensures that sample does not repeat and quantity is abundant.
Alternatively, it is described to intercept element in the plated circuit in some possible embodiments of the present invention
Image, the processor 502 are specifically used for:
Part drawing picture is intercepted automatically using the positional information of the element above printing plate figure picture.
It is appreciated that after the positional information of element is known, then part drawing picture can be intercepted automatically according to the positional information.
Alternatively, in some possible embodiments of the present invention, described to be labeled to part drawing picture, the processing
Device 502 is specifically used for:
It is labeled according to element class information.
Alternatively, in other possible embodiments of the present invention, area can also be carried out to element by other
The mode divided is labeled element.
Alternatively, in some possible embodiments of the present invention, the collection part drawing picture aligns sample set
Before conjunction and negative sample set, the processor 502 is additionally operable to:
The position of element in the part drawing picture is obtained using template matches and is alignd to the part drawing picture;
The part drawing picture is normalized, with triggering perform the collection part drawing picture align sample set with
And the step of negative sample set.
Alternatively, in some possible embodiments of the present invention, the processor 502 is determined according to the similarity
The corresponding element of the test image whether there is, and the processor 502 is specifically used for:
Judge the similarity whether within a preset range;
If the similarity is within a preset range, it is determined as that the element exists;
If the similarity within a preset range, is not determined as that the element is not present.
It is understood that the function of each function module of the inspection device for components 500 of the present embodiment can be according to above-mentioned side
Method specific implementation in method embodiment, its specific implementation process are referred to the associated description of above method embodiment, herein
Repeat no more.
It is understood that the function of each function module of the detection device 500 of the present embodiment can be real according to the above method
The method specific implementation in example is applied, its specific implementation process is referred to the associated description of above method embodiment, herein no longer
Repeat.
As can be seen that in the scheme of the present embodiment, detection device 500 is by template image and test image input by training
Siamese networks afterwards, and respectively the feature vector of the template image and the test image is obtained as forward calculation;Detection
Device 500 calculates the template image and the similarity of the feature vector of the test image;Detection device 500 is according to the phase
Determine whether the test image matches with the template image like degree.Since Siamese networks can extract the height of image
Level feature, by Siamese network of the image input after training can exactly judge templet image and test image whether
Matching, judging nicety rate are high.
The embodiment of the present invention also provides a kind of computer-readable storage medium, wherein, which can be stored with journey
Sequence, the part or all of step of any detection method when which performs described in including above method embodiment.
It should be noted that for foregoing each method embodiment, in order to be briefly described, therefore it is all expressed as a series of
Combination of actions, but those skilled in the art should know, the present invention and from the limitation of described sequence of movement because
According to the present invention, some steps can use other orders or be carried out at the same time.Secondly, those skilled in the art should also know
Know, embodiment described in this description belongs to preferred embodiment, and involved action and module are not necessarily of the invention
It is necessary.
In the above-described embodiments, the description to each embodiment all emphasizes particularly on different fields, and does not have the portion being described in detail in some embodiment
Point, it may refer to the associated description of other embodiment.
In several embodiments provided herein, it should be understood that disclosed device, can be by another way
Realize.For example, device embodiment described above is only schematical, such as the division of the unit, it is only one kind
Division of logic function, can there is an other dividing mode when actually realizing, such as multiple units or component can combine or can
To be integrated into another system, or some features can be ignored, or not perform.Another, shown or discussed is mutual
Coupling, direct-coupling or communication connection can be by some interfaces, the INDIRECT COUPLING or communication connection of device or unit,
Can be electrical or other forms.
The unit illustrated as separating component may or may not be physically separate, be shown as unit
The component shown may or may not be physical location, you can with positioned at a place, or can also be distributed to multiple
In network unit.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs
's.
In addition, each functional unit in various embodiments of the present invention can be integrated in a processing unit, also may be used
To be that unit is individually physically present, can also two or more units integrate in a unit.It is above-mentioned integrated
Unit can both be realized in the form of hardware, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and is used as independent production marketing or use
When, it can be stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantially
The part to contribute in other words to the prior art or all or part of the technical solution can be in the form of software products
Embody, which is stored in a storage medium, including some instructions are used so that a computer
Equipment (can be embedded device, personal computer, server or network equipment etc.) is performed described in each embodiment of the present invention
The all or part of step of method.And foregoing storage medium includes:USB flash disk, read-only storage (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disc or CD etc. are various
Can be with the medium of store program codes.
The above, the above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although with reference to before
Embodiment is stated the present invention is described in detail, it will be understood by those of ordinary skill in the art that:It still can be to preceding
State the technical solution described in each embodiment to modify, or equivalent substitution is carried out to which part technical characteristic;And these
Modification is replaced, and the essence of appropriate technical solution is departed from the scope of various embodiments of the present invention technical solution.
Claims (10)
- A kind of 1. detection method, it is characterised in that the described method includes:Creating component image aligns sample set and negative sample set;Wherein, the positive sample set include template image with The part drawing picture pair of element image construction in the presence of element, the template image exist for the element and are in normal place When corresponding part drawing picture;Part drawing when the negative sample set is not present including the template image with the element is as structure Into part drawing picture pair, the negative sample set further includes the element image construction in the presence of the template image and other elements Part drawing picture pair;Utilize the positive sample set and negative sample set training Siamese networks;The template image and test image are inputted into the Siamese networks after training, and obtained respectively as forward calculation The template image and the feature vector of the test image;Calculate the template image and the similarity of the feature vector of the test image;Determine whether the test image matches with the template image according to the similarity.
- 2. according to the method described in claim 1, it is characterized in that, the test image is part drawing that needs to be tested Picture, it is described to determine whether the test image matches with the template image according to the similarity, including:Determine that the corresponding element of the test image whether there is according to the similarity.
- 3. according to the method described in claim 2, it is characterized in that, described pass through the template image and test image input Before Siamese networks after training, the method further includes:Using template matches obtain in the template image and the test image position of element and to the template image with The test image is alignd;The template image and the test image are normalized, with triggering perform it is described by the template image with it is described Test image inputs the step of Siamese networks after training.
- 4. according to the method described in claim 3, it is characterized in that, the creating component image aligns sample set and negative sample This set, including:Gather printed circuit board image;Using printed circuit board (PCB) template image as reference, part drawing picture is intercepted on the printed circuit board image;Acquisition elements image aligns sample set and negative sample set.
- 5. according to the method described in claim 4, before the acquisition elements image aligns sample set and negative sample set, The method further includes:The position of element in the part drawing picture is obtained using template matches and is alignd to the part drawing picture;The part drawing picture is normalized, performing the acquisition elements image with triggering aligns sample set and negative sample The step of set.
- 6. according to the method described in claim 5, it is characterized in that, described determine the test image pair according to the similarity The element answered whether there is, including:Judge the similarity whether within a preset range;If the similarity is within a preset range, it is determined as that the element exists;If the similarity within a preset range, is not determined as that the element is not present.
- 7. a kind of detection device, it is characterised in that described device includes:Sample creation module, sample set and negative sample set are aligned for creating component image, wherein, the positive sample collection Closing includes template image and the part drawing picture pair of the element image construction in the presence of element, and the template image is deposited for the element And corresponding part drawing picture when being in normal place, the negative sample set do not deposited with the element including the template image When element image construction part drawing picture pair, the negative sample set, which further includes the template image and other elements, to be existed When element image construction part drawing picture pair;Training module, for utilizing the positive sample set and negative sample set training Siamese networks;Image input module, for the template image and test image to be inputted the Siamese networks after training, and divides The feature vector of the template image and the test image is not obtained as forward calculation;Computing module, for calculating the template image and the similarity of the feature vector of the test image;Determining module, for determining whether the test image matches with the template image according to the similarity.
- 8. device according to claim 7, it is characterised in that the test image is part drawing that needs to be tested Picture, the determining module are specifically used for:Determine that the corresponding element of the test image whether there is according to the similarity.
- 9. device according to claim 8, it is characterised in that described device further includes:Pretreatment module, for obtaining the template image and the position of element in the test image and right using template matches The template image aligns with the test image;The template image and the test image are normalized, it is described by institute to trigger the execution of described image input module State the step of template image inputs the Siamese networks after training with the test image.
- 10. device according to claim 9, it is characterised in that the sample creation module includes:Image acquisition units, for gathering printed circuit board image;Interception unit, for using printed circuit board (PCB) template image as reference, part drawing to be intercepted on the printed circuit board image Picture;Sample collection unit, sample set and negative sample set are aligned for acquisition elements image.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510527486.9A CN105184778B (en) | 2015-08-25 | 2015-08-25 | A kind of detection method and device |
PCT/CN2016/096551 WO2017032311A1 (en) | 2015-08-25 | 2016-08-24 | Detection method and apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510527486.9A CN105184778B (en) | 2015-08-25 | 2015-08-25 | A kind of detection method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105184778A CN105184778A (en) | 2015-12-23 |
CN105184778B true CN105184778B (en) | 2018-04-24 |
Family
ID=54906831
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510527486.9A Active CN105184778B (en) | 2015-08-25 | 2015-08-25 | A kind of detection method and device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN105184778B (en) |
WO (1) | WO2017032311A1 (en) |
Families Citing this family (35)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105184778B (en) * | 2015-08-25 | 2018-04-24 | 广州视源电子科技股份有限公司 | A kind of detection method and device |
CN105957065A (en) * | 2016-04-21 | 2016-09-21 | 广州视源电子科技股份有限公司 | Method and system for detecting omitted elements |
CN106251333B (en) * | 2016-07-13 | 2019-02-26 | 广州视源电子科技股份有限公司 | The anti-part detection method of element and system |
CN106204602B (en) * | 2016-07-13 | 2019-02-01 | 广州视源电子科技股份有限公司 | The anti-part detection method of element and system |
CN106530284A (en) * | 2016-10-21 | 2017-03-22 | 广州视源电子科技股份有限公司 | Solder joint type detection method and apparatus based on image identification |
CN106650630B (en) * | 2016-11-11 | 2019-08-23 | 纳恩博(北京)科技有限公司 | A kind of method for tracking target and electronic equipment |
CN106909625A (en) * | 2017-01-20 | 2017-06-30 | 清华大学 | A kind of image search method and system based on Siamese networks |
CN107220277A (en) * | 2017-04-14 | 2017-09-29 | 西北大学 | Image retrieval algorithm based on cartographical sketching |
CN107967255A (en) * | 2017-11-08 | 2018-04-27 | 北京广利核系统工程有限公司 | A kind of method and system for judging text similarity |
CN108171714B (en) * | 2017-11-13 | 2021-09-21 | 广东三维家信息科技有限公司 | Fracture area identification method and system based on pair-wise comparison |
CN108171184B (en) * | 2018-01-03 | 2020-04-10 | 南京理工大学 | Method for re-identifying pedestrians based on Simese network |
CN108399382A (en) | 2018-02-13 | 2018-08-14 | 阿里巴巴集团控股有限公司 | Vehicle insurance image processing method and device |
CN108665485B (en) * | 2018-04-16 | 2021-07-02 | 华中科技大学 | Target tracking method based on relevant filtering and twin convolution network fusion |
CN108846358B (en) * | 2018-06-13 | 2021-10-26 | 浙江工业大学 | Target tracking method for feature fusion based on twin network |
CN108830850B (en) * | 2018-06-28 | 2020-10-23 | 信利(惠州)智能显示有限公司 | Automatic optical detection picture analysis method and equipment |
CN109002784B (en) * | 2018-06-29 | 2021-04-13 | 国信优易数据股份有限公司 | Street view identification method and system |
CN108960258A (en) * | 2018-07-06 | 2018-12-07 | 江苏迪伦智能科技有限公司 | A kind of template matching method based on self study depth characteristic |
CN108918536B (en) * | 2018-07-13 | 2021-01-26 | 广东工业大学 | Tire mold surface character defect detection method, device, equipment and storage medium |
CN109344661B (en) * | 2018-09-06 | 2023-05-30 | 南京聚铭网络科技有限公司 | Machine learning-based micro-proxy webpage tamper-proofing method |
CN110443777B (en) * | 2018-10-09 | 2023-03-10 | 广东仙童智能机器人科技有限公司 | PCB image alignment method and device and computer storage medium |
CN109543057A (en) * | 2018-11-20 | 2019-03-29 | 广州逗号智能零售有限公司 | Commodity recognition method, device, equipment and storage medium based on intelligent cashier platform |
CN109670073B (en) * | 2018-12-20 | 2021-03-23 | 科大讯飞股份有限公司 | Information conversion method and device and interactive auxiliary system |
CN109767456A (en) * | 2019-01-09 | 2019-05-17 | 上海大学 | A kind of method for tracking target based on SiameseFC frame and PFP neural network |
CN110782480B (en) * | 2019-10-15 | 2023-08-04 | 哈尔滨工程大学 | Infrared pedestrian tracking method based on online template prediction |
CN113012088A (en) * | 2019-12-03 | 2021-06-22 | 浙江大搜车软件技术有限公司 | Circuit board fault detection and twin network training method, device and equipment |
CN110967851B (en) * | 2019-12-26 | 2022-06-21 | 成都数之联科技股份有限公司 | Line extraction method and system for array image of liquid crystal panel |
CN111524162B (en) * | 2020-04-15 | 2022-04-01 | 上海摩象网络科技有限公司 | Method and device for retrieving tracking target and handheld camera |
CN111914508A (en) * | 2020-08-19 | 2020-11-10 | 创新奇智(南京)科技有限公司 | Component detection method and device, electronic equipment and readable storage medium |
CN112559342A (en) * | 2020-12-09 | 2021-03-26 | 上海米哈游天命科技有限公司 | Method, device and equipment for acquiring picture test image and storage medium |
CN112816474B (en) * | 2021-01-07 | 2022-02-01 | 武汉大学 | Target perception-based depth twin network hyperspectral video target tracking method |
TWI772181B (en) * | 2021-09-14 | 2022-07-21 | 台達電子工業股份有限公司 | Automatic recognizing system and automatic recognizing method for a pick-up position of a printed circuit board |
CN114619591B (en) * | 2022-05-16 | 2022-08-26 | 河南源宏高分子新材料有限公司 | Sorting process in high polymer material regeneration process |
WO2024044915A1 (en) * | 2022-08-29 | 2024-03-07 | 西门子股份公司 | Image comparison method and apparatus for error detection, and computer device |
CN115546219B (en) * | 2022-12-05 | 2023-10-20 | 广州镭晨智能装备科技有限公司 | Detection plate type generation method, plate card defect detection method, device and product |
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 |
---|---|---|---|---|
CN101464946A (en) * | 2009-01-08 | 2009-06-24 | 上海交通大学 | Detection method based on head identification and tracking characteristics |
CN103065135A (en) * | 2013-01-25 | 2013-04-24 | 上海理工大学 | License number matching algorithm based on digital image processing |
CN103310453A (en) * | 2013-06-17 | 2013-09-18 | 北京理工大学 | Rapid image registration method based on sub-image corner features |
CN103679158A (en) * | 2013-12-31 | 2014-03-26 | 北京天诚盛业科技有限公司 | Face authentication method and device |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7046842B2 (en) * | 1999-08-17 | 2006-05-16 | National Instruments Corporation | System and method for color characterization using fuzzy pixel classification with application in color matching and color match location |
CN105184778B (en) * | 2015-08-25 | 2018-04-24 | 广州视源电子科技股份有限公司 | A kind of detection method and device |
-
2015
- 2015-08-25 CN CN201510527486.9A patent/CN105184778B/en active Active
-
2016
- 2016-08-24 WO PCT/CN2016/096551 patent/WO2017032311A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101464946A (en) * | 2009-01-08 | 2009-06-24 | 上海交通大学 | Detection method based on head identification and tracking characteristics |
CN103065135A (en) * | 2013-01-25 | 2013-04-24 | 上海理工大学 | License number matching algorithm based on digital image processing |
CN103310453A (en) * | 2013-06-17 | 2013-09-18 | 北京理工大学 | Rapid image registration method based on sub-image corner features |
CN103679158A (en) * | 2013-12-31 | 2014-03-26 | 北京天诚盛业科技有限公司 | Face authentication method and device |
Non-Patent Citations (1)
Title |
---|
基于卷积的三维模型特征提取;王添翼;《中国优秀硕博士学位论文全文数据库(硕士) 信息科技辑》;20060915;第3.4节,第3.6节、图17 * |
Also Published As
Publication number | Publication date |
---|---|
WO2017032311A1 (en) | 2017-03-02 |
CN105184778A (en) | 2015-12-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105184778B (en) | A kind of detection method and device | |
CN108830188A (en) | Vehicle checking method based on deep learning | |
CN103996239B (en) | A kind of bill positioning identifying method merged based on multi thread and system | |
CN109740606B (en) | Image identification method and device | |
CN108399386A (en) | Information extracting method in pie chart and device | |
CN105574550A (en) | Vehicle identification method and device | |
CN105426917A (en) | Component classification method and apparatus | |
CN107818322A (en) | A kind of vehicle VIN code tampering detection system and methods for vehicle annual test | |
CN109670383B (en) | Video shielding area selection method and device, electronic equipment and system | |
CN104268498A (en) | Two-dimension code recognition method and terminal | |
CN109272016A (en) | Object detection method, device, terminal device and computer readable storage medium | |
CN107622271B (en) | Handwritten text line extraction method and system | |
CN110490135A (en) | Vehicle annual test method, apparatus, computer equipment and storage medium | |
CN104867225A (en) | Banknote face orientation identification method and apparatus | |
CN109918523B (en) | Circuit board component detection method based on YOLO9000 algorithm | |
CN110070090A (en) | A kind of logistic label information detecting method and system based on handwriting identification | |
CN107316029A (en) | A kind of live body verification method and equipment | |
CN109858476A (en) | The extending method and electronic equipment of label | |
CN109740040A (en) | Method for recognizing verification code, device, storage medium and computer equipment | |
CN110427962A (en) | A kind of test method, electronic equipment and computer readable storage medium | |
CN107493469A (en) | A kind of method and device of the area-of-interest of determination SFR test cards | |
CN110046085A (en) | The method and device of the application program control shown on identification terminal equipment | |
CN110162454A (en) | Game running method and device, storage medium and electronic device | |
CN107403179A (en) | A kind of register method and device of article packaged information | |
CN109074663A (en) | Object volume measuring method, related device and computer readable storage medium |
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 |