CN110675380A - Method for calibrating position of metal plug on circuit board and storage medium - Google Patents

Method for calibrating position of metal plug on circuit board and storage medium Download PDF

Info

Publication number
CN110675380A
CN110675380A CN201910901642.1A CN201910901642A CN110675380A CN 110675380 A CN110675380 A CN 110675380A CN 201910901642 A CN201910901642 A CN 201910901642A CN 110675380 A CN110675380 A CN 110675380A
Authority
CN
China
Prior art keywords
value
metal plug
metal
circuit board
column
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.)
Pending
Application number
CN201910901642.1A
Other languages
Chinese (zh)
Inventor
钱斌
陈琛
牛孜飏
谭龙田
陈彦宇
马雅奇
谭泽汉
李春光
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Gree Electric Appliances Inc of Zhuhai
Zhuhai Lianyun Technology Co Ltd
Original Assignee
Gree Electric Appliances Inc of Zhuhai
Zhuhai Lianyun Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Gree Electric Appliances Inc of Zhuhai, Zhuhai Lianyun Technology Co Ltd filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN201910901642.1A priority Critical patent/CN110675380A/en
Publication of CN110675380A publication Critical patent/CN110675380A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30141Printed circuit board [PCB]

Abstract

The invention discloses a position calibration method and a storage medium for metal plug pins on a circuit board, wherein the method comprises the steps of extracting a regional image containing suspected metal plug pins from a color image of the circuit board based on a metal plug pin regional extraction model, and acquiring position information of the suspected metal plug pins; obtaining value intervals of RGB (red, green and blue) three channels of pixel points at the positions of suspected metal insertion columns in each regional image; judging whether the difference value between the value interval of the RGB three channels and the confidence interval of the corresponding RGB three channels meets a preset condition or not: if the preset conditions are met, calibrating the position of the metal plug-in column on the color image of the circuit board according to the position information of the metal plug-in column; if the preset condition is not met, the position information of the metal insertion column is abandoned. The invention can realize the intelligent detection of the metal plug-in post area on the circuit board.

Description

