[go: up one dir, main page]

CN115266762A - Tin ball defect detection device and method, electronic device and storage medium - Google Patents

Tin ball defect detection device and method, electronic device and storage medium Download PDF

Info

Publication number
CN115266762A
CN115266762A CN202110481976.5A CN202110481976A CN115266762A CN 115266762 A CN115266762 A CN 115266762A CN 202110481976 A CN202110481976 A CN 202110481976A CN 115266762 A CN115266762 A CN 115266762A
Authority
CN
China
Prior art keywords
light source
light
image
detected
solder ball
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110481976.5A
Other languages
Chinese (zh)
Inventor
张俊阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongshan Longsys Electronics Co ltd
Original Assignee
Zhongshan Longsys Electronics Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongshan Longsys Electronics Co ltd filed Critical Zhongshan Longsys Electronics Co ltd
Priority to CN202110481976.5A priority Critical patent/CN115266762A/en
Publication of CN115266762A publication Critical patent/CN115266762A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/95Investigating the presence of flaws or contamination characterised by the material or shape of the object to be examined
    • G01N21/954Inspecting the inner surface of hollow bodies, e.g. bores
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/01Arrangements or apparatus for facilitating the optical investigation
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/01Arrangements or apparatus for facilitating the optical investigation
    • G01N2021/0106General arrangement of respective parts
    • G01N2021/0112Apparatus in one mechanical, optical or electronic block

Landscapes

  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The application relates to the technical field of solder ball detection, and discloses a solder ball defect detection device, a solder ball defect detection method, electronic equipment and a storage medium. The tin ball defect detection device comprises a light source assembly, an image acquisition assembly and a processor, wherein the light source assembly comprises a first light source and a second light source, the first light source is used for generating first color light, the second light source is used for generating second color light, the colors of the first color light and the second color light are different, and the first color light and the second color light are used for irradiating a to-be-detected tin soldering piece; the image acquisition assembly is used for acquiring an image to be detected when the soldering tin piece to be detected is irradiated by the first color light and the second color light; the processor is connected with the image acquisition assembly and used for receiving the image to be detected and carrying out image recognition analysis on the image to be detected so as to carry out defect detection on the soldering tin piece to be detected. By the method, the accuracy and the detection efficiency of detecting the defects of the solder balls can be improved.

Description

锡球缺陷检测装置、方法、电子设备及存储介质Solder ball defect detection device, method, electronic equipment and storage medium

技术领域technical field

本申请涉及锡球检测技术领域,特别是涉及锡球缺陷检测装置、方法、电子设备及存储介质。The present application relates to the technical field of solder ball detection, in particular to a solder ball defect detection device, method, electronic equipment and storage medium.

背景技术Background technique

在电子产品生产中,缺陷检测环节对于保证产品质量的可靠性至关重要。其中,印刷电路板(PCB)是电子产品运转的基础,其上的锡球起到连接和导电的作用,因而要求其不能有较明显的形状缺陷以免影响系统性能。In the production of electronic products, the defect detection link is very important to ensure the reliability of product quality. Among them, the printed circuit board (PCB) is the basis for the operation of electronic products, and the solder balls on it play the role of connection and conduction, so it is required that it should not have obvious shape defects so as not to affect the system performance.

相关技术中采用人工识别的方式,但是此种方式效率低下。A manual identification method is adopted in the related art, but this method is inefficient.

发明内容Contents of the invention

本申请主要解决的技术问题是提供锡球缺陷检测装置、方法、电子设备及存储介质,能够提升对锡球缺陷检测的准确性以及检测效率。The technical problem mainly solved by this application is to provide a solder ball defect detection device, method, electronic equipment and storage medium, which can improve the accuracy and detection efficiency of solder ball defect detection.

为了解决上述问题,本申请采用的一种技术方案是提供一种锡球缺陷检测装置,该锡球缺陷检测装置包括:光源组件,包括第一光源和第二光源,第一光源用于产生第一颜色光,第二光源用于产生第二颜色光,第一颜色光和第二颜色光的颜色不同,第一颜色光和第二颜色光用于照射待检测焊锡件;图像采集组件,用于采集待检测焊锡件被第一颜色光和第二颜色光照射时的待检测图像;处理器,与图像采集组件连接,用于接收待检测图像,并对待检测图像进行图像识别分析,以对待检测焊锡件进行缺陷检测。In order to solve the above problems, a technical solution adopted by this application is to provide a solder ball defect detection device, the solder ball defect detection device includes: a light source assembly, including a first light source and a second light source, the first light source is used to generate the first One color light, the second light source is used to generate the second color light, the color of the first color light and the second color light are different, the first color light and the second color light are used to irradiate the solder piece to be detected; the image acquisition component uses To collect the image to be inspected when the solder piece to be inspected is irradiated by the first color light and the second color light; the processor is connected to the image acquisition component for receiving the image to be inspected, and performing image recognition and analysis on the image to be inspected, to treat Detect solder parts for defect detection.

其中,光源组件上设有光通道,图像采集组件设置于光源组件远离待检测焊锡件的一侧,光源组件产生的光经由待检测焊锡件反射后通过光通道进入图像采集组件。Wherein, the light source assembly is provided with an optical channel, and the image acquisition assembly is arranged on the side of the light source assembly away from the solder piece to be inspected. The light generated by the light source assembly is reflected by the solder object to be inspected and then enters the image acquisition assembly through the optical channel.

其中,第一光源上设有第一通孔,第二光源上设有第二通孔,第一光源和第二光源层叠设置,以使第一通孔和第二通孔连通形成光通道;第一通孔的孔径小于第二通孔的孔径。Wherein, the first light source is provided with a first through hole, the second light source is provided with a second through hole, and the first light source and the second light source are stacked so that the first through hole and the second through hole are connected to form an optical channel; The diameter of the first through hole is smaller than the diameter of the second through hole.

其中,第一光源上设有第一通孔,第二光源上设有第二通孔,第二光源设置于第一通孔内,以使第二通孔形成光通道。Wherein, the first light source is provided with a first through hole, the second light source is provided with a second through hole, and the second light source is arranged in the first through hole so that the second through hole forms a light channel.

其中,第一光源包括多个第一子光源,多个第一子光源呈环形设置以在多个第一子光源中形成第一通孔;第二光源包括多个第二子光源,多个第二子光源呈环形设置以在多个第二子光源中形成第二通孔。Wherein, the first light source includes a plurality of first sub-light sources, and the plurality of first sub-light sources are arranged in a ring to form a first through hole in the plurality of first sub-light sources; the second light source includes a plurality of second sub-light sources, and a plurality of The second sub-light sources are arranged in a ring shape to form second through holes in the plurality of second sub-light sources.

其中,锡球缺陷检测装置还包括支撑架,光源组件和图像采集组件设置于支撑架上。Wherein, the solder ball defect detection device further includes a support frame, and the light source component and the image acquisition component are arranged on the support frame.

其中,支撑架包括第一支撑件和第二支撑件;光源组件设置于第一支撑件上,图像采集组件设置于第二支撑件上;第二支撑件设置于光源组件远离待检测焊锡件的一侧。Wherein, the support frame includes a first support member and a second support member; the light source assembly is arranged on the first support member, and the image acquisition assembly is arranged on the second support member; side.

其中,第一颜色光为单色光,第二颜色光为复色光或单色光。Wherein, the first color light is monochromatic light, and the second color light is polychromatic light or monochromatic light.

其中,第一颜色光为红光,第二颜色光为白光。Wherein, the first color light is red light, and the second color light is white light.

