CN116152166A - Defect detection method and related device based on feature correlation - Google Patents

Defect detection method and related device based on feature correlation Download PDF

Info

Publication number
CN116152166A
CN116152166A CN202211592462.8A CN202211592462A CN116152166A CN 116152166 A CN116152166 A CN 116152166A CN 202211592462 A CN202211592462 A CN 202211592462A CN 116152166 A CN116152166 A CN 116152166A
Authority
CN
China
Prior art keywords
circuit board
image
board image
feature
tested
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
CN202211592462.8A
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.)
Shenzhen Smartmore Technology Co Ltd
Original Assignee
Shenzhen Smartmore Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Smartmore Technology Co Ltd filed Critical Shenzhen Smartmore Technology Co Ltd
Priority to CN202211592462.8A priority Critical patent/CN116152166A/en
Publication of CN116152166A publication Critical patent/CN116152166A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/40Analysis of texture
    • G06T7/41Analysis of texture based on statistical description of texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30141Printed circuit board [PCB]

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Probability & Statistics with Applications (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The application provides a defect detection method and a related device based on feature correlation. The method comprises the following steps: acquiring a circuit board image to be tested and a sample circuit board image; extracting first characteristic information of a circuit board image to be detected and second characteristic information of a sample circuit board image; performing defect detection on the circuit board image to be detected based on the correlation characteristic between the first characteristic information and the second characteristic information to obtain a defect detection result; the correlation features are used for representing the same degree of corresponding same areas between the circuit board image to be tested and the sample circuit board image. By adopting the method and the device, the accuracy of PCB defect detection is improved.

Description

基于特征相关性的缺陷检测方法及相关装置Defect detection method and related device based on feature correlation

技术领域technical field

本申请涉及图像处理技术领域,特别是涉及一种基于特征相关性的缺陷检测方法及相关装置。The present application relates to the technical field of image processing, in particular to a defect detection method and related devices based on feature correlation.

背景技术Background technique

随着汽车电子、通讯设备、变压器、电感装置和电源模块等产品在生活中的广泛应用以及电子信息技术、通讯技术的快速发展,市场对高传输、高电压的电子产品提出了更高的要求。而作为电子产品的基础承载部件-印制电路板(Printed circuit board,简称PCB),其性能的优劣直接影响对应电子产品的性能。With the wide application of automotive electronics, communication equipment, transformers, inductance devices, and power modules in daily life, as well as the rapid development of electronic information technology and communication technology, the market has put forward higher requirements for high-transmission, high-voltage electronic products. . As the basic bearing part of electronic products - printed circuit board (Printed circuit board, referred to as PCB), its performance directly affects the performance of corresponding electronic products.

由于PCB在生产过程中无法避免地存在大量的缺陷,并且存在的缺陷主要位于PCB的电路元件处。因此,需要对存在缺陷的电路元件进行检测,以进行后续的PCB修复工作。目前对PCB进行缺陷检测主要是通过自动光学检测(Automated Optical Inspection,AOI)设备利用光学相机采集PCB的图像,并使用图像处理、机器学习等方法,检测和定位出PCB上的缺陷。Because PCBs inevitably have a large number of defects during the production process, and the existing defects are mainly located at the circuit components of the PCB. Therefore, it is necessary to detect defective circuit components for subsequent PCB repair work. At present, the defect detection of PCB is mainly through the automatic optical inspection (Automated Optical Inspection, AOI) equipment to use the optical camera to collect the image of the PCB, and use image processing, machine learning and other methods to detect and locate the defects on the PCB.

然而,由于AOI检测PCB的检测精度以及PCB上缺陷的形状、数量和类型等影响因素,导致一些相似的区域中的缺陷或者未知类型的缺陷不能被检测出,以使得PCB缺陷检测的准确率不高。However, due to the detection accuracy of AOI detection PCB and the shape, quantity and type of defects on the PCB and other influencing factors, defects in some similar areas or unknown types of defects cannot be detected, so that the accuracy of PCB defect detection is not high. high.

发明内容Contents of the invention

基于此,有必要针对上述技术问题,提供一种基于特征相关性的缺陷检测方法及相关装置,能够实现提高对PCB进行缺陷检测的准确率。Based on this, it is necessary to provide a defect detection method based on feature correlation and a related device for the above technical problems, which can improve the accuracy of defect detection on PCBs.

第一方面,本申请提供了一种基于特征相关性的缺陷检测方法,包括:In the first aspect, the present application provides a defect detection method based on feature correlation, including:

获取待测电路板图像和样本电路板图像;Obtain the image of the circuit board to be tested and the image of the sample circuit board;

提取待测电路板图像的第一特征信息和样本电路板图像的第二特征信息;extracting the first characteristic information of the circuit board image to be tested and the second characteristic information of the sample circuit board image;

基于第一特征信息与第二特征信息之间的相关性特征,对待测电路板图像进行缺陷检测,得到缺陷检测结果;其中,相关性特征用于表征待测电路板图像与样本电路板图像之间对应相同区域的相同程度。Based on the correlation feature between the first feature information and the second feature information, defect detection is performed on the image of the circuit board to be tested to obtain a defect detection result; wherein, the correlation feature is used to characterize the relationship between the image of the circuit board to be tested and the image of the sample circuit board between corresponding to the same extent in the same area.

第二方面,本申请还提供了一种基于特征相关性的缺陷检测装置,包括:In the second aspect, the present application also provides a defect detection device based on feature correlation, including:

获取单元,用于获取待测电路板图像和样本电路板图像;An acquisition unit, configured to acquire the image of the circuit board to be tested and the image of the sample circuit board;

提取单元,用于提取待测电路板图像的第一特征信息和样本电路板图像的第二特征信息;An extraction unit, configured to extract the first feature information of the circuit board image to be tested and the second feature information of the sample circuit board image;

检测单元,用于基于第一特征信息与第二特征信息之间的相关性特征,对待测电路板图像进行缺陷检测,得到缺陷检测结果;其中,相关性特征用于表征待测电路板图像与样本电路板图像之间对应相同区域的相同程度。The detection unit is configured to perform defect detection on the image of the circuit board to be tested based on the correlation feature between the first feature information and the second feature information to obtain a defect detection result; wherein the correlation feature is used to characterize the image of the circuit board to be tested and The same degree of correspondence to the same area between sample board images.

第三方面,本申请还提供了一种电子设备,该电子设备包括存储器和处理器,存储器存储有计算机程序,处理器执行计算机程序时实现如上述的基于特征相关性的缺陷检测方法。In a third aspect, the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the defect detection method based on feature correlation as described above is implemented.

第四方面,本申请还提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现如上述的基于特征相关性的缺陷检测方法。In a fourth aspect, the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned defect detection method based on feature correlation is implemented.

第五方面,本申请还提供了一种计算机程序产品,该计算机程序产品包括计算机程序,计算机程序被处理器执行时实现如上述的基于特征相关性的缺陷检测方法。In a fifth aspect, the present application further provides a computer program product, the computer program product includes a computer program, and when the computer program is executed by a processor, the above-mentioned defect detection method based on feature correlation is implemented.

上述基于特征相关性的缺陷检测方法及相关装置,一方面,仅利用待测电路板图像和样本电路板图像的特征信息,确定出两者之间对应区域的相同程度,从而能够易于进行后续PCB的缺陷检测流程,以提升缺陷检测的效率和保证检测的实时性;另一方面,利用待测电路板图像和样本电路板图像之间对应区域的相同程度,来检测待测电路板图像中的缺陷,能够提升PCB缺陷检测的准确率和保证电路板较高的召回率。The above-mentioned defect detection method and related devices based on feature correlation, on the one hand, only use the feature information of the circuit board image to be tested and the sample circuit board image to determine the same degree of corresponding regions between the two, so that it is easy to carry out subsequent PCB Defect detection process to improve the efficiency of defect detection and ensure the real-time detection; Defects can improve the accuracy of PCB defect detection and ensure a high recall rate of circuit boards.

附图说明Description of drawings

图1是本申请实施例提供的一种基于特征相关性的缺陷检测方法的应用环境图;FIG. 1 is an application environment diagram of a defect detection method based on feature correlation provided by an embodiment of the present application;

图2是本申请实施例提供的第一种基于特征相关性的缺陷检测方法的流程示意图;Fig. 2 is a schematic flow chart of the first defect detection method based on feature correlation provided by the embodiment of the present application;

图3是本申请实施例提供的对待测电路板图像进行缺陷检测的流程示意图;Fig. 3 is a schematic flow chart of defect detection on the image of the circuit board to be tested provided by the embodiment of the present application;

图4是本申请实施例提供的确定第一特征信息与第二特征信息之间相关性特征的流程示意图;Fig. 4 is a schematic flowchart of determining the correlation feature between the first characteristic information and the second characteristic information provided by the embodiment of the present application;

图5是本申请实施例提供的对缩放后的待测电路板图像进行缺陷检测的流程示意图;FIG. 5 is a schematic flow diagram of defect detection on a scaled circuit board image to be tested provided by an embodiment of the present application;

图6是本申请实施例提供的对缩放后的待测电路板图像进行缺陷识别和缺陷标注的流程示意图;FIG. 6 is a schematic flow diagram of defect identification and defect labeling for a scaled image of a circuit board to be tested provided by an embodiment of the present application;

图7是本申请实施例提供的第二种基于特征相关性的缺陷检测方法的流程示意图;FIG. 7 is a schematic flowchart of a second defect detection method based on feature correlation provided by an embodiment of the present application;

图8是本申请实施例提供的对缺陷电路板进行更新的流程示意图;FIG. 8 is a schematic flow diagram of updating a defective circuit board provided by an embodiment of the present application;

图9是本申请实施例提供的第三种基于特征相关性的缺陷检测方法的流程示意图;FIG. 9 is a schematic flowchart of a third defect detection method based on feature correlation provided by an embodiment of the present application;

图10是本申请实施例提供的一种基于特征相关性的缺陷检测装置框图;Fig. 10 is a block diagram of a defect detection device based on feature correlation provided by an embodiment of the present application;

图11是本申请实施例提供的一种电子设备的框图;Fig. 11 is a block diagram of an electronic device provided by an embodiment of the present application;

图12是本申请实施例提供的一种计算机可读存储介质的框图;Fig. 12 is a block diagram of a computer-readable storage medium provided by an embodiment of the present application;

图13是本申请实施例提供的一种计算机程序产品的框图。Fig. 13 is a block diagram of a computer program product provided by an embodiment of the present application.

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not intended to limit the present application.

本申请实施例中的术语“和/或”指的是包括相关联的列举项目中的一个或多个的任何和全部的可能组合。还要说明的是:当用在本说明书中时,“包括/包含”指定所陈述的特征、整数、步骤、操作、元件和/或组件的存在,但是不排除一个或多个其他特征、整数、步骤、操作、元件和/或组件和/或它们的组群的存在或添加。The term "and/or" in the embodiments of the present application refers to any and all possible combinations of one or more of the associated listed items. It should also be noted that: when used in this specification, "comprises/comprises" specifies the presence of stated features, integers, steps, operations, elements and/or components, but does not exclude one or more other features, integers , the presence or addition of steps, operations, elements and/or components and/or groups thereof.

本申请中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。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.

另外,本申请中尽管多次采用术语“第一”、“第二”等来描述各种操作(或各种元件或各种应用或各种指令或各种数据)等,不过这些操作(或元件或应用或指令或数据)不应受这些术语的限制。这些术语只是用于区分一个操作(或元件或应用或指令或数据)和另一个操作(或元件或应用或指令或数据)。例如,第一数量的像素特征可以被称为第二数量的像素特征,第二数量的像素特征也可以被称为第一数量的像素特征,仅仅是其两者所包括的范围不同,而不脱离本申请的范围,第一数量的像素特征和第二数量的像素特征都是各种电路板上的相应数量的像素特征集合,只是二者并不是相同的电路板上相应数量的像素特征的集合而已。In addition, although the terms "first", "second" and the like are used many times in this application to describe various operations (or various elements or various applications or various instructions or various data), etc., these operations (or various element or application or instruction or data) should not be limited by these terms. These terms are only used to distinguish one operation (or element or application or instruction or data) from another operation (or element or application or instruction or data). For example, the pixel features of the first quantity can be called the pixel features of the second quantity, and the pixel features of the second quantity can also be called the pixel features of the first quantity, only the scopes of the two are different, and not Out of the scope of the present application, the first number of pixel features and the second number of pixel features are sets of corresponding numbers of pixel features on various circuit boards, but the two are not the corresponding number of pixel features on the same circuit board. Collection only.

本申请实施例提供的基于特征相关性的缺陷检测方法,可以应用于如图1所示的应用环境中。其中,电子设备102通过通信网络与服务器104进行通信。数据存储系统可以存储服务器104需要处理的数据。数据存储系统可以集成在服务器104上,也可以放在云上或其他网络服务器上。The defect detection method based on feature correlation provided in the embodiment of the present application can be applied to the application environment shown in FIG. 1 . Wherein, the electronic device 102 communicates with the server 104 through a communication network. The data storage system can store data that needs to be processed by the server 104 . The data storage system can be integrated on the server 104, or placed on the cloud or other network servers.

在一些实施例中,参考图1,服务器104首先获取待测电路板图像和样本电路板图像;然后,再提取待测电路板图像的第一特征信息和样本电路板图像的第二特征信息;最后,再基于第一特征信息与第二特征信息之间的相关性特征,对待测电路板图像进行缺陷检测,得到缺陷检测结果;其中,相关性特征用于表征待测电路板图像与样本电路板图像之间对应相同区域的相同程度。In some embodiments, referring to FIG. 1, the server 104 first obtains the circuit board image to be tested and the sample circuit board image; then, extracts the first feature information of the circuit board image to be tested and the second feature information of the sample circuit board image; Finally, based on the correlation feature between the first feature information and the second feature information, the defect detection is performed on the image of the circuit board to be tested, and the defect detection result is obtained; where the correlation feature is used to characterize the image of the circuit board to be tested and the sample circuit The same degree of correspondence to the same region between plate images.

在一些实施例中,电子设备102(如移动终端、固定终端)可以以各种形式来实施。其中,电子设备102可为包括诸如移动电话、智能电话、笔记本电脑、便携式手持式设备、个人数字助理(PDA,Personal Digital Assistant)、平板电脑(PAD)等等的可以基于至少两种图像的特征信息之间对应的相关性特征,对电路板图像进行缺陷检测的移动终端,电子设备102也可以是自动柜员机(Automated Teller Machine,ATM)、门禁一体机、数字TV、台式计算机、固式计算机等等的可以基于至少两种图像的特征信息之间对应的相关性特征,对电路板图像进行缺陷检测的固定终端。下面,假设电子设备102是固定终端。然而,本领域技术人员将理解的是,若有特别用于移动目的的操作或者元件,根据本申请公开的实施方式的构造也能够应用于移动类型的电子设备102。In some embodiments, the electronic device 102 (such as a mobile terminal, a fixed terminal) may be implemented in various forms. Among them, the electronic device 102 may include features such as mobile phones, smart phones, notebook computers, portable handheld devices, personal digital assistants (PDA, Personal Digital Assistant), tablet computers (PAD), etc., which may be based on at least two images. Corresponding correlation features between information, the mobile terminal for detecting defects on the circuit board image, and the electronic device 102 can also be an automatic teller machine (Automated Teller Machine, ATM), an access control machine, a digital TV, a desktop computer, a solid-state computer, etc. A fixed terminal capable of detecting defects on circuit board images based on the correlation features corresponding to feature information of at least two images. In the following, it is assumed that the electronic device 102 is a fixed terminal. However, those skilled in the art will understand that the configuration according to the embodiments disclosed in the present application can also be applied to mobile-type electronic devices 102 if there are operations or elements specifically for mobile purposes.

在一些实施例中,服务器104运行的图像处理组件和数据处理组件可以加载正在被执行的可以包括各种附加服务器应用和/或中间层应用中的任何一种,如包括HTTP(超文本传输协议)、FTP(文件传输协议)、CGI(通用网关界面)、RDBMS(关系型数据库管理系统)等。In some embodiments, the image processing component and the data processing component run by the server 104 can load any one of various additional server applications and/or middle-tier applications that are being executed, such as HTTP (Hypertext Transfer Protocol ), FTP (File Transfer Protocol), CGI (Common Gateway Interface), RDBMS (Relational Database Management System), etc.

在一些实施例中,服务器104可以用独立的服务器或者是多个服务器组成的服务器集群来实现。服务器104可以适于运行提供前述公开中描述的电子设备102的一个或多个应用服务或软件组件。In some embodiments, the server 104 may be implemented by an independent server or a server cluster composed of multiple servers. The server 104 may be adapted to run one or more application services or software components that provide the electronic device 102 described in the foregoing disclosure.

在一些实施例中,应用服务可以包括例如用于对待测电路板图像的特征信息和样本电路板图像的特征信息进行提取服务,以及在提取图像的特征信息之后,为用户提供后续对电路板图像进行缺陷检测的服务等等。软件组件可以包括例如具有对电路板图像进行缺陷检测功能的APP或者客户端。In some embodiments, the application service may include, for example, a service for extracting the feature information of the circuit board image to be tested and the feature information of the sample circuit board image, and after extracting the feature information of the image, provide the user with a subsequent circuit board image Services for defect detection, etc. The software component may include, for example, an APP or a client with a defect detection function on a circuit board image.

在一些实施例中,具有对电路板图像进行缺陷检测功能的APP或者客户端包括一个在前台向用户提供一对一应用服务的门户端口和多个位于后台进行数据处理的业务系统,以将缺陷检测功能的应用扩展到APP或者客户端,从而用户能够在任何时间任何地点进行缺陷检测功能的使用和访问。In some embodiments, the APP or client with the function of detecting defects on circuit board images includes a portal port that provides one-to-one application services to users in the foreground and a plurality of business systems that perform data processing in the background to detect defects. The application of the detection function is extended to APP or client, so that users can use and access the defect detection function anytime and anywhere.

在一些实施例中,APP或者客户端的缺陷检测功能可为运行在用户模式以完成某项或多项特定工作的计算机程序,其可以与用户进行交互,且具有可视的用户界面。其中,APP或者客户端可以包括两部分:图形用户接口(GUI)和引擎(engine),利用这两者能够以用户界面的形式向用户提供多种应用服务的数字化客户系统。In some embodiments, the defect detection function of the APP or the client can be a computer program running in the user mode to complete one or more specific tasks, which can interact with the user and has a visual user interface. Wherein, the APP or the client may include two parts: a graphical user interface (GUI) and an engine (engine), which are digital client systems that can provide users with various application services in the form of a user interface.

在一些实施例中,用户可以通过输入装置向APP或者客户端输入相应的代码数据或者控制参数,以执行计算机程序的应用服务,以及显示用户界面中的应用服务。例如,需要对待测电路板图像的特征信息和样本电路板图像的特征信息进行提取时,则用户通过输入装置进行操作以及通过用户界面进行显示。可选地,输入装置可为触屏输入、按键输入、语音输入或瞳孔聚焦输入等等。In some embodiments, the user can input corresponding code data or control parameters to the APP or the client through the input device, so as to execute the application service of the computer program and display the application service in the user interface. For example, when the feature information of the circuit board image to be tested and the feature information of the sample circuit board image need to be extracted, the user operates through the input device and displays through the user interface. Optionally, the input device may be touch screen input, key input, voice input or pupil focus input, and the like.

在一些实施例中,APP或者客户端运行的操作系统可以包括各种版本的Microsoft

Figure BDA0003995231300000061
Apple/>
Figure BDA0003995231300000062
和/或Linux操作系统、各种商用或类/>
Figure BDA0003995231300000063
操作系统(包括但不限于各种GNU/Linux操作系统、Google/>
Figure BDA0003995231300000064
OS等)和/或移动操作系统,诸如
Figure BDA0003995231300000065
Phone、/>
Figure BDA0003995231300000066
OS、/>
Figure BDA0003995231300000067
OS、/>
Figure BDA0003995231300000068
OS操作系统,以及其它在线操作系统或者离线操作系统。In some embodiments, the operating system run by APP or client may include various versions of Microsoft
Figure BDA0003995231300000061
Apple/>
Figure BDA0003995231300000062
and/or Linux operating systems, various commercial or class/>
Figure BDA0003995231300000063
Operating system (including but not limited to various GNU/Linux operating systems, Google/>
Figure BDA0003995231300000064
OS, etc.) and/or mobile operating systems such as
Figure BDA0003995231300000065
Phone, />
Figure BDA0003995231300000066
OS, />
Figure BDA0003995231300000067
OS, />
Figure BDA0003995231300000068
OS operating system, and other online operating systems or offline operating systems.

在一些实施例中,如图2所示,提供了第一种基于特征相关性的缺陷检测方法,以该方法应用于图1中的服务器104为例进行说明,该方法包括以下步骤:In some embodiments, as shown in FIG. 2 , a first defect detection method based on feature correlation is provided. The application of the method to the server 104 in FIG. 1 is used as an example for illustration. The method includes the following steps:

步骤S11,获取待测电路板图像和样本电路板图像。Step S11, acquiring the image of the circuit board to be tested and the image of the sample circuit board.

在一些实施例中,用户通过电子设备中的摄像装置实时采集待测电路板的拍摄图像和样本电路板的拍摄图像,然后,电子设备再将采集的拍摄图像发送至服务器进行后续数据处理。In some embodiments, the user collects the captured images of the circuit board to be tested and the sample circuit board in real time through the camera device in the electronic device, and then the electronic device sends the collected captured images to the server for subsequent data processing.

在一些实施例中,待测电路板的拍摄图像和样本电路板的拍摄图像已经被电子设备中的摄像装置或者其他装置预先拍摄完成且存储在一第三方机构(如,图像数据库、云存储平台等)中,在服务器响应于接收到用户选择的启动获取拍摄图像的指令时,服务器从对应的第三方机构中获取待测电路板图像和样本电路板图像。In some embodiments, the photographed image of the circuit board to be tested and the photographed image of the sample circuit board have been pre-photographed by a camera or other device in the electronic device and stored in a third-party organization (such as an image database, a cloud storage platform) etc.), when the server responds to receiving an instruction selected by the user to start acquiring the captured image, the server acquires the image of the circuit board to be tested and the image of the sample circuit board from the corresponding third-party organization.

