WO2017067320A1 - 一种焊点定位方法及装置 - Google Patents
一种焊点定位方法及装置 Download PDFInfo
- Publication number
- WO2017067320A1 WO2017067320A1 PCT/CN2016/096750 CN2016096750W WO2017067320A1 WO 2017067320 A1 WO2017067320 A1 WO 2017067320A1 CN 2016096750 W CN2016096750 W CN 2016096750W WO 2017067320 A1 WO2017067320 A1 WO 2017067320A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- copper foil
- area
- pixel
- solder joint
- 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
-
- 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
-
- 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/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
- G06T2207/30141—Printed circuit board [PCB]
Definitions
- the invention relates to the field of automatic optical inspection, and in particular to a method and a device for positioning a solder joint.
- AOI Automatic Optic Inspection
- Solder defect detection is a common application in the field of automatic optical inspection.
- the machine automatically scans the board to obtain images, automatically extracts partial images of each solder joint, and uses image processing technology to determine whether the solder at the solder joint is defective. Finally, the solder with suspected defects is displayed or marked for easy viewing and overhaul.
- the method of marking the position of the solder joint is to derive the position information of each solder joint according to the design file of the circuit board.
- the design file of the circuit board cannot be obtained, and the design file is used to reduce the position. Confidentiality.
- manually set the location of each solder joint but manual setup is time consuming when there are more solder joints on the board.
- the embodiment of the invention provides a solder joint positioning method and device, which can quickly and accurately locate the position of the solder joint.
- Embodiments of the present invention provide a solder joint positioning method, including:
- An circumscribed pattern of each of the obtained copper foil area images is extracted, and an area included in the circumscribed pattern is positioned as an area of the solder joint.
- the extracting the through hole area image and the N copper foil area images in the image of the circuit board specifically includes:
- the first color is red Any color
- the extracting the red dominant pixel and the preset first color dominant pixel in the image of the circuit board respectively includes:
- the component is a primary color similar to the color of the circuit board in the three primary colors RGB;
- the copper foil area image is a ring image
- the shape of the structural element is a rectangle, and the size of the structural element is a width of the image of the copper foil area;
- the extracting the circumscribed pattern of each of the obtained copper foil area images, and positioning the area included in the circumscribed pattern as the area of the solder joint specifically includes:
- solder joint positioning device comprising:
- An image acquisition module configured to acquire an image of a circuit board under illumination of three primary colors of light RGB;
- An image extraction module configured to extract an image of a through hole region and an image of N copper foil regions in an image of the circuit board; N ⁇ 1;
- a processing module configured to perform an expansion process on the through-hole area image to obtain an image of a copper foil area intersecting the image of the expanded through-hole area
- a positioning module configured to extract an external pattern of each of the obtained copper foil area images, and position the area included in the external pattern as an area of the solder joint.
- the image extraction module specifically includes:
- a pixel extraction unit configured to respectively extract a red dominant pixel and a preset first color dominant pixel in the image of the circuit board, and use the extracted first color dominant pixel as the through hole area image;
- the first color is any color other than red;
- a dividing unit configured to divide the extracted red dominant pixels, so that the adjacent red dominant pixels form a copper foil area image
- An image extracting unit is configured to extract the image of the N copper foil regions formed.
- the pixel extraction unit specifically includes:
- An RGB value calculation subunit for calculating an RGB value of each pixel in an image of the board
- a first pixel extraction subunit configured to extract the red dominant pixel according to the RGB value of each pixel
- a component value acquiring unit configured to acquire a component value of each of the pixels according to a pre-selected component; the component is a primary color of the three primary colors RGB that is similar in color to the circuit board;
- a second pixel extraction subunit configured to perform threshold segmentation on component values of each pixel to extract the first color dominant pixel.
- the copper foil area image is a ring image
- the processing module specifically includes:
- a processing unit configured to perform an expansion process on the through-hole area image according to a preset structural element;
- the shape of the structural element is a rectangle, and the size of the structural element is a width of the image of the copper foil area;
- a detecting unit configured to detect, by one by one, whether each of the copper foil area images intersects the image of the expanded through hole area
- an acquisition unit configured to acquire an image of the copper foil region intersecting the image of the expanded through hole region when the intersection is detected.
- the positioning module is specifically configured to extract, according to the acquired pixel position in each copper foil area image, an acquired external pattern of each copper foil area image, and locate the area included in the external graphic The area of the solder joint.
- the solder joint positioning method and device provided by the embodiment of the invention can extract all the through hole area image and the copper foil area image in the circuit board image, and expand and process the through hole area image to determine whether it is related to the copper foil area image. Intersecting, the area where the circumscribed pattern of the intersecting copper foil area image is determined as the area of the solder joint, thereby achieving fast and accurate positioning of the solder joint position.
- the size of the structural element is set to the width of the copper foil area image, and the expansion size of the through hole area image is optimized to accurately locate the position of the solder joint.
- FIG. 1 is a schematic flow chart of an embodiment of a solder joint positioning method provided by the present invention
- FIG. 2 is a schematic diagram of an image of a circuit board in a solder joint positioning method provided by the present invention
- FIG. 3 is another schematic diagram of an image of a circuit board in a solder joint positioning method provided by the present invention.
- FIG. 4 is a schematic structural view of an embodiment of a solder joint positioning device provided by the present invention.
- FIG. 1 is a schematic flow chart of an embodiment of a solder joint positioning method provided by the present invention, including:
- the circuit board is irradiated with the relatively mature AOI three primary color lights RGB (red, green, and blue), and the camera automatically scans the circuit board under the RGB illumination to obtain a color image of the circuit board. According to the color in the image, all the through hole area images and the copper foil area images are extracted. Since the solder joint is composed of a copper foil and a through hole, the copper foil surrounds the periphery of its corresponding through hole, and therefore, the through hole area image is subjected to expansion processing.
- RGB red, green, and blue
- the image of the through hole region after the expansion can intersect the image of the copper foil region, the copper foil region and the intersecting through hole region thereof are the regions of the solder joint, and the external pattern of the image of the copper foil region can be extracted to achieve the butt welding.
- the location of the point area is the region of the solder joint, and the external pattern of the image of the copper foil region can be extracted to achieve the butt welding.
- the extracting the through hole area image and the N copper foil area images in the image of the circuit board specifically includes:
- the first color is red Any color
- the extracting the red dominant pixel and the preset first color dominant pixel in the image of the circuit board respectively include:
- the component is a primary color similar to the color of the circuit board in the three primary colors RGB;
- the color of the copper foil area after imaging is red
- the color of the through hole area after imaging is the first color.
- the first color varies according to the color of the through hole on the circuit board, and is generally black.
- M R is the dominant region of red R
- T R is a preset smaller threshold.
- the red dominant pixel can be obtained by extracting the pixels of the region M R .
- the extracted red dominant pixels are divided into N connected area images by a method of 4 connected or 8 connected, and one connected area image is a copper foil area image.
- the same copper foil area image is marked with the same value, for example, all pixels in the j-th copper foil area image are marked as j, j ⁇ 1.
- the red dominant pixel is divided into four copper foil area images, and each copper foil area image is marked to obtain a first copper foil area image 21, a second copper foil area image 22, and a third connection.
- the component most similar to the ground color is selected according to the background color of the circuit board, and the through hole area image is extracted according to the selected component.
- the background color of the circuit board is green.
- it is more effective to extract the black through-hole area image on the green component then select the green component, obtain the G value of each pixel, and then according to each
- the G value of the pixel is extracted by the thresholding technique, and the calculation formula is as follows:
- M H is a black dominant region
- T H is a preset threshold.
- the black dominant pixel that is, the via area image 3, is obtained by extracting the pixels of the area M H .
- the copper foil area image is a ring image
- the shape of the structural element is a rectangle, and the size of the structural element is a width of the image of the copper foil area;
- the solder joint is composed of two parts of a copper foil and a through hole. Therefore, only the copper foil area and the through hole area are the areas of the solder joint.
- the copper foil region is generally an annular region surrounding the periphery of the through hole region.
- the through-hole area image is first expanded, and the size of the structural element of the expansion process is equivalent to the width of the image of the copper foil area to ensure proper expansion of the image of the through-hole area. Detecting whether each of the copper foil area images and the expanded through hole area image have an intersection one by one.
- the copper foil area image is surrounded by the periphery of the through hole area image, and the copper foil corresponding to the copper foil area image is The copper foil in the solder joint; if not, the copper foil area image does not have a through hole area image, and the copper foil corresponding to the copper foil area image is not a copper foil in the solder joint.
- the first copper foil area image 21, the second copper foil area image 22, the third connected area image 23, and the fourth copper foil area image 24 are inflated one by one. Whether the rear via area image 3 has an intersection. It is detected that the first copper foil area image 21, the third connected area image 23, and the fourth copper foil area image 24 intersect the expanded through hole area image 3, and the first copper foil area image 21 and the third connected area image 23
- the fourth copper foil area image 24 is an area image of the copper foil in the solder joint, and the second copper foil area image 22 is not an area image of the copper foil in the solder joint.
- the extracting the circumscribed pattern of each of the obtained copper foil area images, and positioning the area included in the circumscribed pattern as the area of the solder joint specifically includes:
- the external graphics are rectangular.
- the circumscribed pattern 4 of the first copper foil area image 21, the third connected area image 23, and the fourth copper foil area image 24 is extracted, and all areas included in the external pattern 4 are solder joints. Zone 5, thereby achieving positioning of the solder joints.
- the board is used to locate the solder joints in the board to be inspected.
- the position of the solder joint area in the image of the circuit board is used to quickly extract a partial image of each solder joint in the image of the circuit board to be inspected, thereby performing subsequent defects. Detection.
- the solder joint positioning method provided by the embodiment of the invention can extract all the through hole area image and the copper foil area image in the circuit board image, and expand and process the through hole area image to determine whether it intersects with the copper foil area image.
- the area where the intersecting pattern of the intersecting copper foil area image is determined as the area of the solder joint, thereby realizing the fast and accurate positioning of the solder joint position; when expanding the image of the through hole area, the size of the structural element is set to copper foil
- the width of the area image optimizes the expansion of the image of the through-hole area to accurately locate the location of the solder joint.
- the present invention also provides a solder joint positioning device capable of implementing all the processes of the solder joint positioning method in the above embodiments.
- FIG. 4 it is a schematic structural diagram of an embodiment of a solder joint positioning device provided by the present invention, including:
- An image acquisition module 41 configured to acquire an image of a circuit board under illumination of three primary colors of light RGB;
- the image extraction module 42 is configured to extract a through hole area image and an N copper foil area image in the image of the circuit board; N ⁇ 1;
- the processing module 43 is configured to perform an expansion process on the through-hole area image to obtain an image of a copper foil area intersecting the image of the expanded through-hole area;
- the positioning module 44 is configured to extract the acquired circumscribing image of each copper foil region image, and position the region included in the circumscribed graphic as a region of the solder joint.
- the image extraction module specifically includes:
- a pixel extraction unit configured to respectively extract a red dominant pixel and a preset first color dominant pixel in an image of the circuit board, and use the extracted first color dominant pixel as the through hole area map Any one of the first color except red;
- a dividing unit configured to divide the extracted red dominant pixels, so that the adjacent red dominant pixels form a copper foil area image
- An image extracting unit is configured to extract the image of the N copper foil regions formed.
- the pixel extraction unit specifically includes:
- An RGB value calculation subunit for calculating an RGB value of each pixel in an image of the board
- a first pixel extraction subunit configured to extract the red dominant pixel according to the RGB value of each pixel
- a component value acquiring unit configured to acquire a component value of each of the pixels according to a pre-selected component; the component is a primary color of the three primary colors RGB that is similar in color to the circuit board;
- a second pixel extraction subunit configured to perform threshold segmentation on component values of each pixel to extract the first color dominant pixel.
- the copper foil area image is a ring image
- the processing module specifically includes:
- a processing unit configured to perform an expansion process on the through-hole area image according to a preset structural element;
- the shape of the structural element is a rectangle, and the size of the structural element is a width of the image of the copper foil area;
- a detecting unit configured to detect, by one by one, whether each of the copper foil area images intersects the image of the expanded through hole area
- an acquisition unit configured to acquire an image of the copper foil region intersecting the image of the expanded through hole region when the intersection is detected.
- the positioning module is specifically configured to extract, according to the acquired pixel position in each copper foil area image, an acquired external pattern of each copper foil area image, and locate the area included in the external graphic The area of the solder joint.
- the solder joint positioning device provided by the embodiment of the invention can extract all the through hole area image and the copper foil area image in the circuit board image, and expand and process the through hole area image to determine whether it intersects with the copper foil area image.
- the area where the intersecting pattern of the intersecting copper foil area image is determined as the area of the solder joint, thereby achieving fast and accurate positioning of the solder joint position; when expanding the image of the through hole area,
- the size of the structural element is set to the width of the image of the copper foil area, and the expansion of the image of the through hole area is optimized to accurately locate the position of the solder joint.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
- Electric Connection Of Electric Components To Printed Circuits (AREA)
- Length Measuring Devices By Optical Means (AREA)
- Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
Abstract
一种焊点定位方法,包括:获取三原色光RGB照射下的电路板的图像(1);提取所述电路板的图像(1)中的通孔区域图像(3)和N个铜箔区域图像(21,22,23,24);N≥1;对所述通孔区域图像(3)进行膨胀处理,获取与膨胀后的通孔区域图像(3)相交的铜箔区域图像(21,23,24);提取所获取的每个铜箔区域图像(21,23,24)的外接图形(4),并将所述外接图形(4)所包含的区域定位为焊点的区域(5)。相应地,还公开了一种焊点定位装置。采用上述焊点定位方法和焊点定位装置,能够快速、准确地定位出焊点的位置。
Description
本发明涉及自动光学检查领域,尤其涉及一种焊点定位方法及装置。
自动光学检测(Automatic Optic Inspection,AOI)是工业制作过程的必要环节,利用光学方式取得成品的表面状态,以影像处理来检测异物或表面瑕疵。焊锡缺陷检测是自动光学检测领域中的一种常见应用,机器通过摄像头自动扫描电路板获取图像,自动提取每个焊点的局部图像,并通过图像处理技术,判断焊点处的焊锡是否存在缺陷,最后将疑似缺陷的焊锡显示或标记出来,方便查看与检修。
在对焊点处的焊锡进行检测前,需要制作出标准电路板,并在其上标记出每个焊点的位置。现有技术中,对焊点位置进行标记的方法是根据电路板的设计文件导出每个焊点的位置信息,但是,有时候并不能获取电路板的设计文件,且采用设计文件,会降低其保密性。或者,采用人工设置的方法来标记每个焊点的位置,但是,当电路板上的焊点较多时,人工设置较为耗时。
发明内容
本发明实施例提出一种焊点定位方法及装置,能够快速、准确地定位出焊点的位置。
本发明实施例提供一种焊点定位方法,包括:
获取三原色光RGB照射下的电路板的图像;
提取所述电路板的图像中的通孔区域图像和N个铜箔区域图像;N≥1;
对所述通孔区域图像进行膨胀处理,获取与膨胀后的通孔区域图像相交的铜箔区域图像;
提取所获取的每个铜箔区域图像的外接图形,并将所述外接图形所包含的区域定位为焊点的区域。
进一步地,所述提取所述电路板的图像中的通孔区域图像和N个铜箔区域图像,具体包括:
分别提取所述电路板的图像中的红色主导像素和预设的第一颜色主导像素,并将提取的所述第一颜色主导像素作为所述通孔区域图像;所述第一颜色为红色除外的任一颜色;
对所提取的红色主导像素进行划分,使相邻接的所述红色主导像素组成一个铜箔区域图像;
提取所组成的N个铜箔区域图像。
进一步地,所述分别提取所述电路板的图像中的红色主导像素和预设的第一颜色主导像素,具体包括:
计算所述电路板的图像中每个像素的RGB值;
根据所述每个像素的RGB值,提取所述红色主导像素;
根据预先选取的分量,获取所述每个像素的分量值;所述分量是三原色RGB中与所述电路板颜色相似的一个原色;
对所述每个像素的分量值进行阈值分割,提取所述第一颜色主导像素。
进一步地,所述铜箔区域图像为环形图像;
所述对所述通孔区域图像进行膨胀处理,获取与膨胀后的通孔区域图像相交的铜箔区域图像,具体包括:
根据预设的结构元素,对所述通孔区域图像进行膨胀处理;所述结构元素的形状为矩形,所述结构元素的大小为所述铜箔区域图像的宽度;
逐一检测每个铜箔区域图像是否与膨胀后的通孔区域图像相交;
若相交,则获取与膨胀后的通孔区域图像相交的铜箔区域图像。
进一步地,所述提取所获取的每个铜箔区域图像的外接图形,并将所述外接图形所包含的区域定位为焊点的区域,具体包括:
根据所获取的每个铜箔区域图像中的像素位置,提取所获取的每个铜箔区
域图像的外接图形,并将所述外接图形所包含的区域定位为焊点的区域。
相应地,本发明实施例还提供一种焊点定位装置,包括:
图像获取模块,用于获取三原色光RGB照射下的电路板的图像;
图像提取模块,用于提取所述电路板的图像中的通孔区域图像和N个铜箔区域图像;N≥1;
处理模块,用于对所述通孔区域图像进行膨胀处理,获取与膨胀后的通孔区域图像相交的铜箔区域图像;以及,
定位模块,用于提取所获取的每个铜箔区域图像的外接图形,并将所述外接图形所包含的区域定位为焊点的区域。
进一步地,所述图像提取模块具体包括:
像素提取单元,用于分别提取所述电路板的图像中的红色主导像素和预设的第一颜色主导像素,并将提取的所述第一颜色主导像素作为所述通孔区域图像;所述第一颜色为红色除外的任一颜色;
划分单元,用于对所提取的红色主导像素进行划分,使相邻接的所述红色主导像素组成一个铜箔区域图像;以及,
图像提取单元,用于提取所组成的N个铜箔区域图像。
进一步地,所述像素提取单元具体包括:
RGB值计算子单元,用于计算所述电路板的图像中每个像素的RGB值;
第一像素提取子单元,用于根据所述每个像素的RGB值,提取所述红色主导像素;
分量值获取单元,用于根据预先选取的分量,获取所述每个像素的分量值;所述分量是三原色RGB中与所述电路板颜色相似的一个原色;以及,
第二像素提取子单元,用于对所述每个像素的分量值进行阈值分割,提取所述第一颜色主导像素。
进一步地,所述铜箔区域图像为环形图像;
所述处理模块具体包括:
处理单元,用于根据预设的结构元素,对所述通孔区域图像进行膨胀处理;所述结构元素的形状为矩形,所述结构元素的大小为所述铜箔区域图像的宽度;
检测单元,用于逐一检测每个铜箔区域图像是否与膨胀后的通孔区域图像相交;以及,
获取单元,用于在检测到相交时,获取与膨胀后的通孔区域图像相交的铜箔区域图像。
进一步地,所述定位模块具体用于根据所获取的每个铜箔区域图像中的像素位置,提取所获取的每个铜箔区域图像的外接图形,并将所述外接图形所包含的区域定位为焊点的区域。
实施本发明实施例,具有如下有益效果:
本发明实施例提供的焊点定位方法及装置,能够提取出电路板图像中所有的通孔区域图像和铜箔区域图像,并对通孔区域图像进行膨胀处理,判断其是否与铜箔区域图像相交,将相交的铜箔区域图像外接图形所在区域判定为焊点的区域,从而实现对焊点位置的快速、准确定位。
而且,在对通孔区域图像进行膨胀处理时,将结构元素的大小设置为铜箔区域图像的宽度,优化通孔区域图像的膨胀大小,以准确定位出焊点的位置。
图1是本发明提供的焊点定位方法的一个实施例的流程示意图;
图2是本发明提供的焊点定位方法中电路板的图像的一个示意图;
图3是本发明提供的焊点定位方法中电路板的图像的另一个示意图;
图4是本发明提供的焊点定位装置的一个实施例的结构示意图。
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造
性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
参见图1,是本发明提供的焊点定位方法的一个实施例的流程示意图,包括:
S1、获取三原色光RGB照射下的电路板的图像;
S2、提取所述电路板的图像中的通孔区域图像和N个铜箔区域图像;N≥1;
S3、对所述通孔区域图像进行膨胀处理,获取与膨胀后的通孔区域图像相交的铜箔区域图像;
S4、提取所获取的每个铜箔区域图像的外接图形,并将所述外接图形所包含的区域定位为焊点的区域。
需要说明的是,在检测开始时,采用较为成熟的AOI三原色光RGB(红绿蓝)对电路板进行照射,摄像头自动扫描RGB照射下的电路板,从而获取电路板的彩色图像。根据图像中的颜色,分别提取出所有通孔区域图像和铜箔区域图像。由于焊点是由铜箔和通孔组成,其中,铜箔环绕在其相应通孔的外围,因此,对通孔区域图像进行膨胀处理。若膨胀后的通孔区域图像能够与铜箔区域图像相交,则说明该铜箔区域及其相交的通孔区域为焊点的区域,提取出该铜箔区域图像的外接图形即可实现对焊点区域的定位。
进一步地,所述提取所述电路板的图像中的通孔区域图像和N个铜箔区域图像,具体包括:
分别提取所述电路板的图像中的红色主导像素和预设的第一颜色主导像素,并将提取的所述第一颜色主导像素作为所述通孔区域图像;所述第一颜色为红色除外的任一颜色;
对所提取的红色主导像素进行划分,使相邻接的所述红色主导像素组成一个铜箔区域图像;
提取所组成的N个铜箔区域图像。
其中,所述分别提取所述电路板的图像中的红色主导像素和预设的第一颜色主导像素,具体包括:
计算所述电路板的图像中每个像素的RGB值;
根据所述每个像素的RGB值,提取所述红色主导像素;
根据预先选取的分量,获取所述每个像素的分量值;所述分量是三原色RGB中与所述电路板颜色相似的一个原色;
对所述每个像素的分量值进行阈值分割,提取所述第一颜色主导像素。
需要说明的是,在三原色光RGB照射下的电路板,铜箔区域成像后的颜色为红色,通孔区域成像后的颜色为第一颜色。其中,第一颜色根据电路板上通孔颜色的不同而不同,一般为黑色。
如图2所示,假设P表示电路板的图像1,PR(x,y),PG(x,y),PB(x,y)分别表示像素(x,y)的R、G、B分量值,计算出红色主导区域,其计算公式如下:
其中,MR为红色R的主导区域,TR为一个预设的较小的阈值。提取区域MR的像素即可获得红色主导像素。
在对所提取的红色主导像素进行划分时,采用4连通或8连通的方法使所提取的红色主导像素划分为N个连通区域图像,一个连通区域图像即为一个铜箔区域图像。同一个铜箔区域图像采用相同的数值进行标记,如第j个铜箔区域图像内所有像素均标记为j,j≥1。
如图2所示,对红色主导像素划分为4个铜箔区域图像,并对每个铜箔区域图像进行标记,获得第一铜箔区域图像21、第二铜箔区域图像22、第三连通区域图像23和第四铜箔区域图像24。
根据电路板的底色来选取与该底色最为相似的分量,再根据选取的分量来提取通孔区域图像。一般电路板的底色为绿色,针对以绿色为底色的电路板,在绿色分量上提取黑色的通孔区域图像更加有效,则选取绿色分量,获取每个像素的G值,再根据每个像素的G值,采用阈值化技术进行提取通孔区域图像,其计算公式如下:
其中,MH为黑色主导区域,TH为预设的阈值。提取区域MH的像素即可获
得黑色主导像素,即通孔区域图像3。
进一步地,所述铜箔区域图像为环形图像;
所述对所述通孔区域图像进行膨胀处理,获取与膨胀后的通孔区域图像相交的铜箔区域图像,具体包括:
根据预设的结构元素,对所述通孔区域图像进行膨胀处理;所述结构元素的形状为矩形,所述结构元素的大小为所述铜箔区域图像的宽度;
逐一检测每个铜箔区域图像是否与膨胀后的通孔区域图像相交;
若相交,则获取与膨胀后的通孔区域图像相交的铜箔区域图像。
需要说明的是,焊点是由铜箔和通孔两部分组成的,因此,只有同时拥有铜箔区域和通孔区域才为焊点的区域。其中,铜箔区域一般为环绕在通孔区域外围的环形区域。先对通孔区域图像进行膨胀处理,其膨胀处理的结构元素的大小与铜箔区域图像的宽度相当,以保证通孔区域图像的适当膨胀。逐一检测每个铜箔区域图像与膨胀后的通孔区域图像是否具有交集,若具有,则说明该铜箔区域图像环绕在通孔区域图像的外围,该铜箔区域图像所对应的铜箔为焊点中的铜箔;若不具有,则说明该铜箔区域图像内部不具有通孔区域图像,该铜箔区域图像所对应的铜箔不为焊点中的铜箔。
如图2所示,对通孔区域图像3膨胀处理后,逐一检测第一铜箔区域图像21、第二铜箔区域图像22、第三连通区域图像23和第四铜箔区域图像24与膨胀后的通孔区域图像3是否有交集。检测出第一铜箔区域图像21、第三连通区域图像23和第四铜箔区域图像24与膨胀后的通孔区域图像3相交,则第一铜箔区域图像21、第三连通区域图像23和第四铜箔区域图像24均为焊点中铜箔的区域图像,而第二铜箔区域图像22不为焊点中铜箔的区域图像。
进一步地,所述提取所获取的每个铜箔区域图像的外接图形,并将所述外接图形所包含的区域定位为焊点的区域,具体包括:
根据所获取的每个铜箔区域图像中的像素位置,提取所获取的每个铜箔区域图像的外接图形,并将所述外接图形所包含的区域定位为焊点的区域。
在获取焊点中铜箔的区域图像后,根据该铜箔区域图像中的像素位置,提
取其外接图形,一般外接图形为矩形。如图3所示,对第一铜箔区域图像21、第三连通区域图像23和第四铜箔区域图像24的外接图形4进行提取,该外接图形4所包含的所有区域即为焊点的区域5,从而实现对焊点的定位。在定位出电路板中的焊点后,采用该电路板来定位出待检测电路板中的焊点。将该电路板的图像与待检测电路板的图像对齐后,利用该电路板的图像中的焊点区域位置快速提取出待检测电路板图像中每个焊点的局部图像,进而进行后续的缺陷检测。
本发明实施例提供的焊点定位方法,能够提取出电路板图像中所有的通孔区域图像和铜箔区域图像,并对通孔区域图像进行膨胀处理,判断其是否与铜箔区域图像相交,将相交的铜箔区域图像外接图形所在区域判定为焊点的区域,从而实现对焊点位置的快速、准确定位;在对通孔区域图像进行膨胀处理时,将结构元素的大小设置为铜箔区域图像的宽度,优化通孔区域图像的膨胀大小,以准确定位出焊点的位置。
相应的,本发明还提供一种焊点定位装置,能够实现上述实施例中的焊点定位方法的所有流程。
参见图4,是本发明提供的焊点定位装置的一个实施例的结构示意图,包括:
图像获取模块41,用于获取三原色光RGB照射下的电路板的图像;
图像提取模块42,用于提取所述电路板的图像中的通孔区域图像和N个铜箔区域图像;N≥1;
处理模块43,用于对所述通孔区域图像进行膨胀处理,获取与膨胀后的通孔区域图像相交的铜箔区域图像;以及,
定位模块44,用于提取所获取的每个铜箔区域图像的外接图形,并将所述外接图形所包含的区域定位为焊点的区域。
进一步地,所述图像提取模块具体包括:
像素提取单元,用于分别提取所述电路板的图像中的红色主导像素和预设的第一颜色主导像素,并将提取的所述第一颜色主导像素作为所述通孔区域图
像;所述第一颜色为红色除外的任一颜色;
划分单元,用于对所提取的红色主导像素进行划分,使相邻接的所述红色主导像素组成一个铜箔区域图像;以及,
图像提取单元,用于提取所组成的N个铜箔区域图像。
进一步地,所述像素提取单元具体包括:
RGB值计算子单元,用于计算所述电路板的图像中每个像素的RGB值;
第一像素提取子单元,用于根据所述每个像素的RGB值,提取所述红色主导像素;
分量值获取单元,用于根据预先选取的分量,获取所述每个像素的分量值;所述分量是三原色RGB中与所述电路板颜色相似的一个原色;以及,
第二像素提取子单元,用于对所述每个像素的分量值进行阈值分割,提取所述第一颜色主导像素。
进一步地,所述铜箔区域图像为环形图像;
所述处理模块具体包括:
处理单元,用于根据预设的结构元素,对所述通孔区域图像进行膨胀处理;所述结构元素的形状为矩形,所述结构元素的大小为所述铜箔区域图像的宽度;
检测单元,用于逐一检测每个铜箔区域图像是否与膨胀后的通孔区域图像相交;以及,
获取单元,用于在检测到相交时,获取与膨胀后的通孔区域图像相交的铜箔区域图像。
进一步地,所述定位模块具体用于根据所获取的每个铜箔区域图像中的像素位置,提取所获取的每个铜箔区域图像的外接图形,并将所述外接图形所包含的区域定位为焊点的区域。
本发明实施例提供的焊点定位装置,能够提取出电路板图像中所有的通孔区域图像和铜箔区域图像,并对通孔区域图像进行膨胀处理,判断其是否与铜箔区域图像相交,将相交的铜箔区域图像外接图形所在区域判定为焊点的区域,从而实现对焊点位置的快速、准确定位;在对通孔区域图像进行膨胀处理时,
将结构元素的大小设置为铜箔区域图像的宽度,优化通孔区域图像的膨胀大小,以准确定位出焊点的位置。
以上所述是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也视为本发明的保护范围。
Claims (10)
- 一种焊点定位方法,其特征在于,包括:获取三原色光RGB照射下的电路板的图像;提取所述电路板的图像中的通孔区域图像和N个铜箔区域图像;N≥1;对所述通孔区域图像进行膨胀处理,获取与膨胀后的通孔区域图像相交的铜箔区域图像;提取所获取的每个铜箔区域图像的外接图形,并将所述外接图形所包含的区域定位为焊点的区域。
- 如权利要求1所述的焊点定位方法,其特征在于,所述提取所述电路板的图像中的通孔区域图像和N个铜箔区域图像,具体包括:分别提取所述电路板的图像中的红色主导像素和预设的第一颜色主导像素,并将提取的所述第一颜色主导像素作为所述通孔区域图像;所述第一颜色为红色除外的任一颜色;对所提取的红色主导像素进行划分,使相邻接的所述红色主导像素组成一个铜箔区域图像;提取所组成的N个铜箔区域图像。
- 如权利要求2所述的焊点定位方法,其特征在于,所述分别提取所述电路板的图像中的红色主导像素和预设的第一颜色主导像素,具体包括:计算所述电路板的图像中每个像素的RGB值;根据所述每个像素的RGB值,提取所述红色主导像素;根据预先选取的分量,获取所述每个像素的分量值;所述分量是三原色RGB中与所述电路板底色相似的一个原色;对所述每个像素的分量值进行阈值分割,提取所述第一颜色主导像素。
- 如权利要求1所述的焊点定位方法,其特征在于,所述铜箔区域图像为 环形图像;所述对所述通孔区域图像进行膨胀处理,获取与膨胀后的通孔区域图像相交的铜箔区域图像,具体包括:根据预设的结构元素,对所述通孔区域图像进行膨胀处理;所述结构元素的形状为矩形,所述结构元素的大小为所述铜箔区域图像的宽度;逐一检测每个铜箔区域图像是否与膨胀后的通孔区域图像相交;若相交,则获取与膨胀后的通孔区域图像相交的铜箔区域图像。
- 如权利要求1所述的焊点定位方法,其特征在于,所述提取所获取的每个铜箔区域图像的外接图形,并将所述外接图形所包含的区域定位为焊点的区域,具体包括:根据所获取的每个铜箔区域图像中的像素位置,提取所获取的每个铜箔区域图像的外接图形,并将所述外接图形所包含的区域定位为焊点的区域。
- 一种焊点定位装置,其特征在于,包括:图像获取模块,用于获取三原色光RGB照射下的电路板的图像;图像提取模块,用于提取所述电路板的图像中的通孔区域图像和N个铜箔区域图像;N≥1;处理模块,用于对所述通孔区域图像进行膨胀处理,获取与膨胀后的通孔区域图像相交的铜箔区域图像;以及,定位模块,用于提取所获取的每个铜箔区域图像的外接图形,并将所述外接图形所包含的区域定位为焊点的区域。
- 如权利要求6所述的焊点定位装置,其特征在于,所述图像提取模块具体包括:像素提取单元,用于分别提取所述电路板的图像中的红色主导像素和预设的第一颜色主导像素,并将提取的所述第一颜色主导像素作为所述通孔区域图 像;所述第一颜色为红色除外的任一颜色;划分单元,用于对所提取的红色主导像素进行划分,使相邻接的所述红色主导像素组成一个铜箔区域图像;以及,图像提取单元,用于提取所组成的N个铜箔区域图像。
- 如权利要求7所述的焊点定位装置,其特征在于,所述像素提取单元具体包括:RGB值计算子单元,用于计算所述电路板的图像中每个像素的RGB值;第一像素提取子单元,用于根据所述每个像素的RGB值,提取所述红色主导像素;分量值获取单元,用于根据预先选取的分量,获取所述每个像素的分量值;所述分量是三原色RGB中与所述电路板颜色相似的一个原色;以及,第二像素提取子单元,用于对所述每个像素的分量值进行阈值分割,提取所述第一颜色主导像素。
- 如权利要求6所述的焊点定位装置,其特征在于,所述铜箔区域图像为环形图像;所述处理模块具体包括:处理单元,用于根据预设的结构元素,对所述通孔区域图像进行膨胀处理;所述结构元素的形状为矩形,所述结构元素的大小为所述铜箔区域图像的宽度;检测单元,用于逐一检测每个铜箔区域图像是否与膨胀后的通孔区域图像相交;以及,获取单元,用于在检测到相交时,获取与膨胀后的通孔区域图像相交的铜箔区域图像。
- 如权利要求6所述的焊点定位装置,其特征在于,所述定位模块具体用于根据所获取的每个铜箔区域图像中的像素位置,提取所获取的每个铜箔区 域图像的外接图形,并将所述外接图形所包含的区域定位为焊点的区域。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510679963.3 | 2015-10-19 | ||
| CN201510679963.3A CN105279757B (zh) | 2015-10-19 | 2015-10-19 | 一种焊点定位方法及装置 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2017067320A1 true WO2017067320A1 (zh) | 2017-04-27 |
Family
ID=55148709
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2016/096750 Ceased WO2017067320A1 (zh) | 2015-10-19 | 2016-08-25 | 一种焊点定位方法及装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN105279757B (zh) |
| WO (1) | WO2017067320A1 (zh) |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105279757B (zh) * | 2015-10-19 | 2018-10-16 | 广州视源电子科技股份有限公司 | 一种焊点定位方法及装置 |
| CN106780426B (zh) * | 2016-09-21 | 2023-05-23 | 南京师范大学 | 一种基于色彩特征模型的集成电路板多形态焊点定位方法 |
| CN106971391A (zh) * | 2017-02-24 | 2017-07-21 | 北京理工大学珠海学院 | 一种基于颜色识别的多模板定位浸锡检测方法 |
| CN107657588B (zh) * | 2017-09-25 | 2019-08-06 | 电子科技大学 | 用于bga焊点的x射线图像的校正方法 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5027417A (en) * | 1989-03-31 | 1991-06-25 | Dainippon Screen Mfg. Co., Ltd. | Method of and apparatus for inspecting conductive pattern on printed board |
| JPH04184244A (ja) * | 1990-11-19 | 1992-07-01 | Dainippon Screen Mfg Co Ltd | プリント基板のパターン検査方法 |
| CN101358836A (zh) * | 2008-09-28 | 2009-02-04 | 西安理工大学 | 基于计算机视觉识别焊点中心位置的方法 |
| CN102301225A (zh) * | 2009-01-31 | 2011-12-28 | 玛机统丽公司 | 通孔检查装置 |
| CN105279757A (zh) * | 2015-10-19 | 2016-01-27 | 广州视源电子科技股份有限公司 | 一种焊点定位方法及装置 |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP4841819B2 (ja) * | 2004-09-09 | 2011-12-21 | 大日本スクリーン製造株式会社 | 物体のカラー画像による欠陥検出 |
-
2015
- 2015-10-19 CN CN201510679963.3A patent/CN105279757B/zh active Active
-
2016
- 2016-08-25 WO PCT/CN2016/096750 patent/WO2017067320A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5027417A (en) * | 1989-03-31 | 1991-06-25 | Dainippon Screen Mfg. Co., Ltd. | Method of and apparatus for inspecting conductive pattern on printed board |
| JPH04184244A (ja) * | 1990-11-19 | 1992-07-01 | Dainippon Screen Mfg Co Ltd | プリント基板のパターン検査方法 |
| CN101358836A (zh) * | 2008-09-28 | 2009-02-04 | 西安理工大学 | 基于计算机视觉识别焊点中心位置的方法 |
| CN102301225A (zh) * | 2009-01-31 | 2011-12-28 | 玛机统丽公司 | 通孔检查装置 |
| CN105279757A (zh) * | 2015-10-19 | 2016-01-27 | 广州视源电子科技股份有限公司 | 一种焊点定位方法及装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN105279757A (zh) | 2016-01-27 |
| CN105279757B (zh) | 2018-10-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN108760767B (zh) | 基于机器视觉的大尺寸液晶屏缺陷检测方法 | |
| TWI787296B (zh) | 光學檢測方法、光學檢測裝置及光學檢測系統 | |
| CN104335030B (zh) | 基板的异物检测方法 | |
| CN110261410A (zh) | 一种玻璃透镜缺陷的检测装置及方法 | |
| CN105352437B (zh) | 板卡位置检测方法及装置 | |
| WO2017067320A1 (zh) | 一种焊点定位方法及装置 | |
| TWI442194B (zh) | Alignment mark detection method | |
| CN105976354A (zh) | 基于颜色和梯度的元件定位方法和系统 | |
| WO2017181724A1 (zh) | 电子元件漏件检测方法和系统 | |
| CN108844961A (zh) | 一种温控器壳体视觉检测系统及方法 | |
| CN108510476A (zh) | 一种基于机器视觉的手机屏线路检测方法 | |
| CN104764752B (zh) | 一种焊点连锡检测方法及设备 | |
| CN105303573B (zh) | 金针类元件的引脚检测方法和系统 | |
| CN104867145B (zh) | 基于vibe模型的ic元件焊点缺陷检测方法 | |
| CN108827979A (zh) | 一种模组镜头外观检测方法 | |
| CN108709500A (zh) | 一种电路板元件定位匹配方法 | |
| CN105404900B (zh) | 一种并排二极管的定位方法及装置 | |
| CN105184739A (zh) | 印刷线路板aoi检测的图像拼接方法 | |
| WO2018068414A1 (zh) | 色环电阻的检测方法、装置和自动光学检测系统 | |
| KR20050022320A (ko) | 결함 검사 방법 및 장치 | |
| CN105092604B (zh) | 线路信息及非线路区信息撷取方法、线路缺陷检测方法 | |
| CN105092589A (zh) | 一种胶囊头缺陷检测方法 | |
| TWI530913B (zh) | 移動物體偵測系統及方法 | |
| CN103544715B (zh) | 一种印刷电路板金相切片彩色图像的分割方法 | |
| JP2006145228A (ja) | ムラ欠陥検出方法及び装置 |
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: 16856754 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: 16856754 Country of ref document: EP Kind code of ref document: A1 |