为了解决上述问题,本申请采用的另一种技术方案是提供一种锡球缺陷检测方法,该方法包括:获取待检测图像;利用缺陷检测模型对待检测图像进行检测,得到待检测图像中对应缺陷的检测信息,其中,缺陷检测模型采用训练图像训练得到,其中,待检测图像和训练图像是利用如上述技术方案提供的锡球缺陷检测装置中的图像采集组件在待检测焊锡件被两种不同颜色光照射时采集得到。In order to solve the above problems, another technical solution adopted by this application is to provide a solder ball defect detection method, which includes: obtaining an image to be detected; using a defect detection model to detect the image to be detected, and obtaining the corresponding defect in the image to be detected The detection information, wherein, the defect detection model is obtained by training the training image, wherein the image to be detected and the training image are obtained by using the image acquisition component in the solder ball defect detection device provided by the above technical solution when the solder piece to be detected is divided into two different Acquired when illuminated by colored light.

为了解决上述问题,本申请采用的另一种技术方案是提供一种电子设备,该电子设备包括控制器和控制器连接的存储器;其中,存储器用于存储程序数据,控制器用于执行程序数据,以实现如上述技术方案提供的方法。In order to solve the above problems, another technical solution adopted by the present application is to provide an electronic device, the electronic device includes a controller and a memory connected to the controller; wherein, the memory is used to store program data, and the controller is used to execute the program data, To realize the method provided by the above technical solution.

为了解决上述问题,本申请采用的另一种技术方案是提供一种计算机可读存储介质,该计算机可读存储介质用于存储程序数据,程序数据在被处理器执行时,用于实现如上述技术方案提供的方法。In order to solve the above problems, another technical solution adopted by this application is to provide a computer-readable storage medium, which is used to store program data. When the program data is executed by the processor, it is used to realize the above-mentioned The method provided by the technical solution.

本申请的有益效果是:区别于现有技术的情况,本申请的一种锡球缺陷检测装置,该锡球缺陷检测装置包括:光源组件,包括第一光源和第二光源,第一光源用于产生第一颜色光,第二光源用于产生第二颜色光,第一颜色光和第二颜色光的颜色不同,第一颜色光和第二颜色光用于照射待检测焊锡件;图像采集组件,用于采集待检测焊锡件被第一颜色光和第二颜色光照射时的待检测图像;处理器,与图像采集组件连接,用于接收待检测图像,并对待检测图像进行图像识别分析,以对待检测焊锡件进行缺陷检测。通过上述方式,利用两种不同的颜色光照射待检测焊锡件,使待检测焊锡件上的半球型锡球在照射时采集的图像存在明显的颜色差异,能够让存在缺陷的锡球更加突出,进而提升对锡球缺陷检测的准确性,以及提高对锡球缺陷检测的检测效率。The beneficial effects of the present application are: different from the situation of the prior art, a solder ball defect detection device of the present application, the solder ball defect detection device includes: a light source assembly, including a first light source and a second light source, the first light source is used For generating the first color light, the second light source is used for generating the second color light, the colors of the first color light and the second color light are different, and the first color light and the second color light are used to irradiate the solder piece to be inspected; image acquisition The component is used to collect the image to be detected when the solder piece to be detected is irradiated by the first color light and the second color light; the processor is connected to the image acquisition component and is used to receive the image to be detected and perform image recognition and analysis on the image to be detected , so as to detect the defects of the solder parts to be tested. Through the above method, two different colors of light are used to irradiate the solder parts to be inspected, so that the images collected by the hemispherical solder balls on the solder parts to be inspected have obvious color differences, which can make the solder balls with defects more prominent. Further, the accuracy of the detection of the solder ball defect is improved, and the detection efficiency of the detection of the solder ball defect is improved.

附图说明Description of drawings

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。其中:In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained based on these drawings without creative effort. in:

图1是本申请提供的锡球缺陷检测装置一实施例的结构示意图;FIG. 1 is a schematic structural view of an embodiment of a solder ball defect detection device provided by the present application;

图2是本申请提供的第一光源一实施例的结构示意图;Fig. 2 is a schematic structural view of an embodiment of the first light source provided by the present application;

图3是本申请提供的第一光源和第二光源一实施例的结构示意图;Fig. 3 is a schematic structural diagram of an embodiment of the first light source and the second light source provided by the present application;

图4是本申请提供的光源组件和图像采集组件的一实施例的结构示意图;Fig. 4 is a schematic structural diagram of an embodiment of a light source assembly and an image acquisition assembly provided by the present application;

图5是本申请提供的光源组件和图像采集组件的另一实施例的结构示意图;Fig. 5 is a schematic structural diagram of another embodiment of a light source assembly and an image acquisition assembly provided by the present application;

图6是本申请提供的光源组件和图像采集组件的另一实施例的结构示意图;Fig. 6 is a schematic structural diagram of another embodiment of a light source assembly and an image acquisition assembly provided by the present application;

图7是本申请提供的锡球缺陷检测装置另一实施例的结构示意图;FIG. 7 is a schematic structural view of another embodiment of the solder ball defect detection device provided by the present application;

图8是本申请提供的光源组件、图像采集组件和支撑件一实施例的结构示意图;Fig. 8 is a schematic structural view of an embodiment of a light source assembly, an image acquisition assembly and a support provided by the present application;

图9是本申请提供的光源组件另一实施例的结构示意图;Fig. 9 is a schematic structural diagram of another embodiment of the light source assembly provided by the present application;

图10是本申请提供的待检测图像进行缺陷检测后的示意图;Fig. 10 is a schematic diagram of the image to be detected provided by the present application after defect detection;

图11是本申请提供的锡球缺陷检测方法一实施例的流程示意图;FIG. 11 is a schematic flow chart of an embodiment of a solder ball defect detection method provided by the present application;

图12是本申请提供的电子设备一实施例的结构示意图;FIG. 12 is a schematic structural diagram of an embodiment of an electronic device provided by the present application;

图13是本申请提供的计算机可读存储介质一实施例的结构示意图。Fig. 13 is a schematic structural diagram of an embodiment of a computer-readable storage medium provided by the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。可以理解的是,此处所描述的具体实施例仅用于解释本申请,而非对本申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分而非全部结构。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the specific embodiments described here are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only some structures related to the present application are shown in the drawings but not all structures. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.

本申请中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", etc. in this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "include" and "have", as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes unlisted steps or units, or optionally further includes For other steps or units inherent in these processes, methods, products or apparatuses.

在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The occurrences of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is understood explicitly and implicitly by those skilled in the art that the embodiments described herein can be combined with other embodiments.

焊锡件可以是由电路板和电子元器件组成。其中,电子元器件通过焊锡的方式固定于电路板上。如焊锡件可以是芯片。但是焊锡时存在锡球缺陷,而锡球缺陷会导致后续焊锡件故障会不良,影响性能。因此需要对焊锡件进行锡球缺陷检测。Solder parts can be composed of circuit boards and electronic components. Wherein, the electronic components are fixed on the circuit board by soldering. For example, the solder part can be a chip. However, there are solder ball defects during soldering, and the solder ball defects will cause subsequent solder parts to fail and affect performance. Therefore, it is necessary to detect solder ball defects on solder parts.

相关技术中使用人工的方式进行锡球缺陷检测,基于此,本提供以下实施例进行锡球缺陷检测,以提高检测效率。In the related art, a manual method is used to detect solder ball defects. Based on this, the following embodiments are provided to detect solder ball defects, so as to improve detection efficiency.

参阅图1,图1是本申请提供的锡球缺陷检测装置一实施例的结构示意图。该锡球缺陷检测装置100包括光源组件(图未示)、图像采集组件20和处理器30。Referring to FIG. 1 , FIG. 1 is a schematic structural diagram of an embodiment of a solder ball defect detection device provided in the present application. The solder ball defect detection device 100 includes a light source assembly (not shown), an image acquisition assembly 20 and a processor 30 .