在一些实施例中,电子设备中的摄像装置为自动光学检测设备(AutomatedOptical Inspection,AOI)或者为自动视觉检测(automated vision inspection,AVI),其中,AOI或者AVI是集成了图像传感技术、数据处理技术、运动控制技术,其是基于光学原理来对PCB电路板焊接生产中遇到的常见缺陷进行检测的设备。当自动检测时,AOI机器或者AVI机器通过摄像头自动扫描PCB,采集待测电路板的拍摄图像和样本电路板的拍摄图像。In some embodiments, the camera device in the electronic device is an automatic optical inspection device (Automated Optical Inspection, AOI) or an automatic visual inspection (automated vision inspection, AVI), wherein, the AOI or AVI integrates image sensing technology, data Processing technology, motion control technology, which is based on optical principles to detect common defects encountered in PCB circuit board welding production. When automatic detection, the AOI machine or AVI machine automatically scans the PCB through the camera, and collects the captured image of the circuit board to be tested and the captured image of the sample circuit board.

在一些实施例中,AOI机器或者AVI机器自身可搭载有深度相机、3D相机、单目相机或者双目相机等中的一个的图像采集装置,并根据用户的输入,而产生对应的控制信息,以采集待测电路板的拍摄图像和样本电路板的拍摄图像。In some embodiments, the AOI machine or AVI machine itself can be equipped with an image acquisition device of one of a depth camera, a 3D camera, a monocular camera or a binocular camera, and generate corresponding control information according to user input, to collect the photographed image of the circuit board to be tested and the photographed image of the sample circuit board.

在一些实施例中,采集待测电路板的拍摄图像和样本电路板的拍摄图像为PCB(Printed circuit boards,印制电路板)图像。其中,PCB板面分为电路板区域和非电路板区域。In some embodiments, the captured image of the circuit board to be tested and the captured image of the sample circuit board are PCB (Printed circuit boards, printed circuit board) images. Among them, the PCB board surface is divided into a circuit board area and a non-circuit board area.