Method for calibrating position of metal plug on circuit board and storage medium
Technical Field
The invention belongs to the technical field of circuit boards, and particularly relates to a position calibration method of a metal plug-in post on a circuit board and a storage medium.
Background
When the circuit board is detected to be qualified on the production line of the air conditioner circuit board, one content is that the metal plug-in post on the circuit board is required to be kept clean, so that whether the metal plug-in post on the circuit board is polluted or not is required to be detected, for example, glue or other foreign matters are adhered to the metal plug-in post, so that the problems that the electrical connection between the circuit board and other connectors is abnormal, for example, poor contact and the like, caused by the pollution of the metal plug-in post are prevented. Before detecting whether the metal plug on the circuit board is polluted, the position of the metal plug on the circuit board needs to be calibrated in advance so as to quickly detect whether the metal plug is polluted.
At present, the detection of the position of a metal plug pin on a circuit board mainly fixes the position of the circuit board through a mechanical device of a conveyor belt on a production line, then manually marks the area of the metal plug pin on the circuit board, when different types of circuit boards are replaced, the type of the circuit board needs to be determined first, and then the area of the metal plug pin needs to be searched and marked again according to the type of the circuit board.
However, the method for manually calibrating the area of the metal plug-in post on the circuit board not only has low speed due to complicated operation, but also has large subjective influence factors, possibly causes errors and is not beneficial to the enlargement of the production line.
Therefore, a method for calibrating the position of the metal plug on the circuit board and a storage medium are needed.
Disclosure of Invention
The technical problem to be solved by the invention is that the existing method for manually calibrating the area of the metal connecting and inserting column on the circuit board not only has low speed due to complex operation, but also has large subjective influence factors by people, possibly makes mistakes and is not beneficial to the expansion of a production line.
In order to solve the above technical problem, in a first aspect, the present invention provides a method for calibrating a position of a metal plug on a circuit board, including the following steps:
extracting a region image containing a suspected metal plug-in column from a color image of a circuit board based on a metal plug-in column region extraction model, and acquiring position information of the suspected metal plug-in column, wherein the metal plug-in column region extraction model is obtained by utilizing a known metal plug-in column color image training;
the following analysis was performed for each image of the area containing suspected metal studs:
obtaining value intervals of RGB (red, green and blue) three channels of pixel points at the positions of suspected metal insertion columns in the regional image;
judging whether the difference value between the value interval of the RGB three channels and the confidence interval of the corresponding RGB three channels meets a preset condition or not:
if the preset conditions are met, calibrating the position of the metal plug-in column on the color image of the circuit board according to the position information of the metal plug-in column;
if the preset condition is not met, the position information of the metal insertion column is abandoned.
Preferably, before extracting the area image containing suspected metal plug pins from the color image of the circuit board based on the metal plug pin area extraction model, the method further comprises the following steps:
and training by using a known metal patch plug color image by adopting an example segmentation Mask RCNN algorithm, a YOLOv3 algorithm or an SSD algorithm to obtain a metal patch plug region extraction model.
Preferably, the color image of the circuit board is obtained by the following steps:
and polishing the circuit board by using a specified light source, and photographing the polished circuit board to obtain a color image of the circuit board, wherein the specified light source comprises a mesopore light source, a strip-shaped light source or an annular light source.
Preferably, confidence intervals of the three RGB channels are set according to the types of the metal insertion posts.
Preferably, confidence intervals for the three channels of RGB are obtained by:
taking a plurality of known metal patch column color images as samples, and respectively obtaining the value ranges of three RGB channels of each sample;
and determining the confidence interval of the channel according to the value range of the same channel of all samples.
Preferably, the confidence interval of the channel of the same type is determined according to the value ranges of the channels of the same type of all the samples, and the method specifically comprises the following steps:
taking the average value of the upper limit values of the value ranges of the same type of channels of all samples as the upper limit value of the confidence interval of the type of channels;
taking the average value of the lower limit values of the value ranges of the same type of channels of all samples as the lower limit value of the confidence interval of the type of channels;
and forming the confidence interval of the channel of the same type based on the upper limit value and the lower limit value of the confidence interval of the channel of the same type.
Preferably, the method for determining whether the difference between the value intervals of the three RGB channels and the confidence intervals of the corresponding three RGB channels meets a preset condition includes the following steps:
calculating the length value of the value interval of each channel exceeding the corresponding confidence interval, and calculating the ratio of the length value to the length value of the confidence interval;
judging whether the ratio of each channel is less than or equal to a preset threshold value:
if yes, judging that a preset condition is met;
if not, judging that the preset condition is not met.
Preferably, after the position of the metal plug post is calibrated on the color image of the circuit board according to the position information of the metal plug post, the method further comprises the following steps:
obtaining a variance value of a pixel point at the position of the metal insertion column in the area image, and judging whether the variance value is within a preset variance interval:
if yes, the position of the calibrated metal inserting column is judged to be accurate;
if not, the light source is judged to be abnormal.
Preferably, the preset variance interval is determined by the following steps:
taking a known metal patch column color image as a sample, and respectively obtaining a total value set of three RGB channels of each sample;
for each sample, determining a corresponding variance value according to the total value set of the RGB three channels of the sample;
and forming a preset variance interval according to the value ranges of the variance values of all the samples.
According to another aspect of the invention, the invention provides a storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the method as described above.
Compared with the prior art, one or more embodiments in the above scheme can have the following advantages or beneficial effects:
1) by applying the method for calibrating the position of the metal plug-in post on the circuit board, the region image containing the suspected metal plug-in post is extracted from the color image of the circuit board based on the metal plug-in post region extraction model, and the intelligent detection of the metal plug-in post region on the circuit board is realized by combining the machine vision technology with the metal plug-in post region extraction model of deep learning, so that the metal plug-in post region on the circuit board is not required to be calibrated manually, the speed is high, the efficiency is high, the accuracy is high, even if different types of circuit boards are replaced, the metal plug-in post region on the circuit board can be still quickly identified as long as the types of the metal plug-in posts on the circuit board are unchanged, the intelligent degree of a production line is improved, and the cost of a mechanical device arranged on the production line for fixing;
2) by applying the position calibration method of the metal plug-in post on the circuit board, the value intervals of the RGB three channels of the pixel point at the suspected metal plug-in post position in the area image are obtained, and whether the difference value between the value interval of the RGB three channels and the confidence interval of the corresponding RGB three channels meets the preset condition or not is judged: if the preset conditions are met, the position of the metal plug-in column is calibrated on the color image of the circuit board according to the position information of the metal plug-in column, suspected metal plug-in columns are further screened to obtain the position of the metal plug-in column, the false detection of the extraction model of the metal plug-in column area can be prevented, and the accuracy of calibrating the position of the metal plug-in column is improved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
FIG. 1 is a flow chart illustrating a method for calibrating the position of a metal stud on a circuit board according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a method for calibrating the position of a metal plug on a circuit board according to an embodiment of the present invention.
Detailed Description
The following detailed description of the embodiments of the present invention will be provided with reference to the drawings and examples, so that how to apply the technical means to solve the technical problems and achieve the technical effects can be fully understood and implemented. It should be noted that, as long as there is no conflict, the embodiments and the features of the embodiments of the present invention may be combined with each other, and the technical solutions formed are within the scope of the present invention.
Example one
In order to solve the technical problems in the prior art, the embodiment of the invention provides a position calibration method for a metal plug on a circuit board.
Fig. 1 is a flowchart illustrating a method for calibrating a position of a metal plug on a circuit board according to an embodiment of the present invention. Referring to fig. 1, the method for calibrating the position of the metal plug on the circuit board provided by this embodiment includes the following steps:
s110, polishing the circuit board by adopting a middle-hole light source, a strip-shaped light source or an annular light source, and photographing the polished circuit board to obtain a color image of the circuit board;
s120, training by using a known metal plug-in column color image by adopting an example segmentation Mask RCNN algorithm, a YOLOv3 algorithm or an SSD algorithm to obtain a metal plug-in column region extraction model;
s130, extracting a regional image containing a suspected metal plug-in pin from the color image of the circuit board based on the metal plug-in pin regional extraction model, and acquiring position information of the suspected metal plug-in pin;
s140, taking a plurality of known metal patch column color images as samples, and respectively obtaining value ranges of RGB three channels of each sample;
s150, determining a confidence interval of the channel according to the value ranges of the same channel of all samples;
s160, obtaining value intervals of RGB (red, green and blue) three channels of pixel points at the positions of the suspected metal insertion columns in the regional image containing the suspected metal insertion columns;
s170, judging whether the difference value between the value interval of the RGB three channels and the confidence interval of the corresponding RGB three channels meets a preset condition: if yes, go to step S180; if not, discarding the position information of the metal insertion column;
s180, calibrating the position of the metal plug-in column on the color image of the circuit board according to the position information of the metal plug-in column;
s190, obtaining a variance value of a pixel point at the position of the metal insertion column in the area image, and judging whether the variance value is within a preset variance interval:
if yes, the position of the calibrated metal inserting column is judged to be accurate;
if not, the light source is judged to be abnormal.
In particular, step S120 is not limited to be between step S110 and step S130 as long as step S120 precedes step S130, for example, step S120 may also precede step S110.
Step S140 and step S150 are not limited to be between S130 and S160 as long as step S140 and step S150 precede step S160, for example, step S140 and step S150 may also precede step S130, or precede step S120, or precede step S110.
Example two
In order to solve the above technical problems in the prior art, embodiments of the present invention provide a method for calibrating a position of a metal plug on a circuit board according to a first embodiment, wherein the method for calibrating a position of a metal plug on a circuit board according to a first embodiment of the present invention is further improved in step S150 and step S170 in the first embodiment.
Fig. 2 is a flowchart illustrating a method for calibrating the position of a metal plug on a circuit board according to an embodiment of the present invention. Referring to fig. 2, the method for calibrating the position of the metal plug on the circuit board of the present embodiment includes the following steps:
s210, polishing the circuit board by adopting a middle-hole light source, a strip-shaped light source or an annular light source, and photographing the polished circuit board to obtain a color image of the circuit board;
specifically, the mesoporous light source, the strip light source or the annular light source can adopt white light or other types of light, when the circuit board is provided with fluorescent glue, near ultraviolet light is preferably adopted, so that a color image of the circuit board is clearer, and at the moment, the known metal plug-in post color image adopted during the metal plug-in post region extraction model training is the same as the light adopted during the real-time collection of the color image of the circuit board.
The image acquisition system and the light source system are matched to acquire a color image of the circuit board, the whole conveyor belt is illuminated by the light source, when the circuit board is transmitted to a camera shooting position on the conveyor belt, a shooting trigger signal is sent to the camera by a position sensor, so that the camera shoots the circuit board, and the shot color image of the circuit board is uploaded to a computer.
S220, training by using a known metal plug-in column color image by adopting an example segmentation Mask RCNN algorithm, a YOLOv3 algorithm or an SSD algorithm to obtain a metal plug-in column region extraction model;
specifically, when an example segmentation Mask RCNN algorithm training is performed on the metal patch column region extraction model according to the actual pixel class of a known metal patch column color image, the MaskRCNN model of a backbone network inclusion v2 provided by tensrflow is used as an initial model, and the known metal patch column color image is trained on the initial model to obtain the trained metal patch column region extraction model.
The example segmentation Mask RCNN algorithm, the YOLOv3 algorithm and the SSD algorithm in the invention have the following characteristics respectively:
the Mask RCNN algorithm in deep learning is used, the detection precision can be mainly improved, for example, when a real object is selected, the real shape of the real object can be used as a frame selection shape, but the speed is slower;
the YOLOv3 algorithm and the SSD algorithm in the deep learning are used, the speed is fast, but the precision is slightly low, for example, when selecting a real object, the frame selection shape of the real object is a preset shape such as a square, a rectangle, etc.
In particular, the example segmentation Mask RCNN algorithm used in the present invention is adaptively adjusted, for example, the parameters thereof are adjusted to mainly adjust the image resolution parameters thereof to be the same as the image resolution acquired by the camera used by itself. The specific parameter adjustment process is as follows:
the anchor parameter is modified, wherein scales are modified to [0.1, 0.25, 0.5, 1.0, 2.0], aspect _ ratios are modified to [0.25, 0.5, 1.0, 2.0], mainly to increase the range of the sensing area and increase the feature, and also to increase the resolution of the image per se to 1280 960, if the subdivision causes the extraction of the metal plug feature, the detail feature is not obvious, because the minimum sensing area is smaller than the metal plug resolution. The mask size is modified to 11, which is mainly to increase the speed, and when the mask size is 11, the required calculation speed can also meet the required region integrity according to the invention.
In addition, when the type of the metal plug-in post on the circuit board changes, the existing metal plug-in post region extraction model needs to be further trained, so that the trained metal plug-in post region extraction model can intercept a novel metal plug-in post.
S230, extracting a regional image containing a suspected metal plug-in pin from the color image of the circuit board based on the metal plug-in pin regional extraction model, and acquiring position information of the suspected metal plug-in pin, wherein the position information of the suspected metal plug-in pin is determined by an original point and a coordinate system on the color image of the circuit board;
s240, taking a plurality of known metal patch column color images as samples, and respectively obtaining value ranges of RGB three channels of each sample;
s251, taking the average value of the upper limit values of the value ranges of the same type of channels of all samples as the upper limit value of the confidence interval of the type of channels;
s252, taking the average value of the lower limit values of the value ranges of the same type of channels of all samples as the lower limit value of the confidence interval of the type of channels;
s253, forming confidence intervals of the channels of the same type based on the upper limit values and the lower limit values of the confidence intervals of the channels of the same type;
s260, obtaining value intervals of RGB (red, green and blue) three channels of pixel points at the positions of the suspected metal insertion columns in the regional image containing the suspected metal insertion columns;
s271, calculating a length value of each channel value interval exceeding a corresponding confidence interval, and calculating a ratio of the length value to the length value of the confidence interval, wherein the confidence intervals of the RGB three channels are set according to the types of the metal plug-in posts;
specifically, when the confidence interval is determined, because the types of the metal plug-in posts on the circuit board are different and different objects have different confidence intervals, three-channel confidence intervals of the metal plug-in posts of different types need to be determined, and the different three-channel confidence intervals represent the different types of the metal plug-in posts.
S272, determining whether the ratio of each channel is less than or equal to a preset threshold, wherein the preset threshold includes but is not limited to 10%, and when the preset threshold is 10%, the confidence of the position of the calibrated metal-inserted post is 90%:
if yes, the preset condition is met, and step S280 is executed;
if not, the preset condition is not met, and the position information of the metal connecting and inserting column is abandoned;
s280, calibrating the position of the metal plug-in column on the color image of the circuit board according to the position information of the metal plug-in column;
s290, obtaining a variance value of a pixel point at the position of the metal insertion column in the area image, and judging whether the variance value is within a preset variance interval:
if yes, the position of the calibrated metal inserting column is judged to be accurate;
if not, the light source is judged to be abnormal.
Specifically, the preset variance interval is determined by the following steps:
taking a known metal patch column color image as a sample, and respectively obtaining a total value set of three RGB channels of each sample;
for each sample, determining a corresponding variance value according to the total value set of the RGB three channels of the sample;
and forming a preset variance interval according to the value ranges of the variance values of all the samples.
In particular, step S220 is not limited to being between step S210 and step S230 as long as step S120 precedes step S130, e.g., step S120 may also precede step S110.
Steps S240 to S253 are not limited to be between S230 and S260 as long as steps S240 to S253 precede step S260, for example, steps S240 to S253 may also precede step S230, or precede step S220, or precede step S210.
This embodiment inserts the post through using the metal to insert the regional model of drawing of post and detect the metal and insert the post, even do not carry out under the fixed condition to the circuit board, also can confirm automatically that the metal connects and inserts the post position, can facilitate for subsequent inserting the post pollution detection like this, can confirm directly promptly that the metal is inserted on the production line and is inserted the post and whether contaminated, improve the intelligent degree of production line.
EXAMPLE III
This embodiment describes that the method of the second embodiment is applied to the case that the types of the metal connector pins which may appear on the circuit board are three.
The method for calibrating the position of the metal plug-in post on the circuit board comprises the following steps:
s310, polishing a conveying belt of a production line by using a mesoporous light source to enable a circuit board to be clear in structure on the conveying belt, and when the circuit board is conveyed to a specified position, sending a trigger signal to a camera by using a position sensor at the specified position to enable the camera to photograph the circuit board clear in structure so as to obtain a color image of the circuit board;
s320, training by using a Mask RCNN algorithm, a YOLOv3 algorithm or an SSD algorithm through an example segmentation, and obtaining a metal plug-in post region extraction model to ensure the accuracy of metal plug-in post region extraction, wherein the known metal plug-in post color image comprises a plurality of known metal plug-in post color images of metal plug-in posts, for example, in the embodiment, the types of the metal plug-in posts are three types, namely A1, A2 and A3, so as to ensure that the metal plug-in post region extraction model can extract regions containing all types of metal plug-in posts on the circuit board without omission;
s330, based on a metal patch column region extraction model, extracting a region image containing a suspected metal patch column from a circuit board color image, and acquiring position information of the suspected metal patch column, wherein the position information of the suspected metal patch column is determined by an original point and a coordinate system on the circuit board color image, and at the moment, other real objects are possibly detected as the suspected metal patch column due to false detection of the metal patch column region extraction model, so that the suspected metal patch column needs to be further screened and distinguished;
s340, taking five samples of a metal insertion column as an example, respectively obtaining a confidence interval of an R channel, a confidence interval of a G channel and a confidence interval of a B channel of the A1 type metal insertion column; confidence intervals of an R channel, a G channel and a B channel of the A2 type metal plug-in column; confidence intervals of R channel, G channel and B channel of A3 type metal plug-in column.
In detail, the confidence interval of the R channel of the a1 type metal plug-in post is obtained as follows:
the range of values of the R channel of the first sample of the a1 type metal-inserted column is [20, 80], the range of values of the R channel of the second sample of the a1 type metal-inserted column is [30, 83], the range of values of the R channel of the third sample of the a1 type metal-inserted column is [35, 79], the range of values of the R channel of the fourth sample of the a1 type metal-inserted column is [28, 81], the range of values of the R channel of the fifth sample of the a1 type metal-inserted column is [27, 82], the upper limit value of the confidence interval of the R channel of the a1 type metal-inserted column is (20+30+35+28+27)/5 ═ 28, the lower limit value of the confidence interval of the R channel of the a1 type metal-inserted column is (80+83+79+81+82)/5 ═ 81, and therefore, the confidence interval of the R channel of the a1 type metal-inserted column is [28, 81 ];
similarly, the confidence interval of the G channel of the A1 type metal plug-in column is found to be [53, 189 ];
similarly, the confidence interval of the channel B of the type A1 metal plug-in post is found to be [108, 203 ];
the variance interval calculation process of the A1 type metal plug-in pin is as follows:
the total value set of the RGB three channels of the first sample of the A1 type metal plug-in column is {20, 80, … … }, and the variance value of the first sample is calculated to be 7 according to the total value set; similarly, the variance value of the second sample is, for example, 4; similarly, the variance value of the third sample is, for example, 2; at the moment, the variance interval of the A1 type metal plug-in post is [2, 4 ];
similarly, the confidence interval of the R channel of the A2 type metal plug-in post is found to be [39, 109 ];
similarly, the confidence interval of the G channel of the a2 type metal plug-in post is found to be [97, 199 ];
similarly, the confidence interval of the channel B of the type A2 metal plug-in post is found to be [19, 60 ];
similarly, the variance interval of the A2 type metal plug-in post is [1, 3 ];
similarly, the confidence interval of the R channel of the A3 type metal plug-in post is found to be [51, 233 ];
similarly, the confidence interval of the G channel of the A3 type metal plug-in column is found to be [67, 237 ];
similarly, the confidence interval of the channel B of the type A3 metal plug-in post is found to be [15, 71 ];
similarly, the variance interval of the A3 type metal plug-in post is [5, 7 ];
s360, three color images of the suspected metal plug are marked as an image B1, an image B2 and an image B3 respectively, wherein the value range of an R channel of the image B1 is [37, 114], the value range of a G channel is [100, 189], and the value range of a B channel is [15, 60 ]; the value range of the R channel of the image B2 is [28, 85], the value range of the G channel is [59, 200], and the value range of the B channel is [105, 204 ]; the value range of the R channel of the image B3 is [113, 210], the value range of the G channel is [136, 210], and the value range of the B channel is [9, 79 ];
s371, the value interval [37, 114] of the R channel of the image B1 corresponds to the confidence interval [39, 109] of the R channel of the A2 type metal plug-in post, the length value of the value interval exceeding the confidence interval is calculated, namely the sum 7 of the length value 2 of which the lower limit value of the value interval is smaller than the lower limit value of the confidence interval and the length value 5 of which the upper limit value of the value interval is larger than the upper limit value of the confidence interval is taken, and the ratio of the length value 7 to the length value 70 of the confidence interval is 10%;
the value range [100, 189] of the G channel of the image B1 corresponds to the confidence range [97, 199] of the G channel of the A2 type metal plug-in post, the length value of the value range exceeding the confidence range is 10, and the ratio of the length value 10 to the length value 102 of the confidence range is 9.8%;
the value interval [15, 60] of the B channel of the image B1 corresponds to the confidence interval [19, 60] of the B channel of the A2 type metal plug-in post, the length value of the value interval exceeding the confidence interval is 4, and the ratio of the length value 4 to the length value 41 of the confidence interval is 9.7%;
and S372, the ratio of the R channel, the G channel and the B channel of the image B1 is less than or equal to a preset threshold value of 10%, therefore, the suspected metal plug column corresponding to the image B1 is a metal plug column A2, and the position of the metal plug column is calibrated on the circuit board according to the position information of the suspected metal plug column B1. Meanwhile, the variance value of the pixel point at the position of the metal plug in the area image is obtained to be 2, for example, and the variance value is judged to be within the variance interval [1, 3] of the metal plug A2, so that the calibrated position of the metal plug is judged to be accurate and the light source is normal.
The value interval [28, 85] of the R channel of the image B2 corresponds to the confidence interval [28, 81] of the R channel of the A1 type metal plug-in post, the length value of the value interval exceeding the confidence interval is 4, and the ratio of the length value 4 to the length value 53 of the confidence interval is 7.5%;
the value interval of the G channel of the image B2 is [59, 200], the value interval corresponds to the confidence interval of the G channel of the A1 type metal plug-in post [53, 189], the length value of the value interval exceeding the confidence interval is 11, and the ratio of the length value 4 to the length value 41 of the confidence interval is 8.0%;
the value interval of the B channel of the image B2 is [105, 204], the confidence interval of the B channel of the A1 type metal plug-in post is [108, 203], the length value of the value interval exceeding the confidence interval is 4, and the ratio of the length value 4 to the length value 41 of the confidence interval is 4.2%;
and S372, the ratio of the R channel, the G channel and the B channel of the image B2 is less than or equal to a preset threshold value of 10%, therefore, the suspected metal plug corresponding to the image B2 is a metal plug A1, and the position of the metal plug is calibrated on the circuit board according to the position information of the metal plug B2. Meanwhile, the variance value of the pixel point at the position of the metal contact pin in the area image is obtained to be 1, for example, and the variance value is determined to be within the variance interval [2, 4] of the metal contact pin A1, so that the light source is determined to be abnormal.
The value interval [113, 210] of the R channel of the image B3 corresponds to the confidence interval [51, 233] of the R channel of the A3 type metal plug-in post, the length value of the value interval exceeding the confidence interval is 0, and the ratio of the length value 0 to the length value 182 of the confidence interval is 0%;
the value interval of the G channel of the image B3 is [136, 210], the value interval corresponds to the confidence interval of the G channel of the A3 type metal plug-in post [67, 237], the length value of the value interval exceeding the confidence interval is 0, and the ratio of the length value 0 to the length value 170 of the confidence interval is 0%;
the value interval of the B channel of the image B3 is [9, 79], the value interval corresponds to the confidence interval of the B channel of the A3 type metal plug-in post [15, 71], the length value of the value interval exceeding the confidence interval is 14, and the ratio of the length value 14 to the length value 41 of the confidence interval is 34.1%;
and S372, the ratio of the B channels of the image B3 is greater than the preset threshold value by 10%, and therefore, the position information of the metal plug column is abandoned. At this time, it is not necessary to determine whether the variance value of the pixel point at the position of the metal contact plug in the region image is within the variance interval [5, 7] of the metal contact plug a 3.
In this embodiment, it is determined whether the variance value is within the preset variance interval, mainly to calculate jitter, so as to prevent a light source from making mistakes, because if a bulb is broken, the variance will be changed greatly by the light source. Therefore, when the preset variance interval is calculated, the brightness of the light source needs to be adjusted first, then sample data is collected under the acceptable brightness, the preset variance interval of each metal plug-in post is calculated according to different types of metal plug-in posts, and then whether the variance value is within the preset variance interval is judged.
EXAMPLE five
In order to solve the above technical problems in the prior art, an embodiment of the present invention further provides a storage medium.
The storage medium of this embodiment has a computer program stored thereon, and the computer program implements the method steps of the first to third embodiments when executed by the processor.
Although the embodiments of the present invention have been described above, the above description is only for the convenience of understanding the present invention, and is not intended to limit the present invention. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A position calibration method of a metal plug-in post on a circuit board is characterized by comprising the following steps:
extracting a region image containing a suspected metal plug-in column from a color image of a circuit board based on a metal plug-in column region extraction model, and acquiring position information of the suspected metal plug-in column, wherein the metal plug-in column region extraction model is obtained by utilizing a known metal plug-in column color image training;
the following analysis was performed for each image of the area containing suspected metal studs:
obtaining value intervals of RGB (red, green and blue) three channels of pixel points at the positions of suspected metal insertion columns in the regional image;
judging whether the difference value between the value interval of the RGB three channels and the confidence interval of the corresponding RGB three channels meets a preset condition or not:
if the preset conditions are met, calibrating the position of the metal plug-in column on the color image of the circuit board according to the position information of the metal plug-in column;
if the preset condition is not met, the position information of the metal insertion column is abandoned.
2. The method of claim 1, further comprising, before extracting an image of an area containing suspected metal studs from the color image of the circuit board based on the metal stud area extraction model, the steps of:
and training by using a known metal patch plug color image by adopting an example segmentation Mask RCNN algorithm, a YOLOv3 algorithm or an SSD algorithm to obtain a metal patch plug region extraction model.
3. The method of claim 1, wherein the circuit board color image is obtained by:
and polishing the circuit board by using a specified light source, and photographing the polished circuit board to obtain a color image of the circuit board, wherein the specified light source comprises a mesopore light source, a strip-shaped light source or an annular light source.
4. The method of claim 1, wherein confidence intervals of the RGB three channels are set according to the type of metal plug-in posts.
5. The method of claim 1, wherein the confidence intervals for the three channels of RGB are obtained by:
taking a plurality of known metal patch column color images as samples, and respectively obtaining the value ranges of three RGB channels of each sample;
and determining the confidence interval of the channel according to the value range of the same channel of all samples.
6. The method according to claim 5, wherein the confidence interval of the channel type is determined according to the value ranges of the same channel type of all samples, and the method specifically comprises the following steps:
taking the average value of the upper limit values of the value ranges of the same type of channels of all samples as the upper limit value of the confidence interval of the type of channels;
taking the average value of the lower limit values of the value ranges of the same type of channels of all samples as the lower limit value of the confidence interval of the type of channels;
and forming the confidence interval of the channel of the same type based on the upper limit value and the lower limit value of the confidence interval of the channel of the same type.
7. The method according to claim 1, wherein determining whether a difference between the value intervals of the three RGB channels and the confidence intervals of the corresponding three RGB channels satisfies a preset condition includes the following steps:
calculating the length value of the value interval of each channel exceeding the corresponding confidence interval, and calculating the ratio of the length value to the length value of the confidence interval;
judging whether the ratio of each channel is less than or equal to a preset threshold value:
if yes, judging that a preset condition is met;
if not, judging that the preset condition is not met.
8. The method of claim 1, further comprising the following steps after calibrating the position of the metal contact post on the color image of the circuit board according to the position information of the metal contact post:
obtaining a variance value of a pixel point at the position of the metal insertion column in the area image, and judging whether the variance value is within a preset variance interval:
if yes, the position of the calibrated metal inserting column is judged to be accurate;
if not, the light source is judged to be abnormal.
9. The method of claim 8, wherein the predetermined variance interval is determined by:
taking a known metal patch column color image as a sample, and respectively obtaining a total value set of three RGB channels of each sample;
for each sample, determining a corresponding variance value according to the total value set of the RGB three channels of the sample;
and forming a preset variance interval according to the value ranges of the variance values of all the samples.
10. A storage medium on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 9.
CN201910901642.1A 2019-09-23 2019-09-23 Method for calibrating position of metal plug on circuit board and storage medium Pending CN110675380A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910901642.1A CN110675380A (en) 2019-09-23 2019-09-23 Method for calibrating position of metal plug on circuit board and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910901642.1A CN110675380A (en) 2019-09-23 2019-09-23 Method for calibrating position of metal plug on circuit board and storage medium