其中,光源组件包括第一光源和第二光源,第一光源用于产生第一颜色光。第二光源用于产生第二颜色光。Wherein, the light source assembly includes a first light source and a second light source, and the first light source is used to generate light of the first color. The second light source is used to generate light of the second color.

其中,第一颜色光和第二颜色光的颜色不同,第一颜色光和第二颜色光用于照射待检测焊锡件。如,第一颜色光为红色,第二颜色光为白色。又如,第一颜色光为蓝色,第二颜色光为白色。具体地,可以根据待检测焊锡件的颜色来对应设置第一光源和第二光源产生的颜色光。如,焊锡件的基板的表面呈黑色,则第一颜色光为红色,第二颜色光为白色。Wherein, the first color light and the second color light have different colors, and the first color light and the second color light are used to irradiate the solder piece to be inspected. For example, the first color light is red, and the second color light is white. In another example, the first color light is blue, and the second color light is white. Specifically, the color light generated by the first light source and the second light source can be correspondingly set according to the color of the solder piece to be detected. For example, if the surface of the substrate of the solder piece is black, the first color light is red, and the second color light is white.

在一些实施例中,第一光源和第二光源可以产生多种颜色光,用于可根据需要选择对应的颜色光。在一应用场景中,参阅图2,第一光源11包括多个灯珠111。部分灯珠111可以发出同一颜色光,其余部分灯珠111可以发出另一种同一颜色光。可根据待检测焊锡件中基板的颜色来选择对应的灯珠111发出第一颜色光。可以理解,第二光源也与第一光源具有类似的结构,这里不做赘述。In some embodiments, the first light source and the second light source can generate multiple colors of light, so that the corresponding color light can be selected as required. In an application scenario, referring to FIG. 2 , the first light source 11 includes a plurality of lamp beads 111 . Part of the lamp beads 111 can emit light of the same color, and the rest of the lamp beads 111 can emit light of another same color. The corresponding lamp bead 111 can be selected to emit light of the first color according to the color of the substrate in the solder piece to be detected. It can be understood that the second light source also has a structure similar to that of the first light source, which will not be repeated here.

在其他实施例中,第一光源和第二光源可以设置于同一基座上。如图3所示,第一光源11包括多个灯珠111。第二光源12包括多个灯珠121。其中,第一光源11和第二光源12可以根据不同灯珠而产生多种颜色光。In other embodiments, the first light source and the second light source can be disposed on the same base. As shown in FIG. 3 , the first light source 11 includes a plurality of lamp beads 111 . The second light source 12 includes a plurality of lamp beads 121 . Wherein, the first light source 11 and the second light source 12 can generate light of various colors according to different lamp beads.

图像采集组件20用于采集待检测焊锡件被第一颜色光和第二颜色光照射时的待检测图像。The image acquisition component 20 is used to acquire the image to be inspected when the solder piece to be inspected is irradiated by the first color light and the second color light.

在一些实施例中,图像采集组件20可以采用微距摄像头,以此对待检测焊锡件上的锡球进行一定程度的放大,使得待检测图像更加清晰。In some embodiments, the image acquisition component 20 may adopt a macro camera, so as to enlarge the solder ball on the solder piece to be inspected to a certain extent, so that the image to be inspected is clearer.

可以理解,当待检测焊锡件由于生产工艺的提升,单位面积的待检测焊锡件上可焊接电子元器件越多,则对应的锡球数量越多,则利用微距摄像头进行图像采集,能够对采集的图像进行放大。It can be understood that due to the improvement of the production process of the solder parts to be inspected, the more electronic components that can be welded on the solder parts to be inspected per unit area, the more corresponding solder balls, and the use of macro cameras for image collection can Acquired images are enlarged.

处理器30与图像采集组件20连接,用于接收待检测图像,并对待检测图像进行图像识别分析,以对待检测焊锡件进行缺陷检测。其中,在一些实施例中,处理器30可以和图像采集组件20一体设置。在另一些实施例中,处理器30可以和图像采集组件20通过数据线的方式连接或者无线通讯连接。The processor 30 is connected with the image acquisition component 20, and is used for receiving the image to be inspected, and performing image recognition and analysis on the image to be inspected, so as to perform defect detection on the solder piece to be inspected. Wherein, in some embodiments, the processor 30 may be integrated with the image acquisition component 20 . In some other embodiments, the processor 30 may be connected with the image acquisition component 20 through a data line or a wireless communication connection.

在一些实施例中,处理器30可以利用缺陷检测模型对待检测图像进行图像识别分析,以对待检测焊锡件进行缺陷检测。In some embodiments, the processor 30 may use the defect detection model to perform image recognition and analysis on the image to be detected, so as to perform defect detection on the solder piece to be detected.

在一应用场景中,处理器30可以以如下方式对待检测图像进行图像识别分析,以对待检测焊锡件进行缺陷检测。In an application scenario, the processor 30 may perform image recognition and analysis on the to-be-inspected image in the following manner, so as to perform defect detection on the to-be-inspected solder piece.

首先,处理器30对待检测图像进行数据预处理,以检测待检测图像的图像尺寸是否为缺陷检测模型中步长的倍数。具体地,若图像的尺寸不是步长的倍数,则获取最接近待检测图像的图像尺寸的步长的最小倍数。First, the processor 30 performs data preprocessing on the image to be inspected to detect whether the image size of the image to be inspected is a multiple of the step size in the defect detection model. Specifically, if the size of the image is not a multiple of the step size, the minimum multiple of the step size closest to the image size of the image to be detected is obtained.

在其他实施例中,可以对图像尺寸进行填充,以使待检测图像的图像尺寸为步长的倍数。在一应用场景中,如果对待检测图像的填充的比较多,则存在信息冗余,影响推理速度。因此可以采用缩减黑边的方式,来提高推理的速度。可以对待检测图像自适应的添加最少的黑边。比如,1000×800的待检测图像不会直接缩放到608×608的大小,而是计算608/1000=0.608,然后缩放至608×486的大小,然后计算608-486=122,然后使用函数np.mod(122,32),取余数得到26,其中,32为步长。再平均成13填充到待检测图像的高度两端,最后得到的待检测图像的尺寸是608×512。In other embodiments, the image size may be padded so that the image size of the image to be detected is a multiple of the step size. In an application scenario, if the image to be detected is filled more, there will be information redundancy, which will affect the inference speed. Therefore, the method of reducing the black border can be used to improve the speed of reasoning. The least black border can be adaptively added to the image to be detected. For example, the 1000×800 image to be detected will not be directly scaled to the size of 608×608, but calculate 608/1000=0.608, then scale to the size of 608×486, then calculate 608-486=122, and then use the function np .mod(122, 32), take the remainder to get 26, where 32 is the step size. Then average 13 to fill the two ends of the height of the image to be detected, and finally the size of the image to be detected is 608×512.