在一些实施例中,在PCB的电路板区域上具有通过药剂蚀刻的PCB线路,在PCB线路上为细小且密集的电路元件及其尖角(即尖角区域自方形区域的四个直角部位向外凸起,并使方形区域相邻两直线在相互靠近的端部形成相互交叉的倾斜线,两条相邻的倾斜线相互交叉形成尖角;倾斜线称为尖角线段)。由于药剂张力的原因,因此PCB在生产过程中无法避免地存在大量的缺陷(由于制造工艺的原因,在电路板的生产过程中,难免会出现例如:缺孔、鼠式侵蚀、开路、短路、毛刺、铜渣等缺陷),并且PCB线路上的尖角往往为假点尖角(由于尖角的孔口发亮、基材反光、局部被氧化及脏点等原因,在电路元件上会出现较多假点)。因此,AOI机器或者AVI机器采集的待测电路板图像就是为具有各种各样缺陷和尖角的PCB图像。In some embodiments, there are PCB lines etched by chemicals on the circuit board area of the PCB, and on the PCB lines are small and dense circuit elements and their sharp corners (that is, the sharp corner areas extend from the four right angles of the square area to The two adjacent straight lines in the square area form oblique lines that intersect each other at the ends that are close to each other, and two adjacent oblique lines intersect each other to form sharp angles; the oblique lines are called sharp angle segments). Due to the tension of the agent, there are inevitably a large number of defects in the PCB during the production process (due to the manufacturing process, in the production process of the circuit board, it is inevitable that there will be holes, mouse erosion, open circuit, short circuit, etc. burrs, copper slag and other defects), and the sharp corners on the PCB line are often false sharp corners (due to the shiny holes of the sharp corners, the reflection of the substrate, local oxidation and dirty spots, etc. more false points). Therefore, the image of the circuit board to be tested collected by the AOI machine or the AVI machine is a PCB image with various defects and sharp corners.

其中,样本电路板图像即为PCB对应的原理设计图,其相较于PCB图像,其板面上没有缺陷和尖角位置处也没有假点尖角,其为最理想状态的PCB板。Among them, the sample circuit board image is the schematic design drawing corresponding to the PCB. Compared with the PCB image, there are no defects and sharp corners on the board surface, and there are no false points and sharp corners. It is the most ideal PCB board.

步骤S12,提取待测电路板图像的第一特征信息和样本电路板图像的第二特征信息。Step S12, extracting the first characteristic information of the circuit board image to be tested and the second characteristic information of the sample circuit board image.

在一些实施例中,服务器通过预设的神经网络从采集的待测电路板图像中提取出图像的特征信息,以及从样本电路板图像中提取出图像的特征信息。In some embodiments, the server extracts the feature information of the image from the collected image of the circuit board to be tested through a preset neural network, and extracts the feature information of the image from the image of the sample circuit board.

在一些实施例中,待测电路板图像的第一特征信息和样本电路板图像的第二特征信息包括图像的颜色特征、纹理特征、形状特征、空间关系特征等信息。In some embodiments, the first feature information of the circuit board image to be tested and the second feature information of the sample circuit board image include information such as color features, texture features, shape features, and spatial relationship features of the images.

在一些实施例中,服务器首先分别对待测电路板图像和样本电路板图像进行裁剪,然后再使用Harris角点检测方法提取待测电路板图像和样本电路板图像中所有的角点,最后,服务器通过预设的神经网络(如,卷积神经网络、语义分割网络等)对提取的角点进行特征分析,以提取出特征信息。In some embodiments, the server first crops the image of the circuit board to be tested and the image of the sample circuit board, and then uses the Harris corner detection method to extract all the corner points in the image of the circuit board to be tested and the image of the sample circuit board, and finally, the server Feature analysis is performed on the extracted corner points through a preset neural network (eg, convolutional neural network, semantic segmentation network, etc.) to extract feature information.

在一些实施例中,服务器可以将待测电路板图像和样本电路板图像输入一预先训练的卷积神经网络模型中(例如,UNet网络模型、CNN网络模型、RNN网络模型等),以从该卷积神经网络模型中直接得到待测电路板图像和样本电路板图像的特征信息。In some embodiments, the server may input the image of the circuit board to be tested and the image of the sample circuit board into a pre-trained convolutional neural network model (for example, a UNet network model, a CNN network model, a RNN network model, etc.), so as to obtain The feature information of the circuit board image to be tested and the sample circuit board image is directly obtained in the convolutional neural network model.

作为一示例,预先训练的卷积神经网络模型为UNet卷积神经网络。其中,UNet卷积神经网络可以分成两部分,一是特征提取部分,其和其他卷积神经网络一样,都是通过堆叠卷积提取图像特征,通过池化来压缩特征图。另一部分为图像还原部分,通过上采样和卷积来将压缩的图像进行还原。其中,特征提取部分可以使用残差网络结构,例如:Resnet50,VGG等。其中,也可以使用样本平衡损失函数(即focal loss)作为神经网络的损失函数来平衡正负例,最终得到能够输出特征信息的损失函数不再降低的稳定语义分割模型。As an example, the pre-trained convolutional neural network model is a UNet convolutional neural network. Among them, the UNet convolutional neural network can be divided into two parts, one is the feature extraction part, which, like other convolutional neural networks, extracts image features through stacked convolutions, and compresses feature maps through pooling. The other part is the image restoration part, which restores the compressed image through upsampling and convolution. Among them, the feature extraction part can use the residual network structure, such as: Resnet50, VGG, etc. Among them, the sample balance loss function (that is, focal loss) can also be used as the loss function of the neural network to balance positive and negative examples, and finally a stable semantic segmentation model that can output feature information without reducing the loss function is obtained.

步骤S13,基于第一特征信息与第二特征信息之间的相关性特征,对待测电路板图像进行缺陷检测,得到缺陷检测结果。Step S13 , based on the correlation feature between the first feature information and the second feature information, perform defect detection on the image of the circuit board to be tested to obtain a defect detection result.

在一些实施例中,相关性特征用于表征待测电路板图像与样本电路板图像之间对应相同区域的相同程度。In some embodiments, the correlation feature is used to characterize the degree to which the image of the circuit board under test and the image of the sample circuit board correspond to the same region.

在一些实施例中,服务器首先基于待测电路板图像的第一特征信息和样本电路板图像的第二特征信息,确定出待测电路板图像和样本电路板图像之间对应各个相同区域的相关性特征(包括相同区域的相同程度),然后,服务器再根据各个相同区域的相关性特征确定出待测电路板图像上的缺陷信息,以完成对待测电路板图像的缺陷检测。In some embodiments, the server first determines, based on the first feature information of the image of the circuit board to be tested and the second feature information of the image of the sample circuit board, the correlation between the image of the circuit board to be tested and the image of the sample circuit board corresponding to the same areas. Then, the server determines the defect information on the image of the circuit board to be tested according to the correlation characteristics of each same area, so as to complete the defect detection of the image of the circuit board to be tested.

在一些实施例中,相关性特征可以为待测电路板图像和样本电路板图像之间对应各个相同区域的特征相似度。例如,纹理特征的相似度、颜色特征的相似度、形状特征的相似度等等。In some embodiments, the correlation feature may be the feature similarity between the image of the circuit board to be tested and the image of the sample circuit board corresponding to each of the same regions. For example, the similarity of texture features, the similarity of color features, the similarity of shape features and so on.

在一些实施例中,服务器根据待测电路板图像和样本电路板图像之间对应各个相同区域的特征相似度与预设的相似度阈值进行比较,若特征相似度小于相似度阈值,则表明该对应区域的待测电路板图像中包括有缺陷,若特征相似度大于或等于相似度阈值,则表明该对应区域的待测电路板图像中没有缺陷。In some embodiments, the server compares the similarity of features corresponding to the same regions between the image of the circuit board to be tested and the image of the sample circuit board with a preset similarity threshold, and if the similarity of the features is less than the similarity threshold, it indicates that the The image of the circuit board to be tested in the corresponding area includes defects, and if the feature similarity is greater than or equal to a similarity threshold, it indicates that there is no defect in the image of the circuit board to be tested in the corresponding area.

上述基于特征相关性的缺陷检测方法中,一方面,仅利用待测电路板图像和样本电路板图像的特征信息,确定出两者之间对应区域的相同程度,从而能够易于进行后续的缺陷检测流程,以提升缺陷检测的效率和保证检测的实时性;另一方面,利用待测电路板图像和样本电路板图像之间对应区域的相同程度,来检测待测电路板图像中的缺陷,能够提升缺陷检测的准确率和保证电路板较高的召回率。In the above-mentioned defect detection method based on feature correlation, on the one hand, only the feature information of the circuit board image to be tested and the sample circuit board image is used to determine the same degree of corresponding regions between the two, so that subsequent defect detection can be easily performed process to improve the efficiency of defect detection and ensure real-time detection; on the other hand, using the same degree of corresponding areas between the image of the circuit board to be tested and the image of the sample circuit board to detect defects in the image of the circuit board to be tested can be Improve the accuracy of defect detection and ensure a high recall rate of circuit boards.

本领域技术人员可以理解地,在具体实施方式的上述方法中,所揭露的方法可以通过更为具体的方式以实现。例如,上述的基于特征相关性的缺陷检测方法的实施方式仅仅是一种示意性的描述。Those skilled in the art can understand that among the above-mentioned methods in specific implementation manners, the disclosed methods can be implemented in more specific ways. For example, the implementation of the above-mentioned defect detection method based on feature correlation is only a schematic description.

示例性地,对待测电路板图像的特征信息和样本电路板图像的特征信息进行提取的过程等等,其仅仅为一种集合的方式,实际实现时可以有另外的划分方式,例如待测电路板图像的特征信息和样本电路板图像的特征信息可以结合或者可以集合到另一个系统中,或一些特征可以忽略,或不执行。Exemplarily, the process of extracting the feature information of the circuit board image under test and the feature information of the sample circuit board image, etc., is only a collection method, and there may be another division method in actual implementation, such as the circuit under test The feature information of the board image and the feature information of the sample circuit board image can be combined or can be integrated into another system, or some features can be ignored, or not implemented.

在更具体的实施方式中,在服务器实现对待测电路板图像的特征信息和样本电路板图像的特征信息进行提取的过程中,还可以包括需要利用各种插值算法先对待测电路板图像和样本电路板图像进行缩放。随后,再基于缩放后的待测电路板图像和样本电路板图像进行缺陷检测的过程。In a more specific embodiment, in the process that the server implements the extraction of the feature information of the image of the circuit board to be tested and the feature information of the sample circuit board image, it may also include the need to use various interpolation algorithms to firstly extract the image of the circuit board to be tested and the sample The board image is scaled. Subsequently, a defect detection process is performed based on the scaled image of the circuit board to be tested and the image of the sample circuit board.

在一些实施例中,服务器在获取待测电路板图像和样本电路板图像之后,还可以包括:In some embodiments, after the server obtains the image of the circuit board to be tested and the image of the sample circuit board, it may further include:

对待测电路板图像和样本电路板图像进行缩放,得到像素尺寸相同的缩放后的待测电路板图像和样本电路板图像。The image of the circuit board to be tested and the image of the sample circuit board are scaled to obtain the image of the circuit board to be tested and the image of the sample circuit board after scaling with the same pixel size.

在一些实施例中,服务器可以通过插值法来对待测电路板图像和样本电路板图像进行缩放。In some embodiments, the server may scale the image of the circuit board under test and the image of the sample circuit board through an interpolation method.

在一些实施例中,插值算法可以包括自适应插值算法和非自适应插值算法。自适应的方法可以根据插值的内容来改变(例如,图像中包括的尖锐的边缘或者是平滑的纹理),非自适应的方法需要对特征图中所有的像素点都进行同样的缩放处理。其中,非自适应算法包括:最近邻,双线性,双三次,样条,sinc,lanczos等。In some embodiments, interpolation algorithms may include adaptive interpolation algorithms and non-adaptive interpolation algorithms. Adaptive methods can change according to the content of the interpolation (eg, sharp edges or smooth textures included in the image), while non-adaptive methods need to perform the same scaling process on all pixels in the feature map. Among them, non-adaptive algorithms include: nearest neighbor, bilinear, bicubic, spline, sinc, lanczos, etc.

在一些实施例中,由于待测电路板图像和样本电路板图像中对应包括的特征的复杂度不相同,服务器通过插值算法对待测电路板图像和样本电路板图像中的特征使用从0至256(或者更多)的邻近像素进行插值缩放(包括插值扭曲),以得到像素尺寸相同的缩放后的待测电路板图像和样本电路板图像。In some embodiments, since the complexities of the features included in the image of the circuit board to be tested and the image of the sample circuit board are not the same, the server uses an interpolation algorithm for the features in the image of the circuit board to be tested and the image of the sample circuit board to use values ranging from 0 to 256 (or more) adjacent pixels are interpolated and scaled (including interpolated distortion) to obtain the scaled image of the circuit board under test and the image of the sample circuit board with the same pixel size.