Publications (1)

Publication Number Publication Date
CN110675380A true CN110675380A (en) 2020-01-10

Family

ID=69077538

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910901642.1A Pending CN110675380A (en) 2019-09-23 2019-09-23 Method for calibrating position of metal plug on circuit board and storage medium

Country Status (1)

Country Link
CN (1) CN110675380A (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080317380A1 (en) * 2007-06-20 2008-12-25 Premier Image Technology(China) Ltd. System and method for detecting blemishes on image sensor package
JP2010271921A (en) * 2009-05-21 2010-12-02 Fujifilm Corp Skin area extraction method, skin area extraction device, and skin area extracting program
CN103473788A (en) * 2013-07-31 2013-12-25 中国电子科技集团公司第三十八研究所 Indoor fire and flame detection method based on high-definition video images
CN104134079A (en) * 2014-07-31 2014-11-05 中国科学院自动化研究所 Vehicle license plate recognition method based on extremal regions and extreme learning machine
CN106339664A (en) * 2016-08-10 2017-01-18 杭州电子科技大学 Color mixing model and multi-feature combination-based video smoke detection method
CN106650584A (en) * 2016-09-29 2017-05-10 广东安居宝数码科技股份有限公司 Fire flame detection method and system
CN106770367A (en) * 2016-12-09 2017-05-31 东莞市森斯电子机械科技有限公司 A kind of FPC solder joints detection method
CN106780426A (en) * 2016-09-21 2017-05-31 南京师范大学 A kind of polymorphic pad localization method of surface-mounted integrated circuit based on color character model
CN106826815A (en) * 2016-12-21 2017-06-13 江苏物联网研究发展中心 Target object method of the identification with positioning based on coloured image and depth image
CN109447938A (en) * 2017-08-31 2019-03-08 宁波方太厨具有限公司 A kind of detection method and detection device of oven baking performance
CN109754387A (en) * 2018-11-23 2019-05-14 北京永新医疗设备有限公司 Medical image lesion detects localization method, device, electronic equipment and storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080317380A1 (en) * 2007-06-20 2008-12-25 Premier Image Technology(China) Ltd. System and method for detecting blemishes on image sensor package
JP2010271921A (en) * 2009-05-21 2010-12-02 Fujifilm Corp Skin area extraction method, skin area extraction device, and skin area extracting program
CN103473788A (en) * 2013-07-31 2013-12-25 中国电子科技集团公司第三十八研究所 Indoor fire and flame detection method based on high-definition video images
CN104134079A (en) * 2014-07-31 2014-11-05 中国科学院自动化研究所 Vehicle license plate recognition method based on extremal regions and extreme learning machine
CN106339664A (en) * 2016-08-10 2017-01-18 杭州电子科技大学 Color mixing model and multi-feature combination-based video smoke detection method
CN106780426A (en) * 2016-09-21 2017-05-31 南京师范大学 A kind of polymorphic pad localization method of surface-mounted integrated circuit based on color character model
CN106650584A (en) * 2016-09-29 2017-05-10 广东安居宝数码科技股份有限公司 Fire flame detection method and system
CN106770367A (en) * 2016-12-09 2017-05-31 东莞市森斯电子机械科技有限公司 A kind of FPC solder joints detection method
CN106826815A (en) * 2016-12-21 2017-06-13 江苏物联网研究发展中心 Target object method of the identification with positioning based on coloured image and depth image
CN109447938A (en) * 2017-08-31 2019-03-08 宁波方太厨具有限公司 A kind of detection method and detection device of oven baking performance
CN109754387A (en) * 2018-11-23 2019-05-14 北京永新医疗设备有限公司 Medical image lesion detects localization method, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109752394B (en) High-precision detection method and system for defects of display screen
CN106370671A (en) PCB (printed circuit board) component detection system and method based on machine vision
CN106157286B (en) Image processing method and screen light leakage detection method
CN112394064B (en) Point-line measuring method for screen defect detection
WO2018010386A1 (en) Method and system for component inversion testing
CN111970506A (en) Lens dirt detection method, device and equipment
CN111261079B (en) Method for detecting abnormal phenomena of bright and dark spots
CN106067177A (en) HDR scene method for detecting and device
CN105509657B (en) A kind of high-precision measuring method of IC card chip scratch area and gray scale parameter
CN108445010A (en) Automatic optical detection method and device
CN111028779A (en) Display panel compensation method and device and display panel
CN108022219B (en) Two-dimensional image gray level correction method
TW201516397A (en) Bubble inspection system for glass
CN114565848A (en) Liquid medicine level detection method and system in complex scene
CN111609926B (en) Stray light intensity detection method and device, detection terminal and readable storage medium
CN116363567B (en) Wafer defect identification method and system based on AOI visual inspection
WO2008120182A2 (en) Method and system for verifying suspected defects of a printed circuit board
CN116091506B (en) Machine vision defect quality inspection method based on YOLOV5
CN110675380A (en) Method for calibrating position of metal plug on circuit board and storage medium
CN109856133B (en) Test paper detection method utilizing multiple illumination intensities and multiple color illumination
CN115797299B (en) Defect detection method of optical composite film
CN113933309A (en) Method for retesting defects in blind hole by AOI machine
CN111524107B (en) Defect detection method, defect detection apparatus, and computer-readable storage medium
CN112858331A (en) VR screen detection method and detection system
KR101383827B1 (en) System and method for automatic extraction of soldering regions in pcb

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200110