接着,利用缺陷检测模型中的Focus模块对待检测图像进行切片操作。具体操作是在一张图片中每隔一个像素拿到一个值,类似于邻近下采样,这样就拿到了四张图片,四张图片互补,长的差不多,但是没有信息丢失,这样一来,将W、H信息就集中到了通道空间,输入通道扩充了4倍,即拼接起来的图片相对于原先的RGB三通道模式变成了12个通道,最后将得到的新图片再经过卷积操作,最终得到了没有信息丢失情况下的二倍下采样特征图。如,待检测图像以640×640×3输入Focus模块,采用切片操作,先变成320×320×12的特征图,再经过一次卷积操作,最终变成320×320×64的特征图。通过这种方式,使得特征提取得更加的充分。Then, use the Focus module in the defect detection model to slice the image to be detected. The specific operation is to get a value for every other pixel in a picture, similar to neighboring downsampling, so that four pictures are obtained, the four pictures are complementary, and the length is about the same, but no information is lost. In this way, the The W and H information is concentrated in the channel space, and the input channel is expanded by 4 times, that is, the spliced picture becomes 12 channels compared with the original RGB three-channel mode, and finally the new picture obtained is subjected to a convolution operation, and finally A double downsampled feature map is obtained without information loss. For example, the image to be detected is input into the Focus module at 640×640×3, and the slice operation is used to first become a feature map of 320×320×12, and then undergo a convolution operation to finally become a feature map of 320×320×64. In this way, the feature extraction is more fully.

然后利用缺陷检测模型对待检测图像中的每一锡球进行缺陷检测,以得到每一锡球对应的缺陷类型。如,在得到缺陷类型时,可以在原始图像中进行标注,并进行显示,以使用户清楚具体地缺陷锡球,便于后续进行维护。如,对该待检测焊锡件进行重新焊锡,或者对该待检测焊锡件进行报废处理等。Then use the defect detection model to perform defect detection for each solder ball in the image to be detected, so as to obtain the defect type corresponding to each solder ball. For example, when the defect type is obtained, it can be marked in the original image and displayed, so that the user can clearly identify the defect solder ball, and facilitate subsequent maintenance. For example, re-soldering the solder piece to be tested, or scrapping the solder piece to be tested.

在一些实施例中,缺陷检测模型可以包括输入层、特征提取层、特征融合层和输出层。In some embodiments, a defect detection model may include an input layer, a feature extraction layer, a feature fusion layer, and an output layer.

其中,在输入层可以对待检测图像进行数据增强、自适应锚框计算、自适应图像缩放。其中,数据增强可以采用马赛克数据增强,通过对待检测图像进行随机缩放、随机裁剪、随机排布,然后进行拼接得到新的图像,通过这种方式能够提高对小目标的检测效果。Among them, data enhancement, adaptive anchor frame calculation, and adaptive image scaling can be performed on the image to be detected at the input layer. Among them, data enhancement can use mosaic data enhancement, by randomly scaling, randomly cropping, randomly arranging, and then splicing the images to be detected to obtain new images, which can improve the detection effect of small targets.

其中,自适应锚框计算,将此功能嵌入到代码中,每次训练时,自适应的计算不同训练集中的最佳锚框值。Among them, the adaptive anchor frame calculation, embeds this function into the code, and adaptively calculates the best anchor frame value in different training sets during each training.

其中,自适应图片缩放,图像高度上两端的黑边变少了,在推理时,计算量也会减少,即目标检测速度会得到提升。Among them, adaptive image scaling reduces the black borders at both ends of the image height, and reduces the amount of calculation during inference, that is, the target detection speed will be improved.

特征提取层中按照顺序依次是Focus层、第一卷积层、第一BottleneckCSP层、第二卷积层、第二BottleneckCSP层、第三卷积层、第三BottleneckCSP层、第四卷积层、SPP层、第四BottleneckCSP层。In the feature extraction layer, the Focus layer, the first convolution layer, the first BottleneckCSP layer, the second convolution layer, the second BottleneckCSP layer, the third convolution layer, the third BottleneckCSP layer, the fourth convolution layer, SPP layer, the fourth BottleneckCSP layer.

其中,Focus层用于从高分辨率图像中,周期性的抽出像素点重构到低分辨率图像中,即将图像相邻的四个位置进行堆叠,聚焦w、h维度信息到通道空间,提高每个点感受野,并减少原始信息的丢失,能够减少计算量,加快计算速度。Among them, the Focus layer is used to periodically extract pixels from the high-resolution image and reconstruct them into the low-resolution image, that is, to stack the four adjacent positions of the image, and focus the w and h dimension information into the channel space to improve Each point has a receptive field and reduces the loss of original information, which can reduce the amount of calculation and speed up the calculation.

其中,BottleneckCSP层主要包括Bottleneck模块和CSP(Cross Stage Partial,跨阶段部分)模块。Among them, the BottleneckCSP layer mainly includes a Bottleneck module and a CSP (Cross Stage Partial, cross-stage part) module.

其中,SPP层分别采用5/9/13的最大池化,再进行concat融合,提高感受野。SPP的输入是512x20x20,经过1x1的卷积层后输出256x20x20,然后经过并列的三个Maxpool(最大池化层)进行下采样,将结果与其初始特征相加,输出1024x20x20,最后用512的卷积核将其恢复到512x20x20。Among them, the SPP layer adopts the maximum pooling of 5/9/13 respectively, and then performs concat fusion to improve the receptive field. The input of SPP is 512x20x20, after the 1x1 convolutional layer, the output is 256x20x20, and then three Maxpool (maximum pooling layers) are paralleled for downsampling, the result is added to the initial feature, and the output is 1024x20x20, and finally the convolution with 512 The core brings it back to 512x20x20.

特征融合层采用FPN(Feature Pyramid Networks,特征金字塔网络)+PAN(Perceptual Adversarial Network,感知对抗网络)的结构,采用借鉴CSPnet(CrossStage Partial Networks,跨阶段局部网络)设计的CSP2结构,加强网络特征融合的能力。The feature fusion layer adopts the structure of FPN (Feature Pyramid Networks, feature pyramid network) + PAN (Perceptual Adversarial Network, perceptual confrontation network), and adopts the CSP2 structure designed by referring to CSPnet (CrossStage Partial Networks, cross-stage local network) to strengthen network feature fusion Ability.

输出层可以采用GIOU_Loss函数:The output layer can use the GIOU_Loss function:

具体地,函数公式如下:Specifically, the function formula is as follows:

Figure BDA0003049611990000081
Figure BDA0003049611990000081

其中,IOU(Intersection over Union)表示交并比,U表示不属于上述公式表达的意思是:先计算两个框的最小闭包区域面积Ac(同时包含了预测框和真实框的最小框的面积),再计算出IoU,再计算闭包区域Ac中不属于两个框的区域占闭包区域的比重,最后用IoU减去这个比重得到GIoU。Among them, IOU (Intersection over Union) means the ratio of intersection and union, and U means that it does not belong to the expression of the above formula. It means: first calculate the minimum closed area area Ac of the two frames (the area of the minimum frame that includes the predicted frame and the real frame at the same time ), and then calculate the IoU, and then calculate the proportion of the closure area that does not belong to the two boxes in the closure area Ac, and finally subtract this proportion from the IoU to obtain the GIoU.

则对应的损失函数为LGIOU=1-GIOU。Then the corresponding loss function is L GIOU =1-GIOU.

还可以使用nms非极大值抑制。It is also possible to use nms non-maximum suppression.

利用上述的锡球缺陷检测装置100进行训练图像的采集,并对训练图像中的锡球进行标注,然后利用标注后的训练图像对上述的缺陷检测模型进行训练,以在训练完成后,处理器30使用该缺陷检测模型对待检测图像进行图像识别分析,以对待检测焊锡件进行缺陷检测。可以理解,利用两种不同颜色光采集到的训练图像,能够使图像中的锡球缺陷更加明显,在标注时更易识别,进行提升标注效率。且因图像中的锡球缺陷更加明显,则在模型训练时能够获取到更多的特征,使训练后的缺陷检测模型的精度得到提高,进而在利用该缺陷检测模型进行缺陷检测时,能够提升检测的准确性。Use the above-mentioned solder ball defect detection device 100 to collect training images, and mark the solder balls in the training images, and then use the marked training images to train the above-mentioned defect detection model, so that after the training is completed, the processor 30. Using the defect detection model to perform image recognition and analysis on the image to be detected, so as to perform defect detection on the solder piece to be detected. It can be understood that using the training images collected by two different colors of light can make the solder ball defect in the image more obvious, easier to identify during labeling, and improve labeling efficiency. And because the solder ball defect in the image is more obvious, more features can be obtained during model training, so that the accuracy of the trained defect detection model can be improved, and then when using the defect detection model for defect detection, it can improve detection accuracy.

在其他实施例中,可以利用目标检测算法(yolov5目标检测算法)训练该缺陷检测模型,使用训练得到的缺陷检测模型对待检测图像进行锡球缺陷检测。该目标检测算法相较于传统的对比、几何计算算法,无需人工设计合理的特征提取方式,能够提取更多的特征。In other embodiments, the defect detection model may be trained using a target detection algorithm (yolov5 target detection algorithm), and the trained defect detection model may be used to perform solder ball defect detection on the image to be detected. Compared with traditional comparison and geometric calculation algorithms, this target detection algorithm can extract more features without manually designing a reasonable feature extraction method.

在本实施例中提供的锡球缺陷检测装置,该锡球缺陷检测装置包括:光源组件,包括第一光源和第二光源,第一光源用于产生第一颜色光,第二光源用于产生第二颜色光,第一颜色光和第二颜色光的颜色不同,第一颜色光和第二颜色光用于照射待检测焊锡件;图像采集组件,用于采集待检测焊锡件被第一颜色光和第二颜色光照射时的待检测图像;处理器,与图像采集组件连接,用于接收待检测图像,并对待检测图像进行图像识别分析,以对待检测焊锡件进行缺陷检测。通过上述方式,利用两种不同的颜色光照射待检测焊锡件,使待检测焊锡件上的半球型锡球在照射时采集的图像存在明显的颜色差异,能够让存在缺陷的锡球更加突出,进而提升对锡球缺陷检测的准确性,以及提高对锡球缺陷检测的检测效率。In the solder ball defect detection device provided in this embodiment, the solder ball defect detection device includes: a light source assembly, including a first light source and a second light source, the first light source is used to generate the first color light, and the second light source is used to generate The second color light, the first color light and the second color light are different in color, the first color light and the second color light are used to irradiate the solder piece to be detected; the image acquisition component is used to collect the solder piece to be detected by the first color The image to be inspected when the light and the second color light are irradiated; the processor is connected to the image acquisition component, and is used to receive the image to be inspected, and perform image recognition and analysis on the image to be inspected, so as to detect defects on the solder piece to be inspected. Through the above method, two different colors of light are used to irradiate the solder parts to be inspected, so that the images collected by the hemispherical solder balls on the solder parts to be inspected have obvious color differences, which can make the solder balls with defects more prominent. Further, the accuracy of the detection of the solder ball defect is improved, and the detection efficiency of the detection of the solder ball defect is improved.

参阅图4,图4是本申请提供的光源组件和图像采集组件的一实施例的结构示意图。光源组件10上设有光通道14,图像采集组件20设置于光源组件10远离待检测焊锡件的一侧,光源组件10产生的光经由待检测焊锡件反射后通过光通道14进入图像采集组件20。光源组件10还包括遮罩13,用于对光源组件10产生的光进行聚集,以使光源组件10产生的光能够直射待检测焊锡件。Referring to FIG. 4 , FIG. 4 is a schematic structural diagram of an embodiment of a light source assembly and an image acquisition assembly provided by the present application. The light source assembly 10 is provided with an optical channel 14, and the image acquisition assembly 20 is arranged on the side of the light source assembly 10 away from the solder piece to be inspected. . The light source assembly 10 also includes a shield 13 for collecting the light generated by the light source assembly 10 so that the light generated by the light source assembly 10 can directly strike the solder piece to be inspected.

在一些实施例中,参阅图5,第一光源11上设有第一通孔11a,第二光源12上设有第二通孔12a,第一光源11和第二光源12层叠设置,以使第一通孔11a和第二通孔12a连通形成光通道14;第一通孔11a的孔径小于第二通孔12a的孔径。图像采集组件20设置于第一光源11的上方,即光源组件10远离待检测焊锡件的一侧。图像采集组件20通过第一通孔11a对待检测焊锡件进行图像采集。通过这样的方式,第一光源11产生的光从第二通孔12a照射至待检测焊锡件。图像采集组件20通过光通道14对待检测焊锡件进行图像采集。In some embodiments, referring to FIG. 5, the first light source 11 is provided with a first through hole 11a, the second light source 12 is provided with a second through hole 12a, and the first light source 11 and the second light source 12 are stacked so that The first through hole 11a communicates with the second through hole 12a to form the light channel 14; the diameter of the first through hole 11a is smaller than the diameter of the second through hole 12a. The image acquisition component 20 is disposed above the first light source 11 , that is, the side of the light source component 10 away from the solder piece to be inspected. The image acquisition component 20 performs image acquisition on the solder piece to be inspected through the first through hole 11a. In this way, the light generated by the first light source 11 is irradiated from the second through hole 12a to the solder piece to be inspected. The image acquisition component 20 performs image acquisition on the solder piece to be inspected through the optical channel 14 .

在一些实施例中,参阅图6,第一光源11上设有第一通孔11a,第二光源上设有第二通孔,第二光源12设置于第一通孔11a内,以使第二通孔12a形成光通道。In some embodiments, referring to FIG. 6, the first light source 11 is provided with a first through hole 11a, the second light source is provided with a second through hole, and the second light source 12 is disposed in the first through hole 11a, so that the first The two through holes 12a form a light channel.

参阅图7,图7是本申请提供的锡球缺陷检测装置另一实施例的结构示意图。该锡球缺陷检测装置100包括光源组件10,其中,光源组件10包括第一光源11、第二光源12、图像采集组件20、处理器(图未示)和支撑架40。Referring to FIG. 7 , FIG. 7 is a schematic structural diagram of another embodiment of a solder ball defect detection device provided in the present application. The solder ball defect detection device 100 includes a light source assembly 10 , wherein the light source assembly 10 includes a first light source 11 , a second light source 12 , an image acquisition assembly 20 , a processor (not shown) and a support frame 40 .

其中,第一光源11、第二光源12和图像采集组件20通过电源线与电源60连接。Wherein, the first light source 11 , the second light source 12 and the image acquisition component 20 are connected to a power source 60 through a power line.

进一步,第一光源11、第二光源12和图像采集组件20设置于支撑架40上。支撑架40设置于置物台A上,置物台A上的区域B用于放置待检测焊锡件。Further, the first light source 11 , the second light source 12 and the image acquisition component 20 are arranged on the support frame 40 . The supporting frame 40 is arranged on the storage table A, and the area B on the storage table A is used for placing the solder pieces to be inspected.

第一光源11、第二光源12、图像采集组件20和处理器与上述实施例中的相同或相似,这里不再赘述。The first light source 11 , the second light source 12 , the image acquisition component 20 and the processor are the same as or similar to those in the above-mentioned embodiments, and will not be repeated here.

参阅图8,支撑架40包括第一支撑件41和第二支撑件42。光源组件10设置于第一支撑件41上,即上述实施例中的第一光源11和第二光源12设置于第一支撑件41上,图像采集组件20设置于第二支撑件42上;第二支撑件42远离第一光源11和第二光源12的光路设置于第一支撑件41的一端,即第二支撑件42设置于光源组件10远离待检测焊锡件的一侧。Referring to FIG. 8 , the support frame 40 includes a first support member 41 and a second support member 42 . The light source assembly 10 is arranged on the first support member 41, that is, the first light source 11 and the second light source 12 in the above embodiment are arranged on the first support member 41, and the image acquisition assembly 20 is arranged on the second support member 42; The second support 42 is disposed at one end of the first support 41 away from the optical paths of the first light source 11 and the second light source 12 , that is, the second support 42 is disposed at the side of the light source assembly 10 away from the solder piece to be inspected.