在一些实施例中,服务器对待测电路板图像和样本电路板图像中的特征进行插值缩放包含的邻近像素越多,则扭曲或者缩放后的图像越精确,但其消耗的时间也越长。In some embodiments, the server interpolates and scales the features in the test circuit board image and the sample circuit board image, the more adjacent pixels are included, the more accurate the distorted or scaled image is, but the longer it takes.

在一些实施例中,服务器提取待测电路板图像的第一特征信息和样本电路板图像的第二特征信息,具体可以包括:In some embodiments, the server extracts the first characteristic information of the circuit board image to be tested and the second characteristic information of the sample circuit board image, which may specifically include:

提取缩放后的待测电路板图像的第一特征信息和缩放后的样本电路板图像的第二特征信息。The first feature information of the scaled circuit board image to be tested and the second feature information of the scaled sample circuit board image are extracted.

在一些实施例中,服务器通过预设的神经网络从采集的待测电路板图像中提取出图像的特征信息,以及从样本电路板图像中提取出图像的特征信息。In some embodiments, the server extracts the feature information of the image from the collected image of the circuit board to be tested through a preset neural network, and extracts the feature information of the image from the image of the sample circuit board.

在一些实施例中,缩放后的待测电路板图像的第一特征信息和缩放后的样本电路板图像的第二特征信息均包括在图像对应像素点位置的颜色特征、纹理特征、形状特征、空间关系特征中的至少一种。In some embodiments, both the scaled first feature information of the circuit board image to be tested and the scaled second feature information of the sample circuit board image include color features, texture features, shape features, At least one of the spatial relationship features.

在一些实施例中,图像对应像素点位置的空间关系特征用于表征图像的特征信息中对应的一个特征所在像素点位置与邻近特征所在像素点位置的距离和方向关系。In some embodiments, the spatial relationship feature of the corresponding pixel position of the image is used to represent the distance and direction relationship between the corresponding pixel position of a feature and the pixel position of adjacent features in the feature information of the image.

在一些实施例中,图像对应像素点位置的颜色特征包括图像的特征信息中对应的一个特征的外观颜色的像素占比和颜色随距离变换的空间关系。In some embodiments, the color feature of the corresponding pixel position of the image includes the pixel proportion of the appearance color of a corresponding feature in the feature information of the image and the spatial relationship of color transformation with distance.

在一些实施例中,图像对应像素点位置的形状特征包括轮廓特征和区域特征。其中,轮廓特征主要针对图像的特征信息中对应的一个特征的外边界,区域特征主要针对图像的特征信息中对应的整个形状区域。In some embodiments, the shape features corresponding to pixel positions in the image include contour features and area features. Among them, the contour feature is mainly aimed at the outer boundary of a corresponding feature in the feature information of the image, and the region feature is mainly aimed at the entire shape area corresponding to the feature information of the image.

在一些实施例中,参阅图3,图3为本申请中对待测电路板图像进行缺陷检测一实施例的流程示意图。在步骤S13中,服务器基于第一特征信息与第二特征信息之间的相关性特征,对待测电路板图像进行缺陷检测,得到缺陷检测结果,具体可以通过以下方式实现:In some embodiments, referring to FIG. 3 , FIG. 3 is a schematic flow chart of an embodiment of defect detection in an image of a circuit board to be tested in this application. In step S13, the server performs defect detection on the image of the circuit board to be tested based on the correlation feature between the first feature information and the second feature information, and obtains a defect detection result, which can be specifically implemented in the following manner:

步骤S131,确定第一特征信息与第二特征信息之间的相关性特征。Step S131, determining a correlation feature between the first feature information and the second feature information.

在一些实施例中,参阅图4,图4为本申请中确定第一特征信息与第二特征信息之间相关性特征一实施例的流程示意图。在步骤S131中,服务器第一特征信息与第二特征信息之间的相关性特征,具体可以通过以下方式实现:In some embodiments, referring to FIG. 4 , FIG. 4 is a schematic flowchart of an embodiment of determining a correlation feature between first feature information and second feature information in this application. In step S131, the correlation feature between the server's first feature information and the second feature information can be specifically implemented in the following manner:

步骤a1,确定缩放后的待测电路板图像与缩放后的样本电路板图像之间对应相同像素点位置的每一对像素点。Step a1, determining each pair of pixels corresponding to the same pixel position between the scaled image of the circuit board to be tested and the scaled image of the sample circuit board.

在一些实施例中,服务器首先在相同像素尺寸的待测电路板图像和样本电路板图像中,确定出两种图像的像素点位置对应相同的每一对像素点。In some embodiments, the server first determines that the pixel positions of the two images correspond to the same pair of pixel points in the image of the circuit board under test and the image of the sample circuit board with the same pixel size.

步骤a2,基于第一特征信息和第二特征信息,计算每一对像素点对应至少一种特征信息的相似度。Step a2, based on the first feature information and the second feature information, calculate the similarity of each pair of pixel points corresponding to at least one feature information.

在一些实施例中,服务器可通过欧斯距离或余旋距离计算相同像素点位置的每一对像素点对应至少一种特征信息的相似度。In some embodiments, the server may calculate the similarity between each pair of pixel points at the same pixel point position corresponding to at least one feature information by using the Ousian distance or the corotational distance.

其中,在计算出待测电路板图像的像素点A的特征向量和样本电路板图像的像素点B的特征向量之间的欧斯距离或余旋距离之后,再基于欧斯距离或余旋距离确定待测电路板图像的像素点A和样本电路板图像的像素点B对应至少一种特征信息的相似度。Among them, after calculating the eigenvector of the pixel point A of the circuit board image to be tested and the eigenvector of the pixel point B of the sample circuit board image, the Ousian distance or the corotation distance, and then based on the Ousce distance or the corotation distance Determine the similarity between the pixel point A of the image of the circuit board to be tested and the pixel point B of the image of the sample circuit board corresponding to at least one kind of feature information.

步骤S132,根据相关性特征,对缩放后的待测电路板图像进行缺陷检测,得到缺陷检测结果。Step S132 , performing defect detection on the scaled image of the circuit board to be tested according to the correlation feature, and obtaining a defect detection result.

在一些实施例中,参阅图5,图5为本申请中对缩放后的待测电路板图像进行缺陷检测一实施例的流程示意图。在步骤S132中,服务器根据相关性特征,对缩放后的待测电路板图像进行缺陷检测,得到缺陷检测结果,具体可以通过以下方式实现:In some embodiments, referring to FIG. 5 , FIG. 5 is a schematic flowchart of an embodiment of performing defect detection on the scaled image of the circuit board to be tested in the present application. In step S132, the server performs defect detection on the scaled image of the circuit board to be tested according to the correlation feature, and obtains a defect detection result, which can be specifically implemented in the following manner:

步骤a3,确定缩放后的待测电路板图像对应第一数量的像素特征和缩放后的样本电路板图像对应第二数量的像素特征。Step a3, determining that the scaled image of the circuit board to be tested corresponds to the first number of pixel features and the scaled image of the sample circuit board corresponds to the second number of pixel features.

在一些实施例中,在服务器对待测电路板图像和样本电路板图像进行缩放之后,服务器再确定待测电路板图像的特征信息对应在图像上通道数量为第一通道数量的像素点特征,和样本电路板图像的特征信息对应在图像上通道数量为第二通道数量的像素点特征。In some embodiments, after the server scales the image of the circuit board to be tested and the image of the sample circuit board, the server then determines that the feature information of the image of the circuit board to be tested corresponds to the pixel feature whose number of channels on the image is the first number of channels, and The feature information of the image of the sample circuit board corresponds to the features of pixels whose channel number is the second channel number on the image.

作为示例,待测电路板图像的特征信息对应在缩放后的待测电路板图像上具有A1个特征,该A1个特征分布在缩放后的待测电路板图像上占据有A2个像素点,则该A2个像素点即为在图像上通道数量为第一通道数量的像素点特征。样本电路板图像的特征信息对应在缩放后的样本电路板图像上具有B1个特征,该B1个特征分布在缩放后的样本电路板图像上占据有B2个像素点,则该B2个像素点即为在图像上通道数量为第二通道数量的像素点特征。As an example, the feature information of the image of the circuit board to be tested corresponds to A1 features on the image of the circuit board to be tested after zooming, and the A1 features are distributed on the image of the circuit board to be tested after zooming to occupy A2 pixels, then The A2 pixel points are pixel features whose channel number is the first channel number on the image. The feature information of the sample circuit board image corresponds to B1 features on the sample circuit board image after scaling, and the B1 features occupy B2 pixels on the scaled sample circuit board image, then the B2 pixels are is the pixel feature whose channel number is the second channel number on the image.

步骤a4,基于第一数量的像素特征、第二数量的像素特征和每一对像素点对应至少一种特征信息的相似度,对缩放后的待测电路板图像进行缺陷识别和缺陷标注,得到缺陷检测结果。Step a4, based on the first number of pixel features, the second number of pixel features, and the similarity between each pair of pixel points corresponding to at least one feature information, perform defect identification and defect labeling on the scaled circuit board image to be tested, and obtain Defect detection results.

在一些实施例中,参阅图6,图6为本申请中对缩放后的待测电路板图像进行缺陷识别和缺陷标注一实施例的流程示意图。在步骤a4中,服务器基于第一数量的像素特征、第二数量的像素特征和每一对像素点对应至少一种特征信息的相似度,对缩放后的待测电路板图像进行缺陷识别和缺陷标注,得到缺陷检测结果,具体可以通过以下方式实现:In some embodiments, referring to FIG. 6 , FIG. 6 is a schematic flowchart of an embodiment of performing defect identification and defect labeling on the scaled circuit board image to be tested in the present application. In step a4, based on the first number of pixel features, the second number of pixel features, and the similarity between each pair of pixel points corresponding to at least one feature information, the server performs defect identification and defect identification on the scaled image of the circuit board to be tested. Marking to get defect detection results, which can be achieved in the following ways:

步骤b1,基于第一数量的像素特征、第二数量的像素特征和每一对像素点对应至少一种特征信息的相似度,遍历识别缩放后的待测电路板图像中的每一像素点,得到缺陷识别结果。Step b1, based on the first number of pixel features, the second number of pixel features and the similarity between each pair of pixel points corresponding to at least one kind of feature information, traversing and identifying each pixel in the scaled image of the circuit board to be tested, Get the defect recognition result.

在一些实施例中,服务器将待测电路板图像的第一通道数量的像素特征、样本电路板图像的第二通道数量的像素特征和图像对应的至少一种特征信息的相似度输入到一已训练的卷积神经网络模型中对缩放后的待测电路板图像中的每一像素点进行遍历识别是否属于缺陷特征对应的像素点。In some embodiments, the server inputs the pixel features of the first number of channels of the circuit board image to be tested, the pixel features of the second number of channels of the sample circuit board image, and the similarity of at least one feature information corresponding to the image into an established In the trained convolutional neural network model, each pixel in the scaled image of the circuit board to be tested is traversed to identify whether it belongs to the pixel corresponding to the defect feature.

步骤b2:基于缺陷识别结果,标注对应的像素点区域,得到缺陷检测结果。Step b2: Based on the defect identification result, mark the corresponding pixel area to obtain the defect detection result.

在一些实施例中,卷积神经网络模型若遍历识别出缩放后的待测电路板图像中对应的一部分像素点是属于缺陷特征对应的像素点,则卷积神经网络模型对该部分的像素点区域进行标注,最后卷积神经网络模型向服务器输出已标注完成的缩放后的待测电路板图像,以作为缺陷检测结果。In some embodiments, if the convolutional neural network model traverses and recognizes that a part of the pixels corresponding to the scaled circuit board image to be tested belongs to the pixels corresponding to the defect feature, the convolutional neural network model will The area is marked, and finally the convolutional neural network model outputs the marked and scaled image of the circuit board to be tested to the server as the defect detection result.

在一些实施例中,标注完成的缩放后的待测电路板图像中包括卷积神经网络模型通过框选或者添加特定颜色的方式,对属于缺陷特征对应的像素点区域进行的标注,并且在标注区域的邻近区域还标注有属于缺陷特征对应的像素点区域的位置信息。In some embodiments, the scaled image of the circuit board to be tested after the labeling includes the convolutional neural network model marking the pixel area corresponding to the defect feature by means of frame selection or adding a specific color, and the labeling The adjacent area of the area is also marked with the position information of the pixel point area corresponding to the defect feature.

在一些实施例中,如图7所示,提供了第二种基于特征相关性的缺陷检测方法,以该方法应用于图1中的服务器104为例进行说明,该方法包括以下步骤:In some embodiments, as shown in FIG. 7 , a second defect detection method based on feature correlation is provided. Taking the application of the method to the server 104 in FIG. 1 as an example for illustration, the method includes the following steps:

步骤S21,利用样本电路板图像,遍历缩放后的待测电路板图像和样本电路板图像之间对应相同区域的相似度是否满足预设阈值。Step S21 , using the sample circuit board image, traverse whether the similarity between the scaled circuit board image to be tested and the sample circuit board image corresponding to the same area satisfies a preset threshold.

在一些实施例中,样本电路板图像为预设的无缺陷电路板的采集图像和待测电路板的设计图像中的任意一种。其中,待测电路板的设计图像中为设计的无缺陷电路板的图像。In some embodiments, the sample circuit board image is any one of a preset collected image of a non-defective circuit board and a design image of the circuit board to be tested. Wherein, the design image of the circuit board to be tested is an image of a designed circuit board without defects.

在一些实施例中,服务器将设计为无缺陷的样本电路板图像去遍历匹配相同像素尺寸的待测电路板图像的每一个相同的区域。其中,匹配的过程包括确定其每一个相同的区域的相似度是否满足预设阈值。In some embodiments, the server will design a defect-free sample circuit board image to traverse every identical region of the test circuit board image matching the same pixel size. Wherein, the matching process includes determining whether the similarity of each of the same regions satisfies a preset threshold.

步骤S22,若不满足预设阈值,则在缩放后的待测电路板图像中,标注对应于不满足预设阈值的图像区域,作为缩放后的待测电路板图像中的缺陷区域。Step S22 , if the preset threshold is not met, mark the image area corresponding to the image area not satisfying the preset threshold in the zoomed image of the circuit board to be tested as a defect area in the zoomed image of the circuit board to be tested.

在一些实施例中,服务器若确定出在待测电路板图像的至少一部分的区域中与样本电路板图像对应相同的区域的相似度不满足预设阈值要求,则服务器在缩放后的待测电路板图像中对该至少一部分的区域进行标注,并将标注后的区域作为待测电路板图像中的缺陷区域。In some embodiments, if the server determines that the similarity of at least a part of the image of the circuit board to be tested corresponds to the same area as the sample circuit board image does not meet the preset threshold requirements, the server will The at least a part of the area is marked in the board image, and the marked area is used as a defect area in the image of the circuit board to be tested.

在一些实施例中,样本电路板图像可以为预设的缺陷电路板的采集图像。其中,缺陷电路板为设计工程师预先在电路板上制作有多种已知缺陷的电路板,即该样本电路板可以视为一个缺陷样本模板。In some embodiments, the sample circuit board image may be a preset collected image of a defective circuit board. Wherein, the defective circuit board is a circuit board with multiple known defects fabricated on the circuit board by the design engineer in advance, that is, the sample circuit board can be regarded as a defect sample template.

在一些实施例中,服务器可以利用缺陷电路板的采集图像,遍历缩放后的待测电路板图像中的每一像素点区域,标注缩放后的待测电路板图像中与采集图像相匹配的图像区域,作为缩放后的待测电路板图像中的缺陷区域。In some embodiments, the server can use the captured image of the defective circuit board to traverse each pixel area in the zoomed image of the circuit board to be tested, and mark the image in the zoomed image of the circuit board to be tested that matches the captured image region, as the defect region in the scaled image of the circuit board under test.

具体地,服务器将设计为缺陷样本模板的样本电路板图像去遍历匹配相同像素尺寸的缩放后的待测电路板图像的每一个相同的区域。其中,匹配的过程包括确定其每一个相同的区域的相似度是否满足预设阈值。Specifically, the server uses the sample circuit board image designed as a defect sample template to traverse each same area of the scaled circuit board image to be tested that matches the same pixel size. Wherein, the matching process includes determining whether the similarity of each of the same regions satisfies a preset threshold.

进一步地,服务器若确定出在缩放后的待测电路板图像的至少一部分的区域中与样本电路板图像对应相同的区域的相似度满足预设阈值要求,则服务器在缩放后的待测电路板图像中对该至少一部分的区域进行标注,并将标注后的区域作为待测电路板图像中的缺陷区域。Further, if the server determines that the similarity of at least a part of the image of the circuit board under test after zooming corresponds to the same area as the image of the sample circuit board satisfies the preset threshold requirement, then the server At least a part of the area is marked in the image, and the marked area is used as a defect area in the image of the circuit board to be tested.

在一些实施例中,参阅图8,图8为本申请中对缺陷电路板进行更新一实施例的流程示意图。在服务器标注缩放后的待测电路板图像中与采集图像相匹配的图像区域之后,具体还可以进行以下的实现过程:In some embodiments, referring to FIG. 8 , FIG. 8 is a schematic flowchart of an embodiment of updating a defective circuit board in the present application. After the server marks the image area that matches the captured image in the scaled image of the circuit board to be tested, the following implementation process can also be carried out specifically:

步骤c1,提取与采集图像相匹配的图像区域。Step c1, extracting image regions matching the collected images.

在一些实施例中,服务器在缩放后的待测电路板图像中将标注的与采集图像相匹配的图像区域提取出来。In some embodiments, the server extracts the marked image region that matches the collected image from the zoomed image of the circuit board to be tested.

步骤c2,对提取的图像区域进行翻转、旋转、放大、缩小、色度调整中的一种或多种图像处理,得到多个扩展图像区域。Step c2, performing one or more image processing of flipping, rotating, zooming in, zooming out, and chroma adjustment on the extracted image area to obtain a plurality of extended image areas.

在一些实施例中,服务器可以通过自身设备搭载的图像处理程序,或者光学检测设备将提取出的多个图像区域生成为对应的多个待训练图像,并发送至第三方机构(如,图像处理平台、云端服务器等),以对该多个待训练图像进行翻转、旋转、放大、缩小、色度调整中的一种或多种图像处理,以得到多个扩展图像区域。In some embodiments, the server can use the image processing program carried by its own equipment, or the optical detection device to generate the extracted multiple image regions into corresponding multiple images to be trained, and send them to a third-party organization (such as image processing platform, cloud server, etc.), to perform one or more image processing in flipping, rotating, zooming in, zooming out, and chroma adjustment to the multiple images to be trained to obtain multiple extended image regions.

步骤c3,利用多个扩展图像区域对预设的缺陷电路板进行更新。Step c3, using multiple extended image areas to update the preset defective circuit board.

在一些实施例中,服务器将得到的多个扩展图像区域添加到设计为缺陷样本模板的样本电路板图像中,以更新该样本电路板图像。其中,该样本电路板图像可以有一张也可以有多张,即得到的多个扩展图像区域可以部分添加到一张样本电路板图像中,另一部分添加到其他的多张样本电路板图像中。这里对预设的缺陷电路板进行更新的具体方式步骤具体限定。In some embodiments, the server adds the obtained plurality of extended image regions to the sample circuit board image designed as a defect sample template, so as to update the sample circuit board image. There can be one or more than one sample circuit board image, that is, the obtained multiple extended image regions can be partially added to one sample circuit board image, and another part can be added to other multiple sample circuit board images. The specific manner and steps of updating the preset defective circuit board are specifically defined here.

为了更清晰阐明本公开实施例提供的基于特征相关性的缺陷检测方法,以下以一个具体的实施例对该基于特征相关性的缺陷检测方法进行具体说明。在一示例性实施例中,参考图9,图9为本申请实施例提供的第二种基于特征相关性的缺陷检测方法的流程图,该基于特征相关性的缺陷检测方法用于服务器104中,具体包括如下内容:In order to more clearly illustrate the defect detection method based on the feature correlation provided by the embodiment of the present disclosure, the defect detection method based on the feature correlation will be described in detail below with a specific embodiment. In an exemplary embodiment, refer to FIG. 9. FIG. 9 is a flow chart of the second defect detection method based on feature correlation provided by the embodiment of the present application. The defect detection method based on feature correlation is used in the server 104. , including the following:

步骤S31:服务器提取缺陷图的特征信息和标准图的特征信息。Step S31: The server extracts the feature information of the defect map and the feature information of the standard map.

其中,服务器通过AOI对PCB板进行拍照取像,得到缺陷图的AOI图像。或者通过AVI对PCB板进行拍照取像,得到缺陷图的AVI图像。待检测的缺陷图图像可以是黑白的,也可以是彩色的。Wherein, the server takes pictures of the PCB board through the AOI to obtain the AOI image of the defect map. Or take pictures of the PCB board through AVI to get the AVI image of the defect map. The defect map image to be detected can be black and white or color.

其中,服务器通过神经网络分别提取出缺陷图和标准图的特征信息,示例性地,服务器可以利用卷积神经网络对缺陷图和标准图进行特征提取,得到缺陷图和标准图对应的特征图,以作为缺陷图和标准图对应的特征信息。Wherein, the server extracts the feature information of the defect map and the standard map through the neural network, for example, the server can use the convolutional neural network to perform feature extraction on the defect map and the standard map, and obtain the feature map corresponding to the defect map and the standard map, As the feature information corresponding to the defect map and the standard map.

其中,标准图指的是该缺陷图对应的没有缺陷的母图,可以是设计图或者是CAM图。Wherein, the standard drawing refers to the defect-free parent drawing corresponding to the defect drawing, which may be a design drawing or a CAM drawing.

其中,特征提取指的是使用计算机提取图像信息,决定每个图像的点是否属于一个图像特征。特征提取的结果是把图像上的点分为不同的子集,这些子集往往属于孤立的点、连续的曲线或者连续的区域。常用的图像特征有颜色特征、纹理特征、形状特征、空间关系特征。Among them, feature extraction refers to using a computer to extract image information and determine whether each image point belongs to an image feature. The result of feature extraction is to divide the points on the image into different subsets, which often belong to isolated points, continuous curves or continuous areas. Commonly used image features include color features, texture features, shape features, and spatial relationship features.

本申请实施例对待检测的AOI图像、黑白AVI图像和彩色AVI图像进行特征提取,其中,可以用不同的网络来提取不同的特征。In this embodiment of the present application, feature extraction is performed on the AOI image to be detected, the black and white AVI image, and the color AVI image, wherein different networks may be used to extract different features.

示例性地,提取出的特征包括图像的颜色特征和形状特征。可以用颜色相关图来对颜色特征进行表示,颜色相关图是图像颜色分布的另一种表达方式,不但刻画了某种颜色的像素占比,还表达了颜色随距离变换的空间关系,反映了颜色之间的空间关系。形状特征有两类表示方法,一类是轮廓特征,另一类是区域特征。图像的轮廓特征主要针对物体的外边界,而图像的区域特征则关系到整个形状区域。本申请对具体的特征表示方法不做限定。Exemplarily, the extracted features include image color features and shape features. Color features can be represented by a color correlation map, which is another way of expressing the color distribution of an image. It not only depicts the proportion of pixels of a certain color, but also expresses the spatial relationship of color changes with distance, reflecting the The spatial relationship between colors. There are two types of representation methods for shape features, one is contour features and the other is area features. The contour feature of the image is mainly aimed at the outer boundary of the object, while the regional feature of the image is related to the entire shape area. This application does not limit the specific feature representation method.

步骤S32:服务器将缺陷图和标准图的特征信息对应的特征图缩放到相同尺寸。Step S32: The server scales the feature maps corresponding to the feature information of the defect map and the standard map to the same size.

其中,服务器将缺陷图和标准图对应的特征图作为缺陷图和标准图的特征信息。Wherein, the server uses the feature maps corresponding to the defect map and the standard map as feature information of the defect map and the standard map.

在一些实施例中,服务器可以通过插值法来对二者的特征图进行缩放。其中,插值算法可以包括两类:自适应类和非自适应类。自适应的方法可以根据插值的内容来改变(例如,特征图中包括的尖锐的边缘或者是平滑的纹理),非自适应的方法需要对特征图中所有的像素点都进行同样的缩放处理。In some embodiments, the server may scale the feature maps of the two through an interpolation method. Among them, the interpolation algorithm may include two types: adaptive type and non-adaptive type. Adaptive methods can change according to the content of the interpolation (for example, sharp edges or smooth textures included in the feature map), and non-adaptive methods need to perform the same scaling process on all pixels in the feature map.

其中,非自适应算法包括:最近邻,双线性,双三次,样条,sinc,lanczos等。Among them, non-adaptive algorithms include: nearest neighbor, bilinear, bicubic, spline, sinc, lanczos, etc.

其中,由于缺陷图和标准图对应的特征图的复杂度不相同,服务器通过插值算法对特征图中的特征使用从0至256(或者更多)邻近像素,即对特征进行插值包含的邻近像素越多,则扭曲或者缩放后的图像越精确,但是花费的时间也越长。Among them, because the complexity of the feature map corresponding to the defect map and the standard map is not the same, the server uses an interpolation algorithm for the features in the feature map from 0 to 256 (or more) adjacent pixels, that is, the adjacent pixels included in the feature interpolation The more, the more accurate the warped or scaled image, but the longer it takes.

步骤S33:服务器根据缩放尺寸后的特征图,计算缺陷图和标准图对应特征图中每个像素上的相关性特征。Step S33: The server calculates the correlation feature of each pixel in the feature map corresponding to the defect map and the standard map according to the scaled feature map.

其中,每个像素上的相关性特征包括缺陷图和标准图对应相同像素上的余弦相似度。Among them, the correlation feature on each pixel includes the cosine similarity on the same pixel corresponding to the defect map and the standard map.

其中,余弦相似度通过测量两个向量内积空间的余弦值来度量它们之间的相似性,适用于任何维度的向量比较中,因此属于高维空间应用较多的机器学习算法。其中,数字图像包含的特征码较多,这些特征组属于高维空间,服务器将每个图像的特征组转化为高维空间的向量,两个向量之间的角度的余弦值可用于确定两个向量是否大致指向相同的方向。Among them, the cosine similarity measures the similarity between two vector inner product spaces by measuring the cosine value between them, and is applicable to vector comparisons of any dimension, so it belongs to the machine learning algorithm that is widely used in high-dimensional spaces. Among them, digital images contain many feature codes, and these feature groups belong to high-dimensional space. The server converts the feature groups of each image into vectors in high-dimensional space, and the cosine value of the angle between two vectors can be used to determine two Whether the vectors point roughly in the same direction.

本申请实施例中通过计算代表每个像素特征的向量的内积空间的夹角余弦值,从而确定每个像素上的相关性特征。In the embodiment of the present application, the correlation feature on each pixel is determined by calculating the cosine value of the angle included in the inner product space of the vector representing the feature of each pixel.

步骤S34:服务器将包含每个像素的相关性特征输入到训练好的神经网络中进行缺陷检测,以输出缺陷检测的结果。Step S34: The server inputs the correlation feature including each pixel into the trained neural network for defect detection, and outputs the result of defect detection.

其中,缺陷检测的结果包括缺陷图中缺陷的类型、大小、位置等检测结果信息。Wherein, the defect detection result includes detection result information such as the type, size, and position of the defect in the defect map.

其中,服务器将经过缩放处理后(缩放后,图像的尺寸为原图的四分一或者八分之一)的缺陷图和标准图对应相同像素上的相关性特征,和对应图像的特征通道数(256个、512个)共同输入神经网络中进行缺陷检测,以输出尺寸相同的且带有检测标注的一张新的缺陷图的特征图,该新的缺陷图的特征图即为缺陷检测的结果。Among them, the server will correspond to the correlation features on the same pixel of the defect map and the standard map after zooming (after zooming, the size of the image is one-quarter or one-eighth of the original image), and the number of feature channels of the corresponding image (256 , 512) are jointly input into the neural network for defect detection, to output a feature map of a new defect map with the same size and with detection labels, and the feature map of the new defect map is the result of defect detection.

作为一示例,服务器对缺陷图提取出A个(通道)特征,标准图提取出B个(通道)特征,像素的相似度特征作为1个(通道)特征,最后,服务器将这A+B+1个(通道)特征输入到神经网络中进行对比、判断的计算过程,以得出得出缺陷结果。As an example, the server extracts A (channel) features from the defect map, extracts B (channel) features from the standard map, and uses the pixel similarity feature as one (channel) feature. Finally, the server takes the A+B+ One (channel) feature is input into the neural network for comparison and judgment calculation process to obtain the defect result.

应该理解的是,虽然图2-图9的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2-图9中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flow charts of FIGS. 2-9 are shown sequentially as indicated by the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in FIGS. 2-9 may include multiple steps or stages. These steps or stages are not necessarily performed at the same time, but may be performed at different times. These steps or stages The execution sequence is not necessarily performed sequentially, but may be performed alternately or alternately with other steps or at least a part of steps or stages in other steps.

可以理解的是,本说明书中上述方法的各个实施例之间相同/相似的部分可互相参见,每个实施例重点说明的是与其他实施例的不同之处,相关之处参见其他方法实施例的说明即可。It can be understood that the same/similar parts between the various embodiments of the above-mentioned methods in this specification can be referred to each other, and each embodiment focuses on the differences from other embodiments, and for relevant parts, refer to other method embodiments description of the .

图10是本申请实施例提供的一种基于特征相关性的缺陷检测装置框图。参照图10,该基于特征相关性的缺陷检测装置10包括:Fig. 10 is a block diagram of a defect detection device based on feature correlation provided by an embodiment of the present application. Referring to Fig. 10, the defect detection device 10 based on feature correlation includes:

获取单元11,用于获取待测电路板图像和样本电路板图像;An acquisition unit 11, configured to acquire an image of a circuit board to be tested and a sample circuit board image;

提取单元12,用于提取待测电路板图像的第一特征信息和样本电路板图像的第二特征信息;An extraction unit 12, configured to extract the first feature information of the circuit board image to be tested and the second feature information of the sample circuit board image;

检测单元13,用于基于第一特征信息与第二特征信息之间的相关性特征,对待测电路板图像进行缺陷检测,得到缺陷检测结果;其中,相关性特征用于表征待测电路板图像与样本电路板图像之间对应相同区域的相同程度。The detection unit 13 is configured to perform defect detection on the image of the circuit board to be tested based on the correlation feature between the first feature information and the second feature information to obtain a defect detection result; wherein the correlation feature is used to characterize the image of the circuit board to be tested The same degree that corresponds to the same area between the sample board images.

在一些实施例中,在获取待测电路板图像和样本电路板图像之后,该基于特征相关性的缺陷检测装置10还具体用于:In some embodiments, after acquiring the image of the circuit board to be tested and the image of the sample circuit board, the defect detection device 10 based on feature correlation is further specifically used for:

对待测电路板图像和样本电路板图像进行缩放,得到像素尺寸相同的缩放后的待测电路板图像和样本电路板图像。The image of the circuit board to be tested and the image of the sample circuit board are scaled to obtain the image of the circuit board to be tested and the image of the sample circuit board after scaling with the same pixel size.

在一些实施例中,在提取待测电路板图像的第一特征信息和样本电路板图像的第二特征信息方面,该提取单元12具体用于:In some embodiments, in terms of extracting the first feature information of the circuit board image to be tested and the second feature information of the sample circuit board image, the extraction unit 12 is specifically used for:

提取缩放后的待测电路板图像的第一特征信息和缩放后的样本电路板图像的第二特征信息。The first feature information of the scaled circuit board image to be tested and the second feature information of the scaled sample circuit board image are extracted.

在一些实施例中,在基于第一特征信息与第二特征信息之间的相关性特征,对待测电路板图像进行缺陷检测,得到缺陷检测结果方面,该检测单元13具体用于:In some embodiments, the detection unit 13 is specifically configured to:

确定第一特征信息与第二特征信息之间的相关性特征;determining a correlation feature between the first feature information and the second feature information;

根据相关性特征,对缩放后的待测电路板图像进行缺陷检测,得到缺陷检测结果。According to the correlation feature, defect detection is carried out on the scaled image of the circuit board to be tested, and the defect detection result is obtained.

在一些实施例中,在确定第一特征信息与第二特征信息之间的相关性特征方面,该检测单元13具体用于:In some embodiments, in terms of determining the correlation feature between the first feature information and the second feature information, the detection unit 13 is specifically configured to:

确定缩放后的待测电路板图像与缩放后的样本电路板图像之间对应相同像素点位置的每一对像素点;Determining each pair of pixels corresponding to the same pixel position between the scaled circuit board image to be tested and the scaled sample circuit board image;

基于第一特征信息和第二特征信息,计算每一对像素点对应至少一种特征信息的相似度。Based on the first feature information and the second feature information, the similarity of each pair of pixel points corresponding to at least one feature information is calculated.

其中,第一特征信息和第二特征信息均包括在图像对应像素点位置的颜色特征、纹理特征、形状特征、空间关系特征中的至少一种。Wherein, both the first feature information and the second feature information include at least one of color features, texture features, shape features, and spatial relationship features at corresponding pixel positions of the image.

在一些实施例中,在根据相关性特征,对缩放后的待测电路板图像进行缺陷检测,得到缺陷检测结果方面,该检测单元13具体用于:In some embodiments, the detection unit 13 is specifically used to:

确定缩放后的待测电路板图像对应第一数量的像素特征和缩放后的样本电路板图像对应第二数量的像素特征;Determining that the scaled circuit board image to be tested corresponds to the first number of pixel features and the scaled sample circuit board image corresponds to the second number of pixel features;

基于第一数量的像素特征、第二数量的像素特征和每一对像素点对应至少一种特征信息的相似度,对缩放后的待测电路板图像进行缺陷识别和缺陷标注,得到缺陷检测结果。Based on the first number of pixel features, the second number of pixel features, and the similarity between each pair of pixel points corresponding to at least one feature information, perform defect identification and defect labeling on the scaled image of the circuit board to be tested to obtain a defect detection result .

在一些实施例中,在基于第一数量的像素特征、第二数量的像素特征和每一对像素点对应至少一种特征信息的相似度,对缩放后的待测电路板图像进行缺陷识别和缺陷标注,得到缺陷检测结果方面,该检测单元13具体用于:In some embodiments, based on the first number of pixel features, the second number of pixel features, and the similarity between each pair of pixel points corresponding to at least one feature information, the zoomed image of the circuit board to be tested is used for defect identification and In terms of defect labeling and defect detection results, the detection unit 13 is specifically used for:

基于第一数量的像素特征、第二数量的像素特征和每一对像素点对应至少一种特征信息的相似度,遍历识别缩放后的待测电路板图像中的每一像素点,得到缺陷识别结果;Based on the first number of pixel features, the second number of pixel features and the similarity between each pair of pixel points corresponding to at least one feature information, traverse and identify each pixel in the scaled circuit board image to be tested to obtain defect identification result;

基于缺陷识别结果,标注对应的像素点区域,得到缺陷检测结果。Based on the defect recognition result, the corresponding pixel area is marked to obtain the defect detection result.

在一些实施例中,该基于特征相关性的缺陷检测装置10具体还用于:In some embodiments, the defect detection device 10 based on feature correlation is also specifically used for:

利用样本电路板图像,遍历缩放后的待测电路板图像和样本电路板图像之间对应相同区域的相似度是否满足预设阈值;Using the sample circuit board image, traversing whether the similarity between the scaled circuit board image to be tested and the sample circuit board image corresponding to the same area satisfies a preset threshold;

若不满足预设阈值,则在缩放后待测电路板图像中,标注对应于不满足预设阈值的图像区域,作为缩放后待测电路板图像中的缺陷区域。If the preset threshold value is not satisfied, in the image of the circuit board to be tested after zooming, mark the image area corresponding to the image area not satisfying the preset threshold value as a defective area in the image of the circuit board to be tested after zooming.

其中,样本电路板图像为预设的无缺陷电路板的采集图像和待测电路板的设计图像中的任意一种。Wherein, the sample circuit board image is any one of a preset collected image of a non-defective circuit board and a design image of the circuit board to be tested.

在一些实施例中,该基于特征相关性的缺陷检测装置10具体还用于:In some embodiments, the defect detection device 10 based on feature correlation is also specifically used for:

利用缺陷电路板的采集图像,遍历缩放后待测电路板图像中的每一像素点区域,标注缩放后待测电路板图像中与采集图像相匹配的图像区域,作为缩放后待测电路板图像中的缺陷区域。Use the captured image of the defective circuit board to traverse each pixel area in the image of the circuit board under test after zooming, and mark the image area in the image of the circuit board under test after zooming that matches the collected image, as the image of the circuit board under test after zooming defect area in .

其中,样本电路板图像为预设的缺陷电路板的采集图像。Wherein, the sample circuit board image is a preset collected image of a defective circuit board.

在一些实施例中,该基于特征相关性的缺陷检测装置10具体还用于:In some embodiments, the defect detection device 10 based on feature correlation is also specifically used for:

在标注缩放后待测电路板图像中与采集图像相匹配的图像区域之后,提取与采集图像相匹配的图像区域;After marking the image area matching the collected image in the image of the circuit board to be tested after scaling, extracting the image area matching the collected image;

对提取的图像区域进行翻转、旋转、放大、缩小、色度调整中的一种或多种图像处理,得到多个扩展图像区域;Perform one or more image processings of flipping, rotating, zooming in, zooming out, and chroma adjustment on the extracted image area to obtain multiple extended image areas;

利用多个扩展图像区域对预设的缺陷电路板进行更新。Preset defective boards are updated with multiple extended image areas.

关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the apparatus in the foregoing embodiments, the specific manner in which each module executes operations has been described in detail in the embodiments related to the method, and will not be described in detail here.

图11是本申请实施例提供的一种电子设备20的框图。例如,电子设备20可以为服务器。参照图11,电子设备20包括处理器21,其进一步处理器21可以为处理器集合,其可以包括一个或多个处理器,以及电子设备20包括由存储器22所代表的存储器资源,其中,存储器22上存储有计算机程序,例如应用程序。在存储器22中存储的计算机程序可以包括一个或一个以上的每一个对应于一组可执行指令的模块。此外,处理组件21被配置为执行计算机程序时实现如上述的基于特征相关性的缺陷检测方法。FIG. 11 is a block diagram of an electronic device 20 provided by an embodiment of the present application. For example, electronic device 20 may be a server. Referring to FIG. 11 , the electronic device 20 includes a processor 21, further the processor 21 may be a set of processors, which may include one or more processors, and the electronic device 20 includes a memory resource represented by a memory 22, wherein the memory Computer programs, such as application programs, are stored on 22 . The computer program stored in memory 22 may include one or more modules each corresponding to a set of executable instructions. In addition, the processing component 21 is configured to implement the defect detection method based on feature correlation as described above when executing the computer program.

在一些实施例中,电子设备20为服务器,该服务器中的计算系统可以运行一个或多个操作系统,包括以上讨论的任何操作系统以及任何商用的服务器操作系统。该服务器还可以运行各种附加服务器应用和/或中间层应用中的任何一种,包括HTTP(超文本传输协议)服务器、FTP(文件传输协议)服务器、CGI(通用网关界面)服务器、服务器、数据库服务器等。示例性数据库服务器包括但不限于可从(国际商业机器)等商购获得的数据库服务器。In some embodiments, electronic device 20 is a server in which a computing system can run one or more operating systems, including any of the operating systems discussed above as well as any commercially available server operating systems. The server can also run any of a variety of additional server applications and/or middle-tier applications, including HTTP (Hypertext Transfer Protocol) servers, FTP (File Transfer Protocol) servers, CGI (Common Gateway Interface) servers, servers, database server etc. Exemplary database servers include, but are not limited to, those commercially available from (International Business Machines) and the like.

在一些实施例中,处理组件21通常控制电子设备20的整体操作,诸如与显示、数据处理、数据通信和记录操作相关联的操作。处理组件21可以包括一个或多个处理器来执行计算机程序,以完成上述的方法的全部或部分步骤。此外,处理组件21可以包括一个或多个模块,便于处理组件21和其他组件之间的交互。例如,处理组件21可以包括多媒体模块,以方便利用多媒体组件控制用户电子设备和处理组件21之间的交互。In some embodiments, processing component 21 generally controls the overall operation of electronic device 20, such as operations associated with display, data processing, data communication, and recording operations. The processing component 21 may include one or more processors to execute computer programs, so as to complete all or part of the steps of the above method. Additionally, processing component 21 may include one or more modules to facilitate interaction between processing component 21 and other components. For example, the processing component 21 may include a multimedia module to facilitate the use of the multimedia component to control the interaction between the user electronic device and the processing component 21 .

在一些实施例中,处理组件21中的处理器还可以称为CPU(Central ProcessingUnit,中央处理单元)。处理器可能是一种电子芯片,具有信号的处理能力。处理器还可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、专用集成电路(ApplicationSpecific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable GateArray,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。另外,处理器可以由集成电路芯片共同实现。In some embodiments, the processor in the processing component 21 may also be called a CPU (Central Processing Unit, central processing unit). A processor may be an electronic chip with signal processing capabilities. The processor can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array ( Field-Programmable GateArray, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like. In addition, the processors may be jointly implemented by integrated circuit chips.

在一些实施例中,存储器22被配置为存储各种类型的数据以支持在电子设备20的操作。这些数据的示例包括用于在电子设备20上操作的任何应用程序或方法的指令、采集数据、消息、图片、视频等。存储器22可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM)、电可擦除可编程只读存储器(EEPROM)、可擦除可编程只读存储器(EPROM)、可编程只读存储器(PROM)、只读存储器(ROM)、磁存储器、快闪存储器、磁盘、光盘或石墨烯存储器。In some embodiments, memory 22 is configured to store various types of data to support operations at electronic device 20 . Examples of such data include instructions, collected data, messages, pictures, videos, etc. for any application or method operating on the electronic device 20 . The memory 22 can be implemented by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic Disk, Optical Disk or Graphene Memory.

在一些实施例中,存储器22可以为内存条、TF卡等,可以存储电子设备20中的全部信息,包括输入的原始数据、计算机程序、中间运行结果和最终运行结果都保存在在一实施例中,存储器22中。它根据处理器指定的位置存入和取出信息。有了在一实施例中,存储器22,电子设备20才有记忆功能,才能保证正常工作。电子设备20的在一实施例中,存储器22按用途可分为主存储器(内存)和辅助存储器(外存),也有分为外部存储器和内部存储器的分类方法。外存通常是磁性介质或光盘等,能长期保存信息。内存指主板上的存储部件,用来存放当前正在执行的数据和程序,但仅用于暂时存放程序和数据,关闭电源或断电,数据会丢失。In some embodiments, the memory 22 can be a memory stick, a TF card, etc., and can store all information in the electronic device 20, including input raw data, computer programs, intermediate running results and final running results are all stored in an embodiment In, in the memory 22. It stores and retrieves information from locations specified by the processor. With the memory 22 in one embodiment, the electronic device 20 has a memory function to ensure normal operation. In one embodiment of the electronic device 20, the memory 22 can be divided into main memory (internal memory) and auxiliary memory (external memory) according to the purpose, and there are also classification methods for external memory and internal memory. External storage is usually magnetic media or optical discs, which can store information for a long time. Memory refers to the storage unit on the motherboard, which is used to store data and programs currently being executed, but it is only used to store programs and data temporarily, and the data will be lost when the power is turned off or cut off.

在一些实施例中,电子设备20还可以包括:电源组件23被配置为执行电子设备20的电源管理,有线或无线网络接口24被配置为将电子设备20连接到网络,和输入输出(I/O)接口25。电子设备20可以操作基于存储在存储器22的操作系统,例如Windows Server,MacOS X,Unix,Linux,FreeBSD或类似。In some embodiments, the electronic device 20 may further include: a power supply component 23 configured to perform power management of the electronic device 20, a wired or wireless network interface 24 configured to connect the electronic device 20 to a network, and an input/output (I/O O) Interface 25. The electronic device 20 can operate based on an operating system stored in the memory 22, such as Windows Server, MacOS X, Unix, Linux, FreeBSD or the like.

在一些实施例中,电源组件23为电子设备20的各种组件提供电力。电源组件23可以包括电源管理系统,一个或多个电源,及其他与为电子设备20生成、管理和分配电力相关联的组件。In some embodiments, the power supply component 23 provides power to various components of the electronic device 20 . Power supply components 23 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 20 .

在一些实施例中,有线或无线网络接口24被配置为便于电子设备20和其他设备之间有线或无线方式的通信。电子设备20可以接入基于通信标准的无线网络,如WiFi,运营商网络(如2G、3G、4G或5G),或它们的组合。In some embodiments, wired or wireless network interface 24 is configured to facilitate wired or wireless communications between electronic device 20 and other devices. The electronic device 20 can access a wireless network based on a communication standard, such as WiFi, an operator network (such as 2G, 3G, 4G or 5G), or a combination thereof.

在一些实施例中,有线或无线网络接口24经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,有线或无线网络接口24还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。In some embodiments, the wired or wireless network interface 24 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, wired or wireless network interface 24 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

在一些实施例中,输入输出(I/O)接口25为处理组件21和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。In some embodiments, an input/output (I/O) interface 25 provides an interface between the processing component 21 and a peripheral interface module, which may be a keyboard, a click wheel, buttons, and the like. These buttons may include, but are not limited to: a home button, volume buttons, start button, and lock button.

图12是本申请实施例提供的一种计算机可读存储介质30的框图。该计算机可读存储介质30上存储有计算机程序31,其中,计算机程序31被处理器执行时实现如上述的基于特征相关性的缺陷检测方法。FIG. 12 is a block diagram of a computer-readable storage medium 30 provided by an embodiment of the present application. A computer program 31 is stored on the computer-readable storage medium 30 , wherein when the computer program 31 is executed by a processor, the defect detection method based on feature correlation as described above is realized.

在本申请各个实施例中的各功能单元集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在计算机可读存储介质30中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机可读存储介质30在一个计算机程序31中,包括若干指令用以使得一台计算机设备(可以是个人计算机,系统服务器,或者网络设备等)、电子设备(例如MP3、MP4等,也可以是手机、平板电脑、可穿戴设备等智能终端,也可以是台式电脑等)或者处理器(processor)以执行本申请各个实施方式方法的全部或部分步骤。If the integrated units of the functional units in various embodiments of the present application are implemented in the form of software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium 30 . 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 software products, and the computer-readable storage medium 30 is stored in a computer In the program 31, several instructions are included to make a computer device (which can be a personal computer, a system server, or a network device, etc.), an electronic device (such as MP3, MP4, etc., or a mobile phone, a tablet computer, a wearable device, etc.) The smart terminal (also can be a desktop computer, etc.) or a processor (processor) to execute all or part of the steps of the methods in various embodiments of the present application.

图13是本申请实施例提供的一种计算机程序产品40的框图。该计算机程序产品40中包括程序指令41,该程序指令41可由电子设备20的处理器执行以实现如上述的基于特征相关性的缺陷检测方法。Fig. 13 is a block diagram of a computer program product 40 provided by an embodiment of the present application. The computer program product 40 includes program instructions 41 that can be executed by the processor of the electronic device 20 to implement the defect detection method based on feature correlation as described above.

本领域内的技术人员应明白,本申请的实施例可提供有基于特征相关性的缺陷检测方法、基于特征相关性的缺陷检测装置10、电子设备20、计算机可读存储介质30或计算机程序产品40。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机程序指令41(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品40的形式。Those skilled in the art should understand that the embodiment of the present application may provide a defect detection method based on feature correlation, a defect detection device 10 based on feature correlation, an electronic device 20, a computer-readable storage medium 30 or a computer program product 40. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product 40 implemented on one or more computer program instructions 41 (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer usable program code embodied therein.

本申请是参照根据本申请实施例中基于特征相关性的缺陷检测方法、基于特征相关性的缺陷检测装置10、电子设备20、计算机可读存储介质30或计算机程序产品40的流程图和/或方框图来描述的。应理解可由计算机程序产品40实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序产品40到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的程序指令41产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。This application refers to the flow chart and/or the defect detection method based on feature correlation, the defect detection device 10 based on feature correlation, the electronic device 20, the computer-readable storage medium 30 or the computer program product 40 according to the embodiment of the application. block diagram to describe. It should be understood that each process and/or block in the flowchart and/or block diagram, and a combination of processes and/or blocks in the flowchart and/or block diagram can be realized by the computer program product 40 . These computer program products 40 may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the program instructions executed by the processor of the computer or other programmable data processing equipment 41 Produce means for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序产品40也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机程序产品40中的程序指令41产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program products 40 may also be stored in a computer readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner such that program instructions 41 stored in the computer program product 40 produce an article of manufacture comprising instruction means , the instruction means realizes the functions specified in one or more procedures of the flow chart and/or one or more blocks of the block diagram.

这些程序指令41也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的程序指令41提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These program instructions 41 can also be loaded on a computer or other programmable data processing device, so that a series of operation steps are performed on the computer or other programmable device to produce computer-implemented processing, so that the process executed on the computer or other programmable device The program instructions 41 provide steps for implementing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

需要说明的,上述的各种方法、装置、电子设备、计算机可读存储介质、计算机程序产品等根据方法实施例的描述还可以包括其他的实施方式,具体的实现方式可以参照相关方法实施例的描述,在此不作一一赘述。It should be noted that the above-mentioned various methods, devices, electronic devices, computer-readable storage media, computer program products, etc. may also include other implementations according to the descriptions of the method embodiments. For specific implementation methods, please refer to the relevant method embodiments description and will not be repeated here.

本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由权利要求指出。Other embodiments of the present disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. The present disclosure is intended to cover any modification, use or adaptation of the present disclosure. These modifications, uses or adaptations follow the general principles of the present disclosure and include common knowledge or conventional technical means in the technical field not disclosed in the present disclosure. . The specification and examples are to be considered exemplary only, with the true scope and spirit of the disclosure indicated by the appended claims.

应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It should be understood that the present disclosure is not limited to the precise constructions which have been described above and shown in the drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (11)

1. A defect detection method based on feature correlation, comprising:
acquiring a circuit board image to be tested and a sample circuit board image;
extracting first characteristic information of the circuit board image to be detected and second characteristic information of the sample circuit board image;
performing defect detection on the circuit board image to be detected based on the correlation characteristic between the first characteristic information and the second characteristic information to obtain a defect detection result; the correlation feature is used for representing the same degree of the corresponding same area between the circuit board image to be tested and the sample circuit board image.
2. The method of claim 1, wherein after the obtaining the circuit board image to be tested and the sample circuit board image, the method further comprises:
scaling the circuit board image to be tested and the sample circuit board image to obtain a scaled circuit board image to be tested and a sample circuit board image with the same pixel size;
the extracting the first characteristic information of the circuit board image to be detected and the second characteristic information of the sample circuit board image includes:
extracting first characteristic information of the scaled circuit board image to be tested and second characteristic information of the scaled sample circuit board image;
performing defect detection on the circuit board image to be detected based on the correlation characteristic between the first characteristic information and the second characteristic information to obtain a defect detection result, wherein the defect detection result comprises:
determining a correlation feature between the first feature information and the second feature information;
and performing defect detection on the scaled circuit board image to be detected according to the correlation characteristics to obtain a defect detection result.
3. The method of claim 2, wherein the first feature information and the second feature information each include at least one of a color feature, a texture feature, a shape feature, and a spatial relationship feature at a location of a corresponding pixel point of the image;
The determining a correlation feature between the first feature information and the second feature information includes:
determining each pair of pixel points corresponding to the same pixel point position between the scaled circuit board image to be detected and the scaled sample circuit board image;
and calculating the similarity of at least one characteristic information corresponding to each pair of pixel points based on the first characteristic information and the second characteristic information.
4. The method of claim 3, wherein performing defect detection on the scaled circuit board image to be tested according to the correlation characteristic to obtain a defect detection result comprises:
determining a first number of pixel features corresponding to the scaled circuit board image to be tested and a second number of pixel features corresponding to the scaled sample circuit board image;
and performing defect identification and defect labeling on the scaled circuit board image to be detected based on the first number of pixel features, the second number of pixel features and the similarity of at least one feature information corresponding to each pair of pixel points to obtain a defect detection result.
5. The method of claim 4, wherein performing defect recognition and defect labeling on the scaled circuit board image to be tested based on the first number of pixel features, the second number of pixel features, and the similarity of at least one feature information corresponding to each pair of pixel points to obtain a defect detection result comprises:
Traversing and identifying each pixel point in the scaled circuit board image to be detected based on the first number of pixel features, the second number of pixel features and the similarity of at least one feature information corresponding to each pair of pixel points to obtain a defect identification result;
and marking the corresponding pixel point areas based on the defect identification result to obtain a defect detection result.
6. The method of claim 2, wherein the sample circuit board image is any one of a preset collection image of a defect-free circuit board and a design image of the circuit board to be tested;
the method further comprises the steps of:
traversing whether the similarity of the corresponding same region between the zoomed circuit board image to be tested and the sample circuit board image meets a preset threshold value or not by utilizing the sample circuit board image;
if the preset threshold value is not met, marking an image area which corresponds to the preset threshold value not met in the zoomed circuit board image to be detected as a defect area in the zoomed circuit board image to be detected.
7. The method of claim 2, wherein the sample circuit board image is an acquisition image of a pre-set defective circuit board;
The method further comprises the steps of:
and traversing each pixel point area in the zoomed circuit board image to be detected by utilizing the acquired image of the defect circuit board, and marking an image area matched with the acquired image in the zoomed circuit board image to be detected as the defect area in the zoomed circuit board image to be detected.
8. The method of claim 7, wherein after said labeling the image area in the scaled circuit board image to be tested that matches the captured image, the method further comprises:
extracting an image area matched with the acquired image;
performing one or more of image processing of turning, rotating, amplifying, shrinking and chromaticity adjustment on the extracted image area to obtain a plurality of extended image areas;
and updating the preset defect circuit board by utilizing the plurality of extended image areas.
9. A defect detection apparatus based on feature correlation, comprising:
the acquisition unit is used for acquiring the circuit board image to be detected and the sample circuit board image;
the extraction unit is used for extracting first characteristic information of the circuit board image to be detected and second characteristic information of the sample circuit board image;
The detection unit is used for carrying out defect detection on the circuit board image to be detected based on the correlation characteristic between the first characteristic information and the second characteristic information to obtain a defect detection result; the correlation feature is used for representing the same degree of the corresponding same area between the circuit board image to be tested and the sample circuit board image.
10. An electronic device comprising a memory storing a computer program and a processor implementing the feature correlation-based defect detection method as claimed in any one of claims 1 to 8 when the computer program is executed.
11. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the feature correlation-based defect detection method as claimed in any one of claims 1 to 8.
CN202211592462.8A 2022-12-13 2022-12-13 Defect detection method and related device based on feature correlation Pending CN116152166A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211592462.8A CN116152166A (en) 2022-12-13 2022-12-13 Defect detection method and related device based on feature correlation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211592462.8A CN116152166A (en) 2022-12-13 2022-12-13 Defect detection method and related device based on feature correlation

Publications (1)

Publication Number Publication Date
CN116152166A true CN116152166A (en) 2023-05-23

Family

ID=86357425

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211592462.8A Pending CN116152166A (en) 2022-12-13 2022-12-13 Defect detection method and related device based on feature correlation

Country Status (1)

Country Link
CN (1) CN116152166A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117011304A (en) * 2023-10-08 2023-11-07 深圳思谋信息科技有限公司 Defect detection method, defect detection device, computer equipment and computer readable storage medium
CN117474908A (en) * 2023-12-26 2024-01-30 宁德时代新能源科技股份有限公司 Labeling method, labeling device, labeling equipment and computer-readable storage medium
CN119180784A (en) * 2024-08-26 2024-12-24 江西红森科技有限公司 Bad board defect tracing method for IC carrier board production

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106897994A (en) * 2017-01-20 2017-06-27 北京京仪仪器仪表研究总院有限公司 A kind of pcb board defect detecting system and method based on layered image
US20200380899A1 (en) * 2018-07-02 2020-12-03 Beijing Baidu Netcom Science Technology Co., Ltd. Method and apparatus for detecting peripheral circuit of display screen, electronic device, and storage medium
CN112669267A (en) * 2020-12-18 2021-04-16 平安科技(深圳)有限公司 Circuit board defect detection method and device, electronic equipment and storage medium
US20210304389A1 (en) * 2020-03-31 2021-09-30 International Business Machines Corporation Object defect correction
US20220198228A1 (en) * 2020-12-22 2022-06-23 Hon Hai Precision Industry Co., Ltd. Method for detecting defects in multi-scale images and computing device utilizing method
CN114882039A (en) * 2022-07-12 2022-08-09 南通透灵信息科技有限公司 PCB defect identification method applied to automatic PCB sorting process

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106897994A (en) * 2017-01-20 2017-06-27 北京京仪仪器仪表研究总院有限公司 A kind of pcb board defect detecting system and method based on layered image
US20200380899A1 (en) * 2018-07-02 2020-12-03 Beijing Baidu Netcom Science Technology Co., Ltd. Method and apparatus for detecting peripheral circuit of display screen, electronic device, and storage medium
US20210304389A1 (en) * 2020-03-31 2021-09-30 International Business Machines Corporation Object defect correction
CN112669267A (en) * 2020-12-18 2021-04-16 平安科技(深圳)有限公司 Circuit board defect detection method and device, electronic equipment and storage medium
US20220198228A1 (en) * 2020-12-22 2022-06-23 Hon Hai Precision Industry Co., Ltd. Method for detecting defects in multi-scale images and computing device utilizing method
CN114882039A (en) * 2022-07-12 2022-08-09 南通透灵信息科技有限公司 PCB defect identification method applied to automatic PCB sorting process

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李正明;黎宏;孙俊;: "基于数字图像处理的印刷电路板缺陷检测", 仪表技术与传感器, no. 08, 15 August 2012 (2012-08-15), pages 91 - 93 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117011304A (en) * 2023-10-08 2023-11-07 深圳思谋信息科技有限公司 Defect detection method, defect detection device, computer equipment and computer readable storage medium
CN117011304B (en) * 2023-10-08 2024-03-26 深圳思谋信息科技有限公司 Defect detection method, defect detection device, computer equipment and computer readable storage medium
CN117474908A (en) * 2023-12-26 2024-01-30 宁德时代新能源科技股份有限公司 Labeling method, labeling device, labeling equipment and computer-readable storage medium
CN117474908B (en) * 2023-12-26 2024-05-28 宁德时代新能源科技股份有限公司 Labeling method, device, equipment and computer readable storage medium
CN119180784A (en) * 2024-08-26 2024-12-24 江西红森科技有限公司 Bad board defect tracing method for IC carrier board production
CN119180784B (en) * 2024-08-26 2025-03-07 江西红森科技有限公司 Method for detecting defect of bad board in IC carrier board production

Similar Documents

Publication Publication Date Title
US11120254B2 (en) Methods and apparatuses for determining hand three-dimensional data
US9665789B2 (en) Device and method for analyzing the correlation between an image and another image or between an image and a video
CN116152166A (en) Defect detection method and related device based on feature correlation
WO2019169772A1 (en) Picture processing method, electronic apparatus, and storage medium
Hosny et al. Copy-move forgery detection of duplicated objects using accurate PCET moments and morphological operators
JP5594852B2 (en) Histogram method and system for object recognition
WO2018068304A1 (en) Image matching method and device
CN112336342A (en) Hand key point detection method and device and terminal equipment
CN111290684B (en) Image display method, image display device and terminal device
CN113947613B (en) Target area detection method, device, equipment and storage medium
CN112668577B (en) Method, terminal and device for detecting target objects in large-scale images
US20180253852A1 (en) Method and device for locating image edge in natural background
CN114255223B (en) Deep learning-based double-stage bathroom ceramic surface defect detection method and equipment
CN110119733A (en) Page identification method and device, terminal equipment and computer readable storage medium
CN110019912A (en) Graphic searching based on shape
CN118275449A (en) Copper strip surface defect detection method, device and equipment
CN110163055A (en) Gesture identification method, device and computer equipment
WO2025055548A1 (en) Image processing method and apparatus, and related device
CN117011216A (en) Defect detection method and device, electronic equipment and storage medium
CN108710881B (en) Neural network model, candidate target region generation method, model training method
CN112435223B (en) Target detection method, device and storage medium
CN110717060A (en) Image mask filtering method and device and storage medium
CN110827301A (en) Method and apparatus for processing image
CN113935896A (en) Image stitching method, device, computer equipment and storage medium
CN118135179A (en) Cascade identification method and device for cutting plate, computer equipment and storage medium

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