WO2017050088A1 - Method and device for locating electronic component - Google Patents
Method and device for locating electronic component Download PDFInfo
- Publication number
- WO2017050088A1 WO2017050088A1 PCT/CN2016/096745 CN2016096745W WO2017050088A1 WO 2017050088 A1 WO2017050088 A1 WO 2017050088A1 CN 2016096745 W CN2016096745 W CN 2016096745W WO 2017050088 A1 WO2017050088 A1 WO 2017050088A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- plug
- electronic component
- pixel
- model
- area
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
- G06T7/73—Determining position or orientation of objects or cameras using feature-based methods
- G06T7/74—Determining position or orientation of objects or cameras using feature-based methods involving reference images or patches
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
- G06T7/001—Industrial image inspection using an image reference approach
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
Definitions
- the present invention relates to the field of automatic detection, and in particular, to an electronic component positioning method and apparatus.
- Automatic optical inspection refers to the use of optical imaging to obtain the surface state of the finished product, and image processing to detect the presence of foreign matter or surface defects on the surface of the finished product.
- automatic optical inspection is widely used for quality inspection of circuit boards.
- the relevant detecting device automatically scans the circuit board to acquire an image, extracts a partial image of each electronic component, and uses image processing technology to determine whether the electronic components on the circuit board have defects such as mis-insertion, missing insertion or reverse insertion. Finally, the electronic components with suspected defects are displayed or marked for easy viewing and maintenance.
- an object of the present invention is to provide an electronic component positioning method and apparatus that can quickly and accurately locate the positions of all electronic components on an image of a circuit board.
- Embodiments of the present invention provide a method for positioning an electronic component, including the following steps:
- Background modeling is performed on at least two plug-in front panel images obtained, and a model of each pixel of the background model is obtained, wherein the plug-in front panel image is an image of a circuit board without an electronic component inserted, each pixel point
- the model consists of k Gaussian distribution functions, and k is an integer greater than one;
- An adjacent candidate element pixel is connected to the plug-in rear panel image to form at least one connected region to position the electronic component.
- the weight, mean and covariance of the model of each pixel that has been established are updated using corresponding pixel points on the front panel image of the other plug-in to obtain the updated model p(x) of each pixel.
- the k probability values of each of the pixel points of the acquired back-plate image of the acquired plug-in are corresponding to the k-gauss distribution functions of the corresponding pixel points on the background model, specifically:
- the connected area is a rectangle.
- connecting adjacent candidate element pixels on the back panel image of the plug-in to form at least one connected area to locate an area where the electronic component is located includes:
- the connected region is marked as an interference region.
- a probability value calculation unit configured to respectively calculate k probability values of k Gaussian distribution functions of corresponding pixel points of each pixel point of the acquired plug-in back panel image, wherein the plug-in
- the board image is an image of a circuit board into which the electronic component is inserted;
- a comparing unit configured to compare the k probability values with a preset threshold one by one, and mark corresponding pixel points as candidates on the plug-in back panel image when any one of the probability values is smaller than the threshold Component pixel
- a positioning unit configured to connect adjacent candidate element pixels on the back panel image of the insert to form at least one connected area to locate an area where the electronic component is located.
- the modeling unit includes:
- a model building unit for establishing a model p(x) for each pixel in any of the plug-in front panel images, wherein x is the gray value of the pixel, k is the number of Gaussian models, and ⁇ j , ⁇ j , C j respectively represent the weight, mean and covariance of the jth Gaussian model;
- the updating unit is configured to update the weight, the mean and the covariance of the model of each pixel that has been established by using corresponding pixel points on the image of the front panel of the other plug-in, and obtain an updated model of each pixel.
- the probability value calculation unit is specifically configured to separately calculate a probability of each pixel point y on the back panel image of the plug-in under k Gaussian distribution functions of corresponding pixel points of the background model. Value p j (y), where And 1 ⁇ j ⁇ k.
- the connected area is a rectangle.
- the positioning unit comprises:
- An area calculation unit configured to calculate an area of the at least one connected area
- a determining unit configured to determine whether an area of each connected area is greater than a preset area threshold
- a marking unit configured to mark the connected area as an effective area including an electronic component to locate the electronic component when an area of the connected area is greater than the area threshold; otherwise, marking the connected area as an interference area .
- the electronic component positioning method and device provided by the embodiment of the present invention establishes a background model by using a Gaussian mixture model, and then matches each pixel of the background model according to the back panel image of the plug-in, and obtains candidates according to the matching situation.
- Component pixels, and by connecting adjacent candidate element pixels, position the electronic component in the back panel image of the plug-in, thereby realizing rapid and accurate positioning of the electronic component from the image of the back panel of the plug-in for subsequent Board inspection provides a reliable standard layout.
- FIG. 1 is a flow chart of a method for positioning an electronic component according to an embodiment of the present invention.
- FIG. 3 is a schematic diagram of a rear panel of a plug-in according to an embodiment of the present invention.
- FIG. 4 is a schematic diagram of positioning an electronic component in an image of a back panel of the plug-in according to an embodiment of the present invention.
- FIG. 5 is a flowchart of an electronic component positioning apparatus according to an embodiment of the present invention.
- FIG. 6 is a schematic structural view of the modeling unit shown in FIG. 5.
- FIG. 7 is another schematic structural view of the positioning unit shown in FIG. 5.
- Embodiments of the present invention improve an electronic component positioning method and apparatus for positioning the position of all electronic components on a circuit board by means of automatic positioning. The details are described below separately.
- FIG. 1 is a flowchart of a method for positioning an electronic component according to an embodiment of the present invention.
- the electronic component positioning method can be performed by the electronic component positioning device and includes at least steps S101 to S104. among them,
- S101 Perform background modeling on the collected at least two plug-in front panel images to obtain a model of each pixel of the background model, where the plug-in front panel image is an image of a circuit board that is not inserted into the electronic component, and each pixel
- the model of the point consists of k Gaussian distribution functions, and k is an integer greater than one.
- the front panel image of the plug-in is an image of a circuit board that is not inserted into an electronic component.
- the electronic component positioning device may model the plug-in front panel image by using a Gaussian mixture model to obtain a background model of the plug-in front panel.
- a Gaussian mixture model in order to describe the background and its possible changes, a plurality of background images are required for the background modeling. Therefore, the plug-in front panel image of the present invention is at least two.
- the electronic component positioning device takes a plug-in front panel image, and creates a model p(x) for each pixel of the plug-in front panel image, wherein x is the pixel value of the pixel, k is the number of Gaussian models, and ⁇ j , ⁇ j , C j represent the weight, mean and covariance of the jth Gaussian model, respectively.
- x is the pixel value of the pixel
- k is the number of Gaussian models
- ⁇ j , ⁇ j , C j represent the weight, mean and covariance of the jth Gaussian model, respectively.
- the pixel value of one pixel of the plug-in front panel image is represented as a combination of k Gaussian distribution functions, and the weight, the mean and the covariance of the Gaussian model can be set according to the empirical value.
- the weight, mean and covariance of the model of each pixel that has been established are updated by using corresponding pixel points on the image of the other plug-in front panel, and the updated model p(x) of each pixel is obtained.
- the electronic component positioning device when a new pixel is added (ie, a new plug-in front panel image is added), the electronic component positioning device respectively separates the pixel value of the new pixel from the pixel of the corresponding background model.
- the probability of the new pixel value falling into the corresponding Gaussian distribution is calculated simultaneously with the mean ⁇ j of the k Gaussian distributions of the points, and the matched Gaussian distribution is selected according to the judgment rule.
- the parameters such as the weight, mean and covariance of these Gaussian distributions need to be updated according to the pixel values of the new pixel points.
- the electronic component positioning device obtains a model of each pixel point of the background model by the above operation, wherein the model of each pixel point is composed of k Gaussian distribution functions, and k is greater than 1 An integer, and preferably, k ranges from 3 to 5.
- the electronic component positioning device first acquires an image of the back panel of the plug-in, wherein the image of the back panel of the plug-in is an image of a circuit board into which the electronic component is inserted. Then, the electronic component locating device respectively calculates k probability values under k Gaussian distribution functions of corresponding pixel points of the pixel of the plug-in rear panel image on the background model.
- the size of the background template and the back panel image of the plug-in are both M ⁇ N pixels.
- the electronic component positioning device can be represented by k Gaussian distribution functions.
- the electronic component positioning device first reads the pixel value y of the first pixel point (such as the coordinate (1, 1)) of the back panel image of the plug-in, and then the electronic component positioning device reads k Gaussian distribution functions of pixels on the corresponding background model (such as coordinates (1, 1)) Then, the electronic component positioning device substitutes the pixel values y of the back panel image of the plug-in into the k Gaussian distribution functions to obtain k probability values, wherein the j-th probability value can be expressed as
- the electronic component positioning device traverses all the pixel points on the back panel image and the background template of the plug-in, the k probability values corresponding to each pixel point can be obtained.
- the electronic component positioning device compares the k probability values with a preset threshold one by one, wherein when any of the probability values is less than the threshold, the corresponding pixel points are Marked as candidate element pixels, and when all k probability values are greater than the threshold, the pixel points are marked as background pixels.
- the electronic component positioning device connects adjacent candidate component pixels after marking all the pixels on the back panel image of the plug-in.
- at least one connected area will be formed after the communication, and the connected area is the position where the electronic component is located.
- the shape of the connected region is a rectangle (as shown by three white squares in FIG. 4).
- the connected area may also be a circle, a triangle, or other shapes, which is not specifically limited in the present invention.
- pixel points that are originally background pixels are sometimes erroneously calculated as candidate element pixels due to problems such as accuracy of the algorithm or parameter errors. At this time, it may cause The position where the electronic component does not exist originally forms a connected region.
- the electronic component positioning device can be set as follows:
- the areas of communication having a small area are excluded, that is, the interference areas caused by calculation accuracy or error are excluded, and the connected areas are all areas including electronic components.
- the electronic component positioning method obtained by the embodiment of the present invention obtains a background model by using a Gaussian mixture model, and then matches each pixel of the background model according to the back panel image of the plug-in to obtain a candidate component pixel. And by connecting adjacent candidate element pixels, the position of the electronic component is located in the back panel image of the plug-in, thereby realizing the position of the electronic component quickly and accurately from the image of the back panel of the plug-in, and providing for subsequent board inspection. Reliable standard layout.
- FIG. 5 is a structural diagram of an electronic component positioning apparatus according to an embodiment of the present invention.
- the electronic component positioning device 100 can be used to execute the electronic component positioning method described above, and at least includes a modeling unit 10, a probability value calculation unit 20, a comparison unit 30, and a positioning unit 40, wherein:
- the modeling unit 10 is configured to perform background modeling on the collected at least two plug-in front panel images to obtain a model of each pixel point of the background model, wherein the plug-in front panel image is a circuit without an electronic component inserted
- the image of the plate, the model of each pixel consists of k Gaussian distribution functions, and k is an integer greater than one.
- the front panel image of the plug-in is an image of a circuit board that is not inserted into an electronic component.
- the modeling unit 10 may first acquire at least two plug-in front panel images as background images.
- the modeling unit 10 may model the plug-in front panel image by using a Gaussian mixture model to obtain a background model of the plug-in front panel.
- the Gaussian mixture model requires multiple background images in order to characterize the background and its possible changes during background modeling.
- the plug-in front panel image of the present invention is at least two.
- the modeling unit 10 includes a model establishing unit 11 and an updating unit 12, where:
- the model establishing unit 11 is configured to establish a model p(x) for each pixel in any of the plug-in front panel images, where x is the gray value of the pixel, a is the number of Gaussian models, and ⁇ j , ⁇ j , C j represent the weight, mean and covariance of the jth Gaussian model, respectively.
- the model establishing unit 11 takes a plug-in front panel image and creates a model p(x) for each pixel of the plug-in front panel image, where x is the pixel value of the pixel, k is the number of Gaussian models, and ⁇ j , ⁇ j , C j represent the weight, mean and covariance of the jth Gaussian model, respectively.
- x is the pixel value of the pixel
- k is the number of Gaussian models
- ⁇ j , ⁇ j , C j represent the weight, mean and covariance of the jth Gaussian model, respectively.
- the pixel value of one pixel of the plug-in front panel image is represented as a combination of k Gaussian distribution functions, and the weight, the mean and the covariance of the Gaussian model can be set according to the empirical value.
- the updating unit 12 is configured to update the weight, the mean and the covariance of the model of each pixel that has been established by using corresponding pixel points on the image of the front panel of the other plug-in to obtain a model of each pixel after the update. p(x).
- the updating unit 12 separates the pixel values of the new pixel from the k-gauss distribution described above. Compared with the mean ⁇ j , the probability that the new pixel value falls into the corresponding Gaussian distribution is calculated at the same time, and the matched Gaussian distribution is selected according to the judgment rule. When there is a matching Gaussian distribution, the parameters such as the weight, mean and covariance of these Gaussian distributions need to be updated according to the pixel values of the new pixel points. For a specific calculation process, reference may be made to the parameter update principle of the general Gaussian mixture model, and the present invention will not be described herein.
- the modeling unit 10 obtains a model of each pixel point of the background model by the above operation, wherein the model of each pixel point is composed of k Gaussian distribution functions, and k is greater than 1 An integer, and preferably, k ranges from 3 to 5.
- the probability value calculation unit 20 is configured to respectively calculate k probability values of k Gaussian distribution functions of corresponding pixel points of each pixel point of the acquired plug-in back panel image, where
- the back panel image of the plug-in is an image of a board into which the electronic component is inserted.
- the probability value calculation unit 20 first acquires an image of the back panel of the plug-in, wherein the image of the back panel of the plug-in is an image of a circuit board into which the electronic component is inserted. Then, the probability value calculation unit 20 respectively calculates k probability values under k Gaussian distribution functions of corresponding pixel points of the pixel of the plug-in back panel image on the background model.
- the size of the background template and the back panel image of the plug-in are both M ⁇ N pixels.
- the probability value calculation unit 20 can be represented by k Gaussian distribution functions.
- the probability value calculation unit 20 first reads the pixel value y of the first pixel point (such as the coordinate (1, 1)) of the plug-in back panel image, and then the probability value calculation unit 20 Read k Gaussian distribution functions of pixels on the corresponding background model (such as coordinates (1, 1)) Then, the probability value calculation unit 20 substitutes the pixel value y distribution of the plug-in back panel image into the k Gaussian distribution functions to obtain k probability values, wherein the j-th probability value can be expressed as
- the probability value calculation unit 20 traverses all the pixel points on the back panel image and the background template of the plug-in, the k probability values corresponding to each pixel point can be obtained.
- the comparing unit 30 is configured to compare the k probability values with a preset threshold one by one, and when the probability value is less than the threshold, the corresponding pixel points are displayed on the plug-in back panel image. Marked as candidate element pixels.
- the comparing unit 30 compares the k probability values one by one with a preset threshold, wherein when any one of the probability values is less than the threshold, the comparing unit 30 Corresponding pixel points are labeled as candidate element pixels, and when all k probability values are greater than the threshold, then comparison unit 30 marks the pixel points as background pixels.
- the positioning unit 40 may include:
- the area calculating unit 41 is configured to calculate an area of the at least one connected area.
- the determining unit 42 is configured to determine whether an area of each connected area is greater than a preset area threshold.
- the marking unit 43 is configured to mark the connected area as an effective area including an electronic component when an area of the connected area is larger than the area threshold; otherwise, mark the connected area as an interference area not including an electronic component .
- the positioning unit 40 excludes those connected areas having a small area, that is, excludes interference areas caused by calculation accuracy or error, and ensures that the connected areas are all areas including electronic components.
- the electronic component positioning apparatus 100 obtains a background model by using a Gaussian mixture model, and then matches each pixel of the background model according to the back panel image of the plug-in to obtain a candidate component. Pixels, and by connecting adjacent candidate element pixels, position the electronic component in the back panel image of the plug-in, thereby realizing the position of the electronic component quickly and accurately from the image of the back panel of the plug-in, for subsequent board detection Provide a reliable standard layout.
- the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Quality & Reliability (AREA)
- Image Processing (AREA)
Abstract
Description
本发明涉及自动检测领域,尤其涉及一种电子元件定位方法及装置。The present invention relates to the field of automatic detection, and in particular, to an electronic component positioning method and apparatus.
自动光学检测是指利用光学成像的方式取得成品的表面状态,并通过影像处理来检测成品的表面是否存在异物或表面瑕疵。目前,自动光学检测被广泛应用于电路板的质量检测。检测时,相关的检测装置通过摄像头自动扫描电路板获取图像,提取每个电子元件的局部图像,并通过图像处理技术,判断电路板上的电子元件是否存在错插、漏插或反插等缺陷,最后将疑似缺陷的电子元件显示或标记出来,方便查看与检修。Automatic optical inspection refers to the use of optical imaging to obtain the surface state of the finished product, and image processing to detect the presence of foreign matter or surface defects on the surface of the finished product. At present, automatic optical inspection is widely used for quality inspection of circuit boards. During the detection, the relevant detecting device automatically scans the circuit board to acquire an image, extracts a partial image of each electronic component, and uses image processing technology to determine whether the electronic components on the circuit board have defects such as mis-insertion, missing insertion or reverse insertion. Finally, the electronic components with suspected defects are displayed or marked for easy viewing and maintenance.
在检测电子元件缺陷之前,需先制作电路板的标准版式,特别地,需要标记电路板上每个电子元件的位置。现有的方案是采用人工操作的方法在电路板上设置每个电子元件的位置,但是采用人工操作的方案在电子元件数目较多时,不仅耗时,而且容易出现漏设电子元件的现象,无法满足使用需求。Before detecting defects in electronic components, it is necessary to make a standard layout of the board. In particular, it is necessary to mark the position of each electronic component on the board. The existing solution is to manually set the position of each electronic component on the circuit board, but the manual operation scheme is not only time-consuming but also prone to leakage of electronic components when the number of electronic components is large. Meet the needs of use.
发明内容Summary of the invention
针对上述问题,本发明的目的在于提供一种电子元件定位方法及装置,其可快速、准确的在电路板的图像上定位出所有电子元件的位置。In view of the above problems, an object of the present invention is to provide an electronic component positioning method and apparatus that can quickly and accurately locate the positions of all electronic components on an image of a circuit board.
本发明实施例提供了一种电子元件定位方法,包括如下步骤:Embodiments of the present invention provide a method for positioning an electronic component, including the following steps:
对采集的至少两张插件前板图像进行背景建模,获得背景模型的每个像素点的模型,其中,所述插件前板图像为未插入电子元件的电路板的图像,每个像素点的模型由k个高斯分布函数组成,k为大于1的整数;Background modeling is performed on at least two plug-in front panel images obtained, and a model of each pixel of the background model is obtained, wherein the plug-in front panel image is an image of a circuit board without an electronic component inserted, each pixel point The model consists of k Gaussian distribution functions, and k is an integer greater than one;
分别计算采集的插件后板图像的每个像素点在所述背景模型上的对应的像 素点的k个高斯分布函数下的k个概率值,其中,所述插件后板图像为插入电子元件的电路板的图像;Calculating corresponding images of each pixel of the acquired backplane image on the background model respectively k probability values under k Gaussian distribution functions of prime points, wherein the back panel image of the plug-in is an image of a circuit board into which the electronic component is inserted;
逐一将所述的k个概率值与一预设的阈值进行比较,并在任一个概率值小于所述阈值时,在所述插件后板图像上将对应的像素点标记为候选元件像素;Comparing the k probability values with a preset threshold value one by one, and marking a corresponding pixel point as a candidate element pixel on the plug-in back panel image when any one of the probability values is smaller than the threshold value;
在所述插件后板图像上连通相邻的候选元件像素,形成至少一个连通区域,以定位所述电子元件。An adjacent candidate element pixel is connected to the plug-in rear panel image to form at least one connected region to position the electronic component.
作为上述方案的改进,所述根据高斯混合模型对采集的至少两张插件前板图像进行背景建模,获得根据背景建模得到的背景模型的每个像素点的模型,包括:As an improvement of the foregoing solution, the background model is performed on the collected at least two plug-in front panel images according to the Gaussian mixture model, and a model of each pixel point of the background model obtained according to the background model is obtained, including:
对任一张插件前板图像中的每个像素点建立模型p(x),其中,x为所述像素点的灰度值,k为高斯模型的个数,ωj,μj,Cj分别表示第j个高斯模型的权重、均值和协方差;Create a model p(x) for each pixel in any of the plug-in front panel images, where x is the gray value of the pixel, k is the number of Gaussian models, and ω j , μ j , C j respectively represent the weight, mean and covariance of the jth Gaussian model;
利用其他插件前板图像上的对应的像素点对已建立的每个像素点的模型的权重、均值和协方差进行更新,获得更新后的每个像素点的模型p(x)。The weight, mean and covariance of the model of each pixel that has been established are updated using corresponding pixel points on the front panel image of the other plug-in to obtain the updated model p(x) of each pixel.
作为上述方案的改进,所述分别计算采集的插件后板图像的每个像素点在所述背景模型上的对应的像素点的k个高斯分布函数下的k个概率值,具体为:As an improvement of the foregoing solution, the k probability values of each of the pixel points of the acquired back-plate image of the acquired plug-in are corresponding to the k-gauss distribution functions of the corresponding pixel points on the background model, specifically:
分别计算所述插件后板图像上的每个像素点y在所述背景模型的对应的像素点的k个高斯分布函数下的概率值pj(y),其中,且1≤j≤k。Calculating, respectively, a probability value p j (y) of each pixel point y on the image of the back panel of the plug-in under k Gaussian distribution functions of corresponding pixel points of the background model, wherein And 1 ≤ j ≤ k.
作为上述方案的改进,所述连通区域为矩形。As a modification of the above aspect, the connected area is a rectangle.
作为上述方案的改进,在所述插件后板图像上连通相邻的候选元件像素,形成至少一个连通区域,以定位所述电子元件所在的区域,包括:As an improvement of the above solution, connecting adjacent candidate element pixels on the back panel image of the plug-in to form at least one connected area to locate an area where the electronic component is located includes:
计算所述至少一个连通区域的面积;Calculating an area of the at least one connected region;
判断每个连通区域的面积是否大于预设的面积阈值;Determining whether the area of each connected area is greater than a preset area threshold;
当所述连通区域的面积大于所述面积阈值时,标记所述连通区域为包含有 电子元件的有效区域,以定位所述电子元件;否则,标记所述连通区域为干扰区域。When the area of the connected area is greater than the area threshold, marking the connected area as containing An effective area of the electronic component to locate the electronic component; otherwise, the connected region is marked as an interference region.
本发明实施例还提供一种电子元件定位装置,包括:The embodiment of the invention further provides an electronic component positioning device, comprising:
建模单元,用于对采集的至少两张插件前板图像进行背景建模,获得背景模型的每个像素点的模型,其中,所述插件前板图像为未插入电子元件的电路板的图像,每个像素点的模型由k个高斯分布函数组成,k为大于1的整数;a modeling unit configured to perform background modeling on the acquired at least two plug-in front panel images to obtain a model of each pixel of the background model, wherein the plug-in front panel image is an image of a circuit board without an electronic component inserted The model of each pixel is composed of k Gaussian distribution functions, and k is an integer greater than one;
概率值计算单元,用于分别计算采集的插件后板图像的每个像素点在所述背景模型上的对应的像素点的k个高斯分布函数下的k个概率值,其中,所述插件后板图像为插入电子元件的电路板的图像;a probability value calculation unit, configured to respectively calculate k probability values of k Gaussian distribution functions of corresponding pixel points of each pixel point of the acquired plug-in back panel image, wherein the plug-in The board image is an image of a circuit board into which the electronic component is inserted;
比较单元,用于逐一将所述的k个概率值与一预设的阈值进行比较,并在任一个概率值小于所述阈值时,在所述插件后板图像上将对应的像素点标记为候选元件像素;a comparing unit, configured to compare the k probability values with a preset threshold one by one, and mark corresponding pixel points as candidates on the plug-in back panel image when any one of the probability values is smaller than the threshold Component pixel
定位单元,用于在所述插件后板图像上连通相邻的候选元件像素,形成至少一个连通区域,以定位所述电子元件所在的区域。And a positioning unit configured to connect adjacent candidate element pixels on the back panel image of the insert to form at least one connected area to locate an area where the electronic component is located.
作为上述方案的改进,所述建模单元包括:As an improvement of the above solution, the modeling unit includes:
模型建立单元,用于对任一张插件前板图像中的每个像素点建立模型p(x),其中,x为所述像素点的灰度值,k为高斯模型的个数,ωj,μj,Cj分别表示第j个高斯模型的权重、均值和协方差;a model building unit for establishing a model p(x) for each pixel in any of the plug-in front panel images, wherein x is the gray value of the pixel, k is the number of Gaussian models, and ω j , μ j , C j respectively represent the weight, mean and covariance of the jth Gaussian model;
更新单元,用于利用其他插件前板图像上的对应的像素点对已建立的每个像素点的模型的权重、均值和协方差进行更新,获得更新后的每个像素点的模型。The updating unit is configured to update the weight, the mean and the covariance of the model of each pixel that has been established by using corresponding pixel points on the image of the front panel of the other plug-in, and obtain an updated model of each pixel.
作为上述方案的改进,所述概率值计算单元具体用于,分别计算所述插件后板图像上的每个像素点y在所述背景模型的对应的像素点的k个高斯分布函数下的概率值pj(y),其中,且1≤j ≤k。As a modification of the foregoing solution, the probability value calculation unit is specifically configured to separately calculate a probability of each pixel point y on the back panel image of the plug-in under k Gaussian distribution functions of corresponding pixel points of the background model. Value p j (y), where And 1 ≤ j ≤ k.
作为上述方案的改进,所述连通区域为矩形。As a modification of the above aspect, the connected area is a rectangle.
作为上述方案的改进,所述定位单元包括:As an improvement of the above solution, the positioning unit comprises:
面积计算单元,用于计算所述至少一个连通区域的面积;An area calculation unit, configured to calculate an area of the at least one connected area;
判断单元,用于每个连通区域的面积是否大于预设的面积阈值;a determining unit, configured to determine whether an area of each connected area is greater than a preset area threshold;
标记单元,用于当所述连通区域的面积大于所述面积阈值时,标记所述连通区域为包含有电子元件的有效区域,以定位所述电子元件;否则,标记所述连接区域为干扰区域。a marking unit, configured to mark the connected area as an effective area including an electronic component to locate the electronic component when an area of the connected area is greater than the area threshold; otherwise, marking the connected area as an interference area .
本发明实施例提供的电子元件定位方法及装置,通过利用高斯混合模型建立背景模型,再根据所述插件后板图像与所述背景模型的每个像素点进行匹配后,根据匹配的情况获得候选元件像素,并通过连通相邻的候选元件像素,在插件后板图像定位出电子元件的位置,从而实现了从所述插件后板图像上快速、准确的定位出电子元件的位置,为后续的电路板检测提供可靠的标准版式。The electronic component positioning method and device provided by the embodiment of the present invention establishes a background model by using a Gaussian mixture model, and then matches each pixel of the background model according to the back panel image of the plug-in, and obtains candidates according to the matching situation. Component pixels, and by connecting adjacent candidate element pixels, position the electronic component in the back panel image of the plug-in, thereby realizing rapid and accurate positioning of the electronic component from the image of the back panel of the plug-in for subsequent Board inspection provides a reliable standard layout.
为了更清楚地说明本发明的技术方案,下面将对实施方式中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the present invention, the drawings used in the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present invention, which are common in the art. For the skilled person, other drawings can be obtained from these drawings without any creative work.
图1是本发明实施例提供的电子元件定位方法的流程图。1 is a flow chart of a method for positioning an electronic component according to an embodiment of the present invention.
图2是本发明实施例提供的插件前板的示意图。2 is a schematic diagram of a front panel of a plug-in according to an embodiment of the present invention.
图3是本发明实施例提供的插件后板的示意图。FIG. 3 is a schematic diagram of a rear panel of a plug-in according to an embodiment of the present invention.
图4是本发明实施例提供的在所述插件后板图像中定位出电子元件的示意图。4 is a schematic diagram of positioning an electronic component in an image of a back panel of the plug-in according to an embodiment of the present invention.
图5是本发明实施例提供的电子元件定位装置的流程图。FIG. 5 is a flowchart of an electronic component positioning apparatus according to an embodiment of the present invention.
图6是图5所示的建模单元的结构示意图。FIG. 6 is a schematic structural view of the modeling unit shown in FIG. 5.
图7是图5所示的定位单元的另一种结构示意图。 FIG. 7 is another schematic structural view of the positioning unit shown in FIG. 5.
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
本发明实施例提高一种电子元件定位方法及装置,用于通过自动定位的方式定位出电路板上的所有电子元件的位置。以下分别进行详细描述。Embodiments of the present invention improve an electronic component positioning method and apparatus for positioning the position of all electronic components on a circuit board by means of automatic positioning. The details are described below separately.
请参阅图1,图1是本发明实施例提供的电子元件定位方法的流程图。所述电子元件定位方法可由电子元件定位装置来执行,并至少包括步骤S101至S104。其中,Please refer to FIG. 1. FIG. 1 is a flowchart of a method for positioning an electronic component according to an embodiment of the present invention. The electronic component positioning method can be performed by the electronic component positioning device and includes at least steps S101 to S104. among them,
S101,对采集的至少两张插件前板图像进行背景建模,获得背景模型的每个像素点的模型,其中,所述插件前板图像为未插入电子元件的电路板的图像,每个像素点的模型由k个高斯分布函数组成,k为大于1的整数。S101: Perform background modeling on the collected at least two plug-in front panel images to obtain a model of each pixel of the background model, where the plug-in front panel image is an image of a circuit board that is not inserted into the electronic component, and each pixel The model of the point consists of k Gaussian distribution functions, and k is an integer greater than one.
请一并参阅图2,在本发明实施例中,所述插件前板图像为未插入电子元件的电路板的图像。其中,所述电子元件定位装置可采用高斯混合模型对所述插件前板图像进行建模,获得所述插件前板的背景模型。所述高斯混合模型在进行背景建模时,为了刻画背景及其可能的变化,需要多张背景图像,因而,本发明所述的插件前板图像为至少两张。Referring to FIG. 2 together, in the embodiment of the present invention, the front panel image of the plug-in is an image of a circuit board that is not inserted into an electronic component. Wherein, the electronic component positioning device may model the plug-in front panel image by using a Gaussian mixture model to obtain a background model of the plug-in front panel. In the Gaussian mixture model, in order to describe the background and its possible changes, a plurality of background images are required for the background modeling. Therefore, the plug-in front panel image of the present invention is at least two.
具体地,在进行背景建模时:Specifically, when performing background modeling:
首先,对任一张插件前板图像中的每个像素点建立模型p(x),其中,x为所述像素点的灰度值,k为高斯模型的个数,ωj,μj,Cj分别表示第j个高斯模型的权重、均值和协方差。First, create a model p(x) for each pixel in any of the plug-in front panel images, where x is the gray value of the pixel, k is the number of Gaussian models, and ω j , μ j , C j represent the weight, mean and covariance of the jth Gaussian model, respectively.
在本发明实施例中,所述电子元件定位装置任取一张插件前板图像,并对所述插件前板图像的每个像素点均建立一个模型p(x),其中, x为所述像素点的像素值,k为高斯模型的个数,ωj,μj,Cj分别表示第j个高斯模型的权重、均值和协方差。这里,可视为将所述插件前板图像的一个像素点的像素值表示为k个高斯分布函数的组合,而高斯模型的权重、均值和协方差可先根据经验值进行设置。In the embodiment of the present invention, the electronic component positioning device takes a plug-in front panel image, and creates a model p(x) for each pixel of the plug-in front panel image, wherein x is the pixel value of the pixel, k is the number of Gaussian models, and ω j , μ j , C j represent the weight, mean and covariance of the jth Gaussian model, respectively. Here, it can be considered that the pixel value of one pixel of the plug-in front panel image is represented as a combination of k Gaussian distribution functions, and the weight, the mean and the covariance of the Gaussian model can be set according to the empirical value.
然后,利用其他插件前板图像上的对应的像素点对已建立的每个像素点的模型的权重、均值和协方差进行更新,获得更新后的每个像素点的模型p(x)。Then, the weight, mean and covariance of the model of each pixel that has been established are updated by using corresponding pixel points on the image of the other plug-in front panel, and the updated model p(x) of each pixel is obtained.
在本发明实施例中,当有新的像素点加入时(即加入新的插件前板图像),所述电子元件定位装置则将这个新的像素点的像素值分别与对应的背景模型的像素点的k个高斯分布的均值μj相比,同时计算新的像素值落入相应高斯分布的概率,并按判断法则选择匹配的高斯分布。当存在匹配的高斯分布时,则需要根据新的像素点的像素值,对这些高斯分布的权重、均值和协方差等参数进行更新。具体的计算过程可参考一般高斯混合模型的参数更新原理,本发明在此不做赘述。In the embodiment of the present invention, when a new pixel is added (ie, a new plug-in front panel image is added), the electronic component positioning device respectively separates the pixel value of the new pixel from the pixel of the corresponding background model. The probability of the new pixel value falling into the corresponding Gaussian distribution is calculated simultaneously with the mean μ j of the k Gaussian distributions of the points, and the matched Gaussian distribution is selected according to the judgment rule. When there is a matching Gaussian distribution, the parameters such as the weight, mean and covariance of these Gaussian distributions need to be updated according to the pixel values of the new pixel points. For a specific calculation process, reference may be made to the parameter update principle of the general Gaussian mixture model, and the present invention will not be described herein.
在本发明实施例中,所述电子元件定位装置通过上述的操作即获得了背景模型的每个像素点的模型,其中,每个像素点的模型由k个高斯分布函数组成,k为大于1的整数,且较佳地,k的取值范围为3至5个。In the embodiment of the present invention, the electronic component positioning device obtains a model of each pixel point of the background model by the above operation, wherein the model of each pixel point is composed of k Gaussian distribution functions, and k is greater than 1 An integer, and preferably, k ranges from 3 to 5.
S102,分别计算采集的插件后板图像的每个像素点在所述背景模型上的对应的像素点的k个高斯分布函数下的k个概率值,其中,所述插件后板图像为插入电子元件的电路板的图像。S102: Calculate k probability values of k pieces of Gaussian distribution function of corresponding pixel points of each pixel point of the acquired plug-in back panel image, wherein the plug-in back panel image is an inserted electron. An image of the component's board.
请一并参阅图3,在本发明实施例中,所述电子元件定位装置先获取插件后板图像,其中,所述插件后板图像为插入电子元件的电路板的图像。然后,所述电子元件定位装置分别计算所述插件后板图像的每个像素点在所述背景模型上的对应的像素点的k个高斯分布函数下的k个概率值。Referring to FIG. 3 together, in the embodiment of the present invention, the electronic component positioning device first acquires an image of the back panel of the plug-in, wherein the image of the back panel of the plug-in is an image of a circuit board into which the electronic component is inserted. Then, the electronic component locating device respectively calculates k probability values under k Gaussian distribution functions of corresponding pixel points of the pixel of the plug-in rear panel image on the background model.
例如,假设所述背景模板与所述插件后板图像的尺寸大小均为M×N个像素。其中,对于所述背景模板的每个像素,均可用k个高斯分布函数来表示。 在进行计算时,所述电子元件定位装置先读取所述插件后板图像的第一个像素点(如坐标为(1,1))的像素值y,接着所述电子元件定位装置读取对应的背景模型上的像素点(如坐标也为(1,1))的k个高斯分布函数然后,所述电子元件定位装置将所述插件后板图像的像素值y分别代入所述的k个高斯分布函数,获得k个概率值,其中,第j个概率值可表示为 For example, assume that the size of the background template and the back panel image of the plug-in are both M×N pixels. Wherein, for each pixel of the background template, it can be represented by k Gaussian distribution functions. When performing the calculation, the electronic component positioning device first reads the pixel value y of the first pixel point (such as the coordinate (1, 1)) of the back panel image of the plug-in, and then the electronic component positioning device reads k Gaussian distribution functions of pixels on the corresponding background model (such as coordinates (1, 1)) Then, the electronic component positioning device substitutes the pixel values y of the back panel image of the plug-in into the k Gaussian distribution functions to obtain k probability values, wherein the j-th probability value can be expressed as
如此,当所述电子元件定位装置遍历所述插件后板图像及所述背景模板上的所有像素点后,即可获得每个像素点对应的k个概率值。In this way, when the electronic component positioning device traverses all the pixel points on the back panel image and the background template of the plug-in, the k probability values corresponding to each pixel point can be obtained.
S103,逐一将所述的k个概率值与一预设的阈值进行比较,并在任一个概率值小于所述阈值时,在所述插件后板图像上将对应的像素点标记为候选元件像素。S103. Compare the k probability values with a preset threshold one by one, and mark the corresponding pixel points as candidate element pixels on the plug-in backplane image when any of the probability values is smaller than the threshold.
在本发明实施例中,所述电子元件定位装置逐一将所述的k个概率值与一预设的阈值进行比较,其中,当任一个概率值小于所述阈值时,则将对应的像素点标记为候选元件像素,而当所有的k个概率值均大于所述阈值时,则将所述像素点标记为背景像素。In the embodiment of the present invention, the electronic component positioning device compares the k probability values with a preset threshold one by one, wherein when any of the probability values is less than the threshold, the corresponding pixel points are Marked as candidate element pixels, and when all k probability values are greater than the threshold, the pixel points are marked as background pixels.
S104,在所述插件后板图像上连通相邻的候选元件像素,形成至少一个连通区域,以定位所述电子元件。S104. Connect adjacent candidate element pixels on the plug-in backplane image to form at least one connected area to locate the electronic component.
请一并参阅图4,在本发明的一个实施例中,所述电子元件定位装置在对所述插件后板图像上的所有像素点均进行标记后,连通相邻的候选元件像素。其中,连通后将形成至少一个连通区域,所述连通区域即为电子元件所在的位置。其中,较佳地,作为本发明的优选实施例,所述连通区域的形状为一矩形(如图4中的三个白色方框所示)。当然,可以理解的是,在本发明的其他实施例中,所述连通区域还可为圆形、三角形或其他形状,本发明不做具体限定。Referring to FIG. 4 together, in an embodiment of the present invention, the electronic component positioning device connects adjacent candidate component pixels after marking all the pixels on the back panel image of the plug-in. Wherein, at least one connected area will be formed after the communication, and the connected area is the position where the electronic component is located. Preferably, as a preferred embodiment of the present invention, the shape of the connected region is a rectangle (as shown by three white squares in FIG. 4). Of course, it can be understood that in other embodiments of the present invention, the connected area may also be a circle, a triangle, or other shapes, which is not specifically limited in the present invention.
在本发明的另一个实施例中,由于算法的精度或参数误差等问题,有时会导致原本是背景像素的像素点被错误计算为候选元件像素。此时,可能会造成 原本不存在电子元件的位置形成连通区域。为了防止出现上述情况,所述电子元件定位装置可进行如下设置:In another embodiment of the present invention, pixel points that are originally background pixels are sometimes erroneously calculated as candidate element pixels due to problems such as accuracy of the algorithm or parameter errors. At this time, it may cause The position where the electronic component does not exist originally forms a connected region. In order to prevent the above, the electronic component positioning device can be set as follows:
首先,计算所述至少一个连通区域的面积。First, an area of the at least one connected region is calculated.
其次,判断每个连通区域的面积是否大于预设的面积阈值。Secondly, it is determined whether the area of each connected area is greater than a preset area threshold.
最后,当所述连通区域的面积大于所述面积阈值时,标记所述连通区域为包含有电子元件的有效区域;否则,标记所述连通区域为不包含有电子元件的干扰区域。Finally, when the area of the connected area is larger than the area threshold, the connected area is marked as an effective area including an electronic component; otherwise, the connected area is marked as an interference area not including an electronic component.
如此,排除掉那些面积较小的连通区域,即排除那些因计算精度或误差等造成的干扰区域,保证了所述连通区域均为包括电子元件的区域。In this way, the areas of communication having a small area are excluded, that is, the interference areas caused by calculation accuracy or error are excluded, and the connected areas are all areas including electronic components.
综上所述,本发明实施例提供的电子元件定位方法,通过利用高斯混合模型建立背景模型,再根据所述插件后板图片与所述背景模型的每个像素点进行匹配,获得候选元件像素,并通过连通相邻的候选元件像素,在插件后板图像定位出电子元件的位置,从而实现了从插件后板图像上快速、准确的定位出电子元件的位置,为后续的电路板检测提供可靠的标准版式。In summary, the electronic component positioning method provided by the embodiment of the present invention obtains a background model by using a Gaussian mixture model, and then matches each pixel of the background model according to the back panel image of the plug-in to obtain a candidate component pixel. And by connecting adjacent candidate element pixels, the position of the electronic component is located in the back panel image of the plug-in, thereby realizing the position of the electronic component quickly and accurately from the image of the back panel of the plug-in, and providing for subsequent board inspection. Reliable standard layout.
请参阅图5,图5是本发明实施例提供的电子元件定位装置的结构图。所述电子元件定位装置100可用于执行上述的电子元件定位方法,并至少包括建模单元10、概率值计算单元20、比较单元30及定位单元40,其中:Please refer to FIG. 5. FIG. 5 is a structural diagram of an electronic component positioning apparatus according to an embodiment of the present invention. The electronic
所述建模单元10,用于对采集的至少两张插件前板图像进行背景建模,获得背景模型的每个像素点的模型,其中,所述插件前板图像为未插入电子元件的电路板的图像,每个像素点的模型由k个高斯分布函数组成,k为大于1的整数。The
在本发明实施例中,所述插件前板图像为未插入电子元件的电路板的图像。为了从电路板上定位出电子元件的位置,所述建模单元10可先采集至少两张插件前板图像作为背景图像。其中,所述建模单元10可采用高斯混合模型对所述插件前板图像进行建模,获得所述插件前板的背景模型。所述高斯混合模型在进行背景建模时,为了刻画背景及其可能的变化,需要多张背景图像,因而,
本发明所述的插件前板图像为至少两张。In an embodiment of the invention, the front panel image of the plug-in is an image of a circuit board that is not inserted into an electronic component. In order to locate the position of the electronic component from the circuit board, the
请一并参阅图6,具体地,所述建模单元10包括模型建立单元11及更新单元12,其中:Please refer to FIG. 6 in detail. Specifically, the
所述模型建立单元11,用于对任一张插件前板图像中的每个像素点建立模型p(x),其中,x为所述像素点的灰度值,a为高斯模型的个数,ωj,μj,Cj分别表示第j个高斯模型的权重、均值和协方差。The model establishing unit 11 is configured to establish a model p(x) for each pixel in any of the plug-in front panel images, where x is the gray value of the pixel, a is the number of Gaussian models, and ω j , μ j , C j represent the weight, mean and covariance of the jth Gaussian model, respectively.
在本发明实施例中,所述模型建立单元11任取一张插件前板图像,并对所述插件前板图像的每个像素点建立一个模型p(x),其中,x为所述像素点的像素值,k为高斯模型的个数,ωj,μj,Cj分别表示第j个高斯模型的权重、均值和协方差。这里,可视为将所述插件前板图像的一个像素点的像素值表示为k个高斯分布函数的组合,而高斯模型的权重、均值和协方差可先根据经验值进行设置。In the embodiment of the present invention, the model establishing unit 11 takes a plug-in front panel image and creates a model p(x) for each pixel of the plug-in front panel image, where x is the pixel value of the pixel, k is the number of Gaussian models, and ω j , μ j , C j represent the weight, mean and covariance of the jth Gaussian model, respectively. Here, it can be considered that the pixel value of one pixel of the plug-in front panel image is represented as a combination of k Gaussian distribution functions, and the weight, the mean and the covariance of the Gaussian model can be set according to the empirical value.
所述更新单元12,用于利用其他插件前板图像上的对应的像素点对已建立的每个像素点的模型的权重、均值和协方差进行更新,获得更新后的每个像素点的模型p(x)。The updating
在本发明实施例中,当有新的像素点加入时(即加入新的插件前板图像),所述更新单元12则将这个新的像素点的像素值分别与上述的k个高斯分布的均值μj相比,同时计算新的像素值落入相应高斯分布的概率,并按判断法则选择匹配的高斯分布。当存在匹配的高斯分布时,则需要根据新的像素点的像素值,对这些高斯分布的权重、均值和协方差等参数进行更新。具体的计算过程可参考一般高斯混合模型的参数更新原理,本发明在此不做赘述。In the embodiment of the present invention, when a new pixel is added (ie, a new plug-in front panel image is added), the updating
在本发明实施例中,所述建模单元10通过上述的操作即获得了背景模型的每个像素点的模型,其中,每个像素点的模型由k个高斯分布函数组成,k为大于1的整数,且较佳地,k的取值范围为3至5个。
In the embodiment of the present invention, the
所述概率值计算单元20,用于分别计算采集的插件后板图像的每个像素点在所述背景模型上的对应的像素点的k个高斯分布函数下的k个概率值,其中,所述插件后板图像为插入电子元件的电路板的图像。The probability
在本发明实施例中,所述概率值计算单元20先获取插件后板图像,其中,所述插件后板图像为插入电子元件的电路板的图像。然后,所述概率值计算单元20分别计算所述插件后板图像的每个像素点在所述背景模型上的对应的像素点的k个高斯分布函数下的k个概率值。In the embodiment of the present invention, the probability
例如,假设所述背景模板与所述插件后板图像的尺寸大小均为M×N个像素。其中,对于所述背景模板的每个像素,均可用k个高斯分布函数来表示。在进行计算时,所述概率值计算单元20先读取所述插件后板图像的第一个像素点(如坐标为(1,1))的像素值y,接着所述概率值计算单元20读取对应的背景模型上的像素点(如坐标也为(1,1))的k个高斯分布函数然后,所述概率值计算单元20将所述插件后板图像的像素值y分布代入所述的k个高斯分布函数,获得k个概率值,其中,第j个概率值可表示为
For example, assume that the size of the background template and the back panel image of the plug-in are both M×N pixels. Wherein, for each pixel of the background template, it can be represented by k Gaussian distribution functions. When performing the calculation, the probability
如此,当所述概率值计算单元20遍历所述插件后板图像及所述背景模板上的所有像素点后,即可获得每个像素点对应的k个概率值。In this way, when the probability
所述比较单元30,用于逐一将所述的k个概率值与一预设的阈值进行比较,并在任一个概率值小于所述阈值时,在所述插件后板图像上将对应的像素点标记为候选元件像素。The comparing
在本发明实施例中,所述比较单元30逐一将所述的k个概率值与一预设的阈值进行比较,其中,当任一个概率值小于所述阈值时,则所述比较单元30将对应的像素点标记为候选元件像素,而当所有的k个概率值均大于所述阈值时,则所述比较单元30将所述像素点标记为背景像素。In the embodiment of the present invention, the comparing
所述定位单元40,用于在所述插件后板图像上连通相邻的候选元件像素,
形成至少一个连通区域,以定位所述电子元件。The
在本发明的一个实施例中,所述定位单元40在对所述插件后板图像上的所有像素点均进行标记后,连通相邻的候选元件像素。其中,连通后将形成至少一个连通区域,所述连通区域即为电子元件所在的位置。其中,较佳地,作为本发明的优选实施例,所述连通区域的形状为一矩形。当然,可以理解的是,在本发明的其他实施例中,所述连通区域还可为圆形、三角形或其他形状,本发明不做具体限定。In an embodiment of the invention, the
请一并参阅图7,在本发明的另一个实施例中,由于算法的精度或参数误差等问题,有时会导致原本是背景像素的像素点被错误计算为候选元件像素。此时,可能会造成原本不存在电子元件的位置形成连通区域。为了防止出现上述情况,所述定位单元40可包括:Referring to FIG. 7 together, in another embodiment of the present invention, due to problems such as the accuracy of the algorithm or the parameter error, the pixel points which are originally background pixels are sometimes erroneously calculated as candidate element pixels. At this time, a connection region may be formed at a position where the electronic component is not originally present. In order to prevent the above situation, the
面积计算单元41,用于计算所述至少一个连通区域的面积。The
判断单元42,用于判断每个连通区域的面积是否大于预设的面积阈值。The determining
标记单元43,用于当所述连通区域的面积大于所述面积阈值时,标记所述连通区域为包含有电子元件的有效区域;否则,标记所述连通区域为不包含有电子元件的干扰区域。The marking
如此,所述定位单元40排除掉那些面积较小的连通区域,即排除那些因计算精度或误差等造成的干扰区域,保证了所述连通区域均为包括电子元件的区域。In this way, the
综上所述,本发明实施例提供的电子元件定位装置100,通过利用高斯混合模型建立背景模型,再根据所述插件后板图片与所述背景模型的每个像素点进行匹配,获得候选元件像素,并通过连通相邻的候选元件像素,在插件后板图像定位出电子元件的位置,从而实现了从插件后板图像上快速、准确的定位出电子元件的位置,为后续的电路板检测提供可靠的标准版式。In summary, the electronic
以上所揭露的仅为本发明一种较佳实施例而已,当然不能以此来限定本发明之权利范围,本领域普通技术人员可以理解实现上述实施例的全部或部分流程,并依本发明权利要求所作的等同变化,仍属于发明所涵盖的范围。 The above disclosure is only a preferred embodiment of the present invention, and of course, the scope of the present invention is not limited thereto, and those skilled in the art can understand all or part of the process of implementing the above embodiments, and according to the present invention. The equivalent changes required are still within the scope of the invention.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。 One of ordinary skill in the art can understand that all or part of the process of implementing the foregoing embodiments can be completed by a computer program to instruct related hardware, and the program can be stored in a computer readable storage medium. When executed, the flow of an embodiment of the methods as described above may be included. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
Claims (10)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510617925.5 | 2015-09-24 | ||
| CN201510617925.5A CN105354816B (en) | 2015-09-24 | 2015-09-24 | Electronic component positioning method and device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2017050088A1 true WO2017050088A1 (en) | 2017-03-30 |
Family
ID=55330783
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2016/096745 Ceased WO2017050088A1 (en) | 2015-09-24 | 2016-08-25 | Method and device for locating electronic component |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN105354816B (en) |
| WO (1) | WO2017050088A1 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107862690A (en) * | 2017-11-22 | 2018-03-30 | 佛山科学技术学院 | The circuit board element localization method and positioner of a kind of feature based Point matching |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105354816B (en) * | 2015-09-24 | 2017-12-19 | 广州视源电子科技股份有限公司 | Electronic component positioning method and device |
| CN106503737B (en) * | 2016-10-20 | 2019-03-05 | 广州视源电子科技股份有限公司 | Electronic component positioning method and device |
| CN112396062A (en) * | 2020-12-03 | 2021-02-23 | 广州海洋地质调查局 | Identification and segmentation method and processing terminal for benthos |
| CN112734691B (en) * | 2020-12-17 | 2023-06-16 | 郑州金惠计算机系统工程有限公司 | Industrial product defect detection method and device, terminal equipment and storage medium |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6078700A (en) * | 1997-03-13 | 2000-06-20 | Sarachik; Karen B. | Method and apparatus for location and inspecting a two-dimensional image including co-linear features |
| CN103577646A (en) * | 2013-11-09 | 2014-02-12 | 深港产学研基地 | Calculation method for fast estimating yield of integrated circuit |
| CN104463178A (en) * | 2014-12-29 | 2015-03-25 | 广州视源电子科技股份有限公司 | Electronic component identification method and system |
| CN104777176A (en) * | 2015-03-25 | 2015-07-15 | 广州视源电子科技股份有限公司 | PCB detection method and device |
| CN104867145A (en) * | 2015-05-15 | 2015-08-26 | 广东工业大学 | IC component solder joint defect detection method based on VIBE model |
| CN105354816A (en) * | 2015-09-24 | 2016-02-24 | 广州视源电子科技股份有限公司 | Electronic component positioning method and device |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102982519B (en) * | 2012-11-23 | 2015-04-01 | 南京邮电大学 | Extracting and splicing method of video images |
-
2015
- 2015-09-24 CN CN201510617925.5A patent/CN105354816B/en active Active
-
2016
- 2016-08-25 WO PCT/CN2016/096745 patent/WO2017050088A1/en not_active Ceased
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6078700A (en) * | 1997-03-13 | 2000-06-20 | Sarachik; Karen B. | Method and apparatus for location and inspecting a two-dimensional image including co-linear features |
| CN103577646A (en) * | 2013-11-09 | 2014-02-12 | 深港产学研基地 | Calculation method for fast estimating yield of integrated circuit |
| CN104463178A (en) * | 2014-12-29 | 2015-03-25 | 广州视源电子科技股份有限公司 | Electronic component identification method and system |
| CN104777176A (en) * | 2015-03-25 | 2015-07-15 | 广州视源电子科技股份有限公司 | PCB detection method and device |
| CN104867145A (en) * | 2015-05-15 | 2015-08-26 | 广东工业大学 | IC component solder joint defect detection method based on VIBE model |
| CN105354816A (en) * | 2015-09-24 | 2016-02-24 | 广州视源电子科技股份有限公司 | Electronic component positioning method and device |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107862690A (en) * | 2017-11-22 | 2018-03-30 | 佛山科学技术学院 | The circuit board element localization method and positioner of a kind of feature based Point matching |
| CN107862690B (en) * | 2017-11-22 | 2023-11-14 | 佛山科学技术学院 | A circuit board component positioning method and positioning device based on feature point matching |
Also Published As
| Publication number | Publication date |
|---|---|
| CN105354816A (en) | 2016-02-24 |
| CN105354816B (en) | 2017-12-19 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN113688807B (en) | Self-adaptive defect detection method, device, recognition system and storage medium | |
| CN104732207B (en) | High-precision positions the method and device of pcb board Mark points with high noise immunity | |
| CN106097361B (en) | Defect area detection method and device | |
| CN114627089B (en) | Defect identification method, defect identification device, computer equipment and computer readable storage medium | |
| WO2017050088A1 (en) | Method and device for locating electronic component | |
| CN105976354B (en) | Color and gradient based component positioning method and system | |
| WO2018010391A1 (en) | Board inspection method and device | |
| WO2018068415A1 (en) | Detection method and system for wrong part | |
| CN108961236A (en) | Training method and device, the detection method and device of circuit board defect detection model | |
| JP6317725B2 (en) | System and method for determining clutter in acquired images | |
| WO2017181724A1 (en) | Inspection method and system for missing electronic component | |
| CN104423142B (en) | Calibration data collection method and system for optical proximity correction models | |
| WO2017092427A1 (en) | Electronic element positioning method and apparatus | |
| CN108520514A (en) | Printed circuit board electronics member device consistency detecting method based on computer vision | |
| TW202127372A (en) | Method for defect level determination and computer readable storage medium thereof | |
| CN115439840B (en) | A method, apparatus, equipment and medium for identifying slot areas in aircraft parts | |
| WO2018072334A1 (en) | Method and device for positioning electronic component | |
| WO2017071406A1 (en) | Method and system for detecting pin of gold needle element | |
| CN112435252B (en) | Warhead fragment perforation and pit detection method | |
| CN110874837A (en) | Automatic defect detection method based on local feature distribution | |
| CN108416790B (en) | A detection method for workpiece breakage rate | |
| CN115713553A (en) | Blind hole plate blind hole depth measuring method and related device | |
| CN105092604B (en) | Line information and non-line area information acquisition method and line defect detection method | |
| CN109509165B (en) | Image positioning area selection method and device | |
| WO2018068414A1 (en) | Detection method and device for resistor having color bands, and automated optical inspection system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16847970 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 16847970 Country of ref document: EP Kind code of ref document: A1 |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 29.01.2019) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 16847970 Country of ref document: EP Kind code of ref document: A1 |