在一些实施例中,第一光源11设置于第二光源12上方,第一光源11和第二光源12的光路朝向待检测焊锡件。In some embodiments, the first light source 11 is disposed above the second light source 12 , and the light paths of the first light source 11 and the second light source 12 are directed toward the solder piece to be inspected.

其中,第一光源11包括多个第一子光源,多个第一子光源呈环形设置以在多个第一子光源中形成第一通孔11a;第二光源12包括多个第二子光源,多个第二子光源呈环形设置以在多个第二子光源中形成第二通孔12a。Wherein, the first light source 11 includes a plurality of first sub-light sources, and the plurality of first sub-light sources are arranged in a ring to form a first through hole 11a in the plurality of first sub-light sources; the second light source 12 includes a plurality of second sub-light sources A plurality of second sub-light sources are arranged in a ring to form second through holes 12a in the plurality of second sub-light sources.

第一光源11和第二光源12呈环状,图像采集组件20设置于第一光源11上方,且图像采集组件20透过第一光源11和第二光源12的第一通孔11a和第二通孔12a对待检测焊锡件进行图像采集,以得到待检测图像。在上方的第一光源11将在待检测焊锡件中的合格锡球顶部形成小圆点,下方的第二光源12将照射在待检测焊锡件的锡球周围,而待检测焊锡件中的缺陷锡球的顶部将呈现形状不规则,饱和度过高(深颜色)等特点。The first light source 11 and the second light source 12 are annular, and the image acquisition component 20 is arranged above the first light source 11, and the image acquisition component 20 passes through the first through hole 11a and the second through hole 11a of the first light source 11 and the second light source 12. The through hole 12a performs image acquisition on the solder piece to be inspected to obtain an image to be inspected. The first light source 11 on the top will form a small dot on the qualified tin ball top in the solder piece to be detected, and the second light source 12 below will illuminate around the solder ball of the solder piece to be detected, and the defect in the solder piece to be detected The top of the ball will be irregular in shape, oversaturated (dark color), etc.

在一些实施例中,第一光源11可以和第二光源12设置于同一基板上,如,第一光源11和第二光源12分别由多个LED灯珠组成,其中,多个LED灯珠按照一定数量分组,因此,第一光源11和第二光源12分别由多组灯珠组成。参阅图9,第一光源11由多个灯珠D组成,第二光源12由多个灯珠E组成。灯珠D和灯珠E间隔设置基板上。其中,基板中心区域形成通孔C,图像采集组件20可通过通孔C采集待检测图像。第一光源11和第二光源12的照射范围能够覆盖待检测焊锡件。In some embodiments, the first light source 11 and the second light source 12 can be arranged on the same substrate, for example, the first light source 11 and the second light source 12 are respectively composed of a plurality of LED lamp beads, wherein the plurality of LED lamp beads according to A certain number of groups, therefore, the first light source 11 and the second light source 12 are respectively composed of multiple groups of lamp beads. Referring to FIG. 9 , the first light source 11 is composed of a plurality of lamp beads D, and the second light source 12 is composed of a plurality of lamp beads E. The lamp bead D and the lamp bead E are arranged on the substrate at intervals. Wherein, a through hole C is formed in the central area of the substrate, and the image acquisition component 20 can collect the image to be detected through the through hole C. The irradiation ranges of the first light source 11 and the second light source 12 can cover the solder parts to be inspected.

在上述任一实施例中,第一光源11发出的第一颜色光可以为单色光,第二光源12发出的第二颜色光可以为复色光或单色光。或者,第一光源11发出的第一颜色光可以为复色光或单色光,第二光源12发出的第二颜色光可以为单色光。In any of the above embodiments, the first color light emitted by the first light source 11 may be monochromatic light, and the second color light emitted by the second light source 12 may be polychromatic light or monochromatic light. Alternatively, the first color light emitted by the first light source 11 may be polychromatic light or monochromatic light, and the second color light emitted by the second light source 12 may be monochromatic light.

如,第一颜色光可以为红光,第二颜色光可以为白光。又如,第一颜色光可以为红光,第二颜色光可以为蓝光。For example, the first color light may be red light, and the second color light may be white light. In another example, the first color light may be red light, and the second color light may be blue light.

在一应用场景中,参阅图10,图10是本申请提供的待检测图像进行缺陷检测后的示意图。可以理解,正确焊锡后锡球呈半圆形,因此,无缺陷的锡球的图像在锡球的顶点会存在一个圆点。而有缺陷的锡球通常的缺陷类型为污渍缺陷、压伤缺陷、开裂缺陷、不规则发亮缺陷等。存在缺陷的锡球则不是完整的半圆形,因此,第一颜色光会在锡球表面形成对应缺陷的缺陷区域。如图10所示,在待检测图像F的区域G和区域H中存在缺陷锡球。可以理解,在其他实施例中可对应显示缺陷锡球的缺陷类型。可以理解,在对训练图像进行缺陷标注时,也是利用上述的缺陷类型进行标注。In an application scenario, refer to FIG. 10 , which is a schematic diagram of an image to be detected provided by the present application after defect detection. It can be understood that the solder ball is semicircular after correct soldering, therefore, the image of a defect-free solder ball will have a dot at the apex of the solder ball. The usual defect types of defective solder balls are stain defects, crush defects, crack defects, and irregular shiny defects. The solder ball with defects is not a complete semicircle, therefore, the first color light will form a defect area corresponding to the defect on the surface of the solder ball. As shown in FIG. 10 , defective solder balls exist in regions G and H of the image F to be detected. It can be understood that in other embodiments, the defect types of defective solder balls can be displayed correspondingly. It can be understood that when labeling defects on training images, the above-mentioned defect types are also used for labeling.

通过上述方式,利用两种不同的颜色光照射待检测焊锡件,使待检测焊锡件上的半球型锡球在照射时采集的图像存在明显的颜色差异,能够让存在缺陷的锡球更加突出,进而提升对锡球缺陷检测的准确性,以及提高对锡球缺陷检测的检测效率。Through the above method, two different colors of light are used to irradiate the solder parts to be inspected, so that the images collected by the hemispherical solder balls on the solder parts to be inspected have obvious color differences, which can make the solder balls with defects more prominent. Further, the accuracy of the detection of the solder ball defect is improved, and the detection efficiency of the detection of the solder ball defect is improved.

参阅图11,图11是本申请提供的锡球缺陷检测方法一实施例的流程示意图。该方法包括:Referring to FIG. 11 , FIG. 11 is a schematic flowchart of an embodiment of a solder ball defect detection method provided by the present application. The method includes:

步骤81:获取待检测图像。Step 81: Obtain an image to be detected.

其中,待检测图像是利用上述任一实施例中的锡球缺陷检测装置100中的图像采集组件20在待检测焊锡件被两种不同颜色光照射时采集得到。具体地,待检测焊锡件被第一光源发出的第一颜色光和第二光源发出的第二颜色光照射。Wherein, the image to be inspected is acquired by using the image acquisition component 20 in the solder ball defect inspection device 100 in any of the above-mentioned embodiments when the solder piece to be inspected is irradiated by light of two different colors. Specifically, the solder piece to be inspected is irradiated by the light of the first color emitted by the first light source and the light of the second color emitted by the second light source.

步骤82:利用缺陷检测模型对待检测图像进行检测,得到待检测图像中对应缺陷的检测信息。Step 82: Use the defect detection model to detect the image to be detected, and obtain the detection information of the corresponding defect in the image to be detected.

其中,缺陷检测模型采用训练图像训练得到,其中,训练图像是利用上述任一实施例中的锡球缺陷检测装置100中的图像采集组件20在待检测焊锡件被两种不同颜色光照射时采集得到。具体地,待检测焊锡件被第一光源发出的第一颜色光和第二光源发出的第二颜色光照射。在获得训练图像之后,根据训练图像上的锡球的实际缺陷进行标注,然后根据标注的真实信息对缺陷检测模型进行训练。Wherein, the defect detection model is obtained by training with training images, wherein, the training images are collected by the image acquisition component 20 in the solder ball defect detection device 100 in any of the above-mentioned embodiments when the solder piece to be detected is irradiated by two different colors of light get. Specifically, the solder piece to be inspected is irradiated by the light of the first color emitted by the first light source and the light of the second color emitted by the second light source. After obtaining the training image, mark it according to the actual defect of the tin ball on the training image, and then train the defect detection model according to the real information of the mark.

通过上述方式,利用两种不同的颜色光照射待检测焊锡件,使待检测焊锡件上的半球型锡球在照射时采集的图像存在明显的颜色差异,能够让存在缺陷的锡球更加突出,进而提升对锡球缺陷检测的准确性,以及提高对锡球缺陷检测的检测效率。Through the above method, two different colors of light are used to irradiate the solder parts to be inspected, so that the images collected by the hemispherical solder balls on the solder parts to be inspected have obvious color differences, which can make the solder balls with defects more prominent. Further, the accuracy of the detection of the solder ball defect is improved, and the detection efficiency of the detection of the solder ball defect is improved.

参阅图12,图12是本申请提供的电子设备一实施例的结构示意图,该电子设备90包括控制器91和控制器91连接的存储器92;其中,存储器92用于存储程序数据,控制器91用于执行程序数据,以实现以下方法:Referring to FIG. 12, FIG. 12 is a schematic structural diagram of an embodiment of an electronic device provided by the present application. The electronic device 90 includes a controller 91 and a memory 92 connected to the controller 91; wherein, the memory 92 is used to store program data, and the controller 91 Used to execute program data to implement the following methods:

获取待检测图像;利用缺陷检测模型对待检测图像进行检测,得到待检测图像中对应缺陷的检测信息,其中,缺陷检测模型采用训练图像训练得到,其中,待检测图像和训练图像是利用如上述技术方案提供的锡球缺陷检测装置中的图像采集组件在待检测焊锡件被两种不同颜色光照射时采集得到。Obtain the image to be detected; use the defect detection model to detect the image to be detected, and obtain the detection information of the corresponding defect in the image to be detected, wherein the defect detection model is obtained by training the training image, wherein the image to be detected and the training image are obtained using the above-mentioned technology The image acquisition component in the solder ball defect detection device provided by the solution is acquired when the solder piece to be inspected is irradiated by two different colors of light.

可以理解的,控制器91可以是上述任一实施例的锡球缺陷检测装置100中的处理器30。其具体的实施方式可以参考上述实施例,这里不再赘述。It can be understood that the controller 91 may be the processor 30 in the solder ball defect detection device 100 of any of the above-mentioned embodiments. For specific implementation manners, reference may be made to the foregoing embodiments, and details are not repeated here.

参阅图13,图13是本申请提供的计算机可读存储介质一实施例的结构示意图,该计算机可读存储介质130用于存储程序数据131,程序数据131在被处理器执行时,用于实现以下的方法步骤:Referring to FIG. 13, FIG. 13 is a schematic structural diagram of an embodiment of a computer-readable storage medium provided by the present application. The computer-readable storage medium 130 is used to store program data 131. When the program data 131 is executed by a processor, it is used to realize The following method steps:

获取待检测图像;利用缺陷检测模型对待检测图像进行检测,得到待检测图像中对应缺陷的检测信息,其中,缺陷检测模型采用训练图像训练得到,其中,待检测图像和训练图像是利用如上述技术方案提供的锡球缺陷检测装置中的图像采集组件在待检测焊锡件被两种不同颜色光照射时采集得到。Obtain the image to be detected; use the defect detection model to detect the image to be detected, and obtain the detection information of the corresponding defect in the image to be detected, wherein the defect detection model is obtained by training the training image, wherein the image to be detected and the training image are obtained using the above-mentioned technology The image acquisition component in the solder ball defect detection device provided by the solution is acquired when the solder piece to be inspected is irradiated by two different colors of light.

可以理解的,本实施例中的计算机可读存储介质130应用于电子设备,其具体的实施步骤可以参考上述实施例,这里不再赘述。It can be understood that the computer-readable storage medium 130 in this embodiment is applied to an electronic device, and its specific implementation steps can refer to the above-mentioned embodiments, which will not be repeated here.

在本申请上述的锡球缺陷检测装置、锡球缺陷检测方法、电子设备以及计算机可读存储介质中,使用两种不同的颜色光照射待检测焊锡件的形式采集待检测图像,以两种具有明显差异色相的灯光照射到待检测焊锡件,可有效区分待检测焊锡件中的缺陷锡球和合格锡球。其次使用目标检测算法,待检测焊锡件只需出现于图像采集组件的拍摄视野中,且从大数据中学习有效的特征提取,目标检测算法可由专门的加速硬件加速,实现更高效地检测锡球缺陷。In the above-mentioned solder ball defect detection device, solder ball defect detection method, electronic equipment, and computer-readable storage medium of the present application, the images to be detected are collected in the form of irradiating the solder parts to be detected with two different colors of light, and the images to be detected are collected in two colors The light with obviously different hues illuminates the solder parts to be inspected, which can effectively distinguish the defective solder balls and qualified solder balls in the solder parts to be inspected. Secondly, using the target detection algorithm, the solder parts to be detected only need to appear in the field of view of the image acquisition component, and learn effective feature extraction from big data. The target detection algorithm can be accelerated by special acceleration hardware to achieve more efficient detection of solder balls defect.

在本申请所提供的几个实施方式中,应该理解到,所揭露的方法以及设备,可以通过其它的方式实现。例如,以上所描述的设备实施方式仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。In the several implementation manners provided in this application, it should be understood that the disclosed methods and devices may be implemented in other ways. For example, the device implementation described above is only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be Incorporation may either be integrated into another system, or some features may be omitted, or not implemented.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施方式方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本申请各个实施方式中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

上述其他实施方式中的集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施方式所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,RandomAccess Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated units in the above other embodiments are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, and other media that can store program codes.

以上所述仅为本申请的实施方式,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above is only the implementation of the application, and does not limit the patent scope of the application. Any equivalent structure or equivalent process conversion made by using the specification and drawings of the application, or directly or indirectly used in other related technologies fields, are all included in the scope of patent protection of this application in the same way.

Claims (12)

1. A solder ball defect detecting apparatus, comprising:
the light source assembly comprises a first light source and a second light source, wherein the first light source is used for generating first color light, the second light source is used for generating second color light, the colors of the first color light and the second color light are different, and the first color light and the second color light are used for irradiating the soldering tin piece to be detected;
the image acquisition assembly is used for acquiring an image to be detected when the soldering tin piece to be detected is irradiated by the first color light and the second color light;
and the processor is connected with the image acquisition assembly and is used for receiving the image to be detected and carrying out image recognition analysis on the image to be detected so as to detect the defects of the soldering tin piece to be detected.
2. The solder ball defect detecting apparatus of claim 1,
the light source assembly is provided with a light channel, the image acquisition assembly is arranged on one side, away from the soldering tin piece to be detected, of the light source assembly, and light generated by the light source assembly enters the image acquisition assembly through the light channel after being reflected by the soldering tin piece to be detected.
3. The solder ball defect detecting apparatus of claim 2,
the first light source is provided with a first through hole, the second light source is provided with a second through hole, and the first light source and the second light source are arranged in a stacked mode so that the first through hole and the second through hole are communicated to form the light channel;
the aperture of the first through hole is smaller than the aperture of the second through hole.
4. The solder ball defect detecting apparatus of claim 2,
the first light source is provided with a first through hole, the second light source is provided with a second through hole, and the second light source is arranged in the first through hole so that the second through hole forms the optical channel.
5. The solder ball defect detecting apparatus of claim 3 or 4,
the first light source comprises a plurality of first sub-light sources which are arranged in a ring shape to form the first through holes in the plurality of first sub-light sources;
the second light source includes a plurality of second sub light sources arranged in a ring shape to form the second through holes in the plurality of second sub light sources.
6. The solder ball defect detecting apparatus of claim 1,
the tin ball defect detection device further comprises a support frame, and the light source assembly and the image acquisition assembly are arranged on the support frame.
7. The solder ball defect detecting apparatus of claim 6,
the support frame comprises a first support part and a second support part; the light source assembly is arranged on the first supporting piece, and the image acquisition assembly is arranged on the second supporting piece; the second supporting piece is arranged on one side, away from the soldering tin piece to be detected, of the light source component.
8. The solder ball defect detecting apparatus of claim 1,
the first color light is monochromatic light, and the second color light is polychromatic light or monochromatic light.
9. The solder ball defect detecting apparatus of claim 8,
the first color light is red light, and the second color light is white light.
10. A solder ball defect detection method is characterized by comprising the following steps:
acquiring an image to be detected;
detecting the image to be detected by using a defect detection model to obtain detection information of the corresponding defect in the image to be detected, wherein the defect detection model is obtained by training a training image, and the image to be detected and the training image are obtained by using an image acquisition component in the solder ball defect detection device as claimed in any one of claims 1 to 9 when the solder ball to be detected is irradiated by light with two different colors.
11. An electronic device, comprising a controller and a memory to which the controller is connected;
wherein the memory is configured to store program data and the controller is configured to execute the program data to implement the method of claim 10.
12. A computer-readable storage medium, characterized in that the computer-readable storage medium is used for storing program data, which, when being executed by a processor, is used for carrying out the method as claimed in claim 10.
CN202110481976.5A 2021-04-30 2021-04-30 Tin ball defect detection device and method, electronic device and storage medium Pending CN115266762A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110481976.5A CN115266762A (en) 2021-04-30 2021-04-30 Tin ball defect detection device and method, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110481976.5A CN115266762A (en) 2021-04-30 2021-04-30 Tin ball defect detection device and method, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN115266762A true CN115266762A (en) 2022-11-01

Family

ID=83744672

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110481976.5A Pending CN115266762A (en) 2021-04-30 2021-04-30 Tin ball defect detection device and method, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN115266762A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116523905A (en) * 2023-06-27 2023-08-01 广东华辉煌光电科技有限公司 Defect detection method and system for lamp beads

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201396645Y (en) * 2009-04-10 2010-02-03 厦门福信光电集成有限公司 Light source device of automatic optical detecting devices
CN101694278A (en) * 2009-10-13 2010-04-14 上海电机学院 Light source device used for automatic optical checking machine
CN102033072A (en) * 2010-10-30 2011-04-27 华南理工大学 Light source for optical automatic detector
JP2014168763A (en) * 2013-03-05 2014-09-18 Sinfonia Technology Co Ltd Foreign matter detecting device and parts feeder
CN108414530A (en) * 2018-03-13 2018-08-17 昆山国显光电有限公司 Automated optical detection equipment
CN207964676U (en) * 2018-03-16 2018-10-12 才众电脑(深圳)有限公司 A kind of AOI Solder-Paste Printings detection device
CN209084553U (en) * 2018-12-27 2019-07-09 东莞乐视自动化科技有限公司 An AOI visual inspection light source
CN211179500U (en) * 2019-12-10 2020-08-04 联策科技股份有限公司 Multi-light source optical detection system
CN111982931A (en) * 2020-08-27 2020-11-24 惠州高视科技有限公司 High-precision wafer surface defect detection device and detection method thereof

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN201396645Y (en) * 2009-04-10 2010-02-03 厦门福信光电集成有限公司 Light source device of automatic optical detecting devices
CN101694278A (en) * 2009-10-13 2010-04-14 上海电机学院 Light source device used for automatic optical checking machine
CN102033072A (en) * 2010-10-30 2011-04-27 华南理工大学 Light source for optical automatic detector
JP2014168763A (en) * 2013-03-05 2014-09-18 Sinfonia Technology Co Ltd Foreign matter detecting device and parts feeder
CN108414530A (en) * 2018-03-13 2018-08-17 昆山国显光电有限公司 Automated optical detection equipment
CN207964676U (en) * 2018-03-16 2018-10-12 才众电脑(深圳)有限公司 A kind of AOI Solder-Paste Printings detection device
CN209084553U (en) * 2018-12-27 2019-07-09 东莞乐视自动化科技有限公司 An AOI visual inspection light source
CN211179500U (en) * 2019-12-10 2020-08-04 联策科技股份有限公司 Multi-light source optical detection system
CN111982931A (en) * 2020-08-27 2020-11-24 惠州高视科技有限公司 High-precision wafer surface defect detection device and detection method thereof

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116523905A (en) * 2023-06-27 2023-08-01 广东华辉煌光电科技有限公司 Defect detection method and system for lamp beads
CN116523905B (en) * 2023-06-27 2023-10-20 广东华辉煌光电科技有限公司 Defect detection method and system for lamp beads

Similar Documents

Publication Publication Date Title
CN111144305B (en) Training data generation method and device, electronic equipment and medium
CN110060238A (en) Pcb board based on deep learning marks print quality inspection method
CN104077759A (en) Multi-exposure image fusion method based on color perception and local quality factors
CN114240939A (en) Method, system, equipment and medium for detecting appearance defects of mainboard components
US20220023977A1 (en) Solder joint inspection model training method, solder joint inspection method, and solder joint inspection device
CN113205507B (en) Visual question answering method, system and server
JP5085573B2 (en) Defect inspection method and defect inspection apparatus
TW202201283A (en) Training data increment method, electronic apparatus and computer-readable medium
CN105229665A (en) To the enhancing analysis of the snakelike belt wear assessment based on image
CN115266762A (en) Tin ball defect detection device and method, electronic device and storage medium
CN117437227A (en) Image generation and defect detection method, device, medium, equipment and product
CN112381794B (en) A printing defect detection method based on deep convolutional generative network
CN114627044A (en) A deep learning-based hot spot detection method for solar photovoltaic modules
CN115375677B (en) Wine bottle defect detection method and system based on multi-path and multi-scale feature fusion
CN204576547U (en) A kind of chip character check device
CN116485766A (en) A method for detecting and counting imperfect grains based on improved YOLOX
CN117853777A (en) HRNet casting defect identification method based on attention-directed context
JP7375161B2 (en) Learning data creation device, method, program, and recording medium
JP3230218U (en) Defect identification system for paintings
CN113034432A (en) Product defect detection method, system, device and storage medium
JP7052377B2 (en) Inspection equipment and inspection method
TWI721385B (en) Generating synthetic color images of printed circuit boards
CN118447021B (en) Chip defect detection method and device
CN119804496A (en) Battery coating detection method, device and system
Choi et al. A Comparative Study of Transfer Learning–based Methods for Inspection of Mobile Camera Modules

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination