[go: up one dir, main page]

CN118393327A - Component missing detection method, electronic equipment and readable storage medium - Google Patents

Component missing detection method, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN118393327A
CN118393327A CN202410833127.5A CN202410833127A CN118393327A CN 118393327 A CN118393327 A CN 118393327A CN 202410833127 A CN202410833127 A CN 202410833127A CN 118393327 A CN118393327 A CN 118393327A
Authority
CN
China
Prior art keywords
circuit board
missing
component
reference circuit
components
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.)
Granted
Application number
CN202410833127.5A
Other languages
Chinese (zh)
Other versions
CN118393327B (en
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.)
Guangdong Provincial Laboratory Of Artificial Intelligence And Digital Economy Shenzhen
Original Assignee
Guangdong Provincial Laboratory Of Artificial Intelligence And Digital Economy Shenzhen
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 Guangdong Provincial Laboratory Of Artificial Intelligence And Digital Economy Shenzhen filed Critical Guangdong Provincial Laboratory Of Artificial Intelligence And Digital Economy Shenzhen
Priority to CN202410833127.5A priority Critical patent/CN118393327B/en
Publication of CN118393327A publication Critical patent/CN118393327A/en
Application granted granted Critical
Publication of CN118393327B publication Critical patent/CN118393327B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/28Testing of electronic circuits, e.g. by signal tracer
    • G01R31/2801Testing of printed circuits, backplanes, motherboards, hybrid circuits or carriers for multichip packages [MCP]
    • G01R31/281Specific types of tests or tests for a specific type of fault, e.g. thermal mapping, shorts testing
    • G01R31/2813Checking the presence, location, orientation or value, e.g. resistance, of components or conductors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20224Image subtraction
    • 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]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Microelectronics & Electronic Packaging (AREA)
  • General Engineering & Computer Science (AREA)
  • Supply And Installment Of Electrical Components (AREA)

Abstract

The application provides a component missing detection method, electronic equipment and a readable storage medium, wherein the method comprises the following steps: performing target detection on a plurality of circuit boards to be detected to obtain detection results; determining the circuit board where each component is located according to the detection information of each circuit board to be detected and each component, and obtaining the circuit board information of each component; determining the component category, the component number and the component position of each circuit board to be detected according to the circuit board information and the detection information of each component; determining the undelayed quantity of each component category according to the quantity of the components of each component category on each circuit board to be detected; determining missing circuit boards and missing quantity of each missing component category according to the missing quantity of each component category; and comparing the reference circuit board with each missing circuit board to determine the missing positions of each missing component on each missing circuit board. The application can obtain the missing condition of the circuit board without using a template to compare with the circuit board, and reduce the detection cost.

Description

一种元器件缺失检测方法、电子设备及可读存储介质A component missing detection method, electronic device and readable storage medium

技术领域Technical Field

本申请属于计算机技术领域,尤其涉及一种元器件缺失检测方法、电子设备及可读存储介质。The present application belongs to the field of computer technology, and in particular, relates to a component missing detection method, an electronic device, and a readable storage medium.

背景技术Background technique

在电路板制造过程中,若存在元器件缺失,会导致电路板的功能失效或性能下降。因此会对电路板进行目标检测,以发现缺失的元器件。In the process of circuit board manufacturing, if there are missing components, it will cause the function of the circuit board to fail or the performance to deteriorate. Therefore, the circuit board will be inspected to find the missing components.

现有通过先制作原始元器件图像的模板,确定电路板与模板的不同之处,从而判断是否存在元器件缺失情况。但这种方式需先制作模板,导致检测成本高。The existing method is to first make a template of the original component image, determine the difference between the circuit board and the template, and then determine whether there is a missing component. However, this method requires making a template first, resulting in high detection costs.

发明内容Summary of the invention

本申请实施例提供了一种元器件缺失检测方法、装置、电子设备、可读存储介质及计算机程序产品,可以解决现有使用模板检测缺失元器件导致检测成本高的问题。The embodiments of the present application provide a method, device, electronic device, readable storage medium and computer program product for detecting missing components, which can solve the problem of high detection costs caused by the existing use of templates to detect missing components.

第一方面,本申请实施例提供了一种元器件缺失检测方法,包括:In a first aspect, an embodiment of the present application provides a component missing detection method, comprising:

对多个待检测电路板进行目标检测,获得检测结果,各所述待检测电路板为同一种电路板,所述检测结果包括各所述待检测电路板的检测信息和各元器件的检测信息;Performing target detection on multiple circuit boards to be detected to obtain detection results, wherein the circuit boards to be detected are of the same type, and the detection results include detection information of the circuit boards to be detected and detection information of each component;

根据各所述待检测电路板的所述检测信息和各所述元器件的所述检测信息,确定各所述元器件所在的电路板,获得各所述元器件的电路板信息;According to the detection information of each circuit board to be detected and the detection information of each component, determine the circuit board where each component is located, and obtain the circuit board information of each component;

根据各所述元器件的所述电路板信息和所述检测信息,确定各所述待检测电路板设置的元器件类别和对应的元器件数量;Determine the component category and corresponding component quantity of each circuit board to be detected according to the circuit board information and the detection information of each component;

根据各所述待检测电路板上各所述元器件类别的所述元器件数量,确定各所述元器件类别的未缺失数量;Determine the non-missing quantity of each component category according to the quantity of components of each component category on each circuit board to be inspected;

根据各所述元器件类别的所述未缺失数量,确定缺失电路板和各缺失元器件类别的缺失数量。The missing circuit boards and the missing component quantities of each missing component category are determined based on the non-missing quantity of each component category.

在一个实施例中,所述方法,还包括:In one embodiment, the method further comprises:

根据各所述元器件的所述电路板信息和所述检测信息,确定各所述待检测电路板上各元器件的位置;Determine the position of each component on each circuit board to be detected according to the circuit board information and the detection information of each component;

针对各所述缺失电路板,将基准电路板与所述缺失电路板进行比对,确定所述缺失电路板上各缺失元器件的缺失位置,所述基准电路板为元器件未缺失且元器件位置正确的待检测电路板。For each missing circuit board, a reference circuit board is compared with the missing circuit board to determine the missing position of each missing component on the missing circuit board. The reference circuit board is a circuit board to be detected with no missing components and correct component positions.

在一个实施例中,所述针对各所述缺失电路板,将基准电路板与所述缺失电路板进行比对,确定所述缺失电路板上各缺失元器件的缺失位置,包括:In one embodiment, for each missing circuit board, comparing the reference circuit board with the missing circuit board to determine the missing position of each missing component on the missing circuit board includes:

针对各所述缺失电路板的各所述缺失元器件类别,确定所述基准电路板上属于所述缺失元器件类别的各所述元器件与所述缺失电路板上属于所述缺失元器件类别对应的所述元器件之间的第一重合度;For each of the missing component categories of each of the missing circuit boards, determining a first degree of coincidence between each of the components belonging to the missing component category on the reference circuit board and the components corresponding to the missing component category on the missing circuit board;

针对各所述第一重合度,当所述第一重合度小于第一预设重合度,获得对应的所述基准电路板上目标元器件,并根据所述目标元器件的所述位置确定对应的所述缺失元器件的所述缺失位置;For each of the first overlaps, when the first overlap is less than a first preset overlap, obtaining a corresponding target component on the reference circuit board, and determining the missing position of the corresponding missing component according to the position of the target component;

或,针对各所述缺失电路板,将所述基准电路板与所述缺失电路板进行图像做差,获得各目标图像区域和对应的所述基准电路板上所述目标元器件,所述目标图像区域的像素值大于预设像素值;Or, for each missing circuit board, perform image subtraction between the reference circuit board and the missing circuit board to obtain each target image area and the corresponding target component on the reference circuit board, wherein the pixel value of the target image area is greater than a preset pixel value;

针对各所述目标图像区域,根据所述目标图像区域,确定对应所述目标元器件的所述缺失元器件的所述缺失位置;For each of the target image regions, determining the missing position of the missing component corresponding to the target component according to the target image region;

其中,所述缺失元器件的类型与所述目标元器件的类型相同。The type of the missing component is the same as the type of the target component.

在一个实施例中,所述针对各所述缺失电路板,将基准电路板与所述缺失电路板进行比对,确定各缺失元器件的缺失位置,包括:In one embodiment, for each missing circuit board, comparing the reference circuit board with the missing circuit board to determine the missing position of each missing component includes:

针对各所述缺失电路板,确定所述基准电路板上各所述元器件与所述缺失电路板上对应的所述元器件之间的第二重合度;For each of the missing circuit boards, determining a second degree of overlap between each of the components on the reference circuit board and the corresponding components on the missing circuit board;

若各所述第二重合度均小于第二预设重合度,则从未选择变换操作中确定当次变换操作;If each of the second overlaps is less than the second preset overlap, determining the current transformation operation from the unselected transformation operations;

根据所述当次变换操作,对所述基准电路板进行方向变换,获得变换后基准电路板;According to the current transformation operation, the reference circuit board is transformed in direction to obtain a transformed reference circuit board;

确定所述变换后基准电路板上各所述元器件与所述缺失电路板上对应的所述元器件之间的第三重合度;Determine a third degree of coincidence between each of the components on the transformed reference circuit board and the corresponding components on the missing circuit board;

若各所述第三重合度均小于所述第二预设重合度,则返回执行步骤:从未选择变换操作中确定当次变换操作,直至各所述第三重合度均大于或等于所述第二预设重合度,获得目标基准电路板;If each of the third overlaps is less than the second preset overlap, return to the execution step: determine the current transformation operation from the unselected transformation operations until each of the third overlaps is greater than or equal to the second preset overlap, and obtain the target reference circuit board;

将所述目标基准电路板与所述缺失电路板进行比对,确定各所述缺失元器件的所述缺失位置。The target reference circuit board is compared with the missing circuit board to determine the missing position of each missing component.

在一个实施例中,所述针对各所述缺失电路板,将基准电路板与所述缺失电路板进行比对,确定各缺失元器件的缺失位置,包括:In one embodiment, for each missing circuit board, comparing the reference circuit board with the missing circuit board to determine the missing position of each missing component includes:

针对各所述缺失电路板,根据所述缺失电路板的板类型,确定所述基准电路板的目标变换操作;For each missing circuit board, determining a target transformation operation of the reference circuit board according to the board type of the missing circuit board;

根据所述目标变换操作,对所述基准电路板进行方向变换,获得目标基准电路板;According to the target transformation operation, the reference circuit board is transformed in direction to obtain a target reference circuit board;

将所述目标基准电路板与所述缺失电路板进行比对,确定各所述缺失元器件的所述缺失位置。The target reference circuit board is compared with the missing circuit board to determine the missing position of each missing component.

在一个实施例中,所述针对各所述缺失电路板,将基准电路板与所述缺失电路板进行比对,确定所述缺失电路板上各缺失元器件的缺失位置之前,还包括:In one embodiment, before comparing the reference circuit board with the missing circuit board for each missing circuit board to determine the missing position of each missing component on the missing circuit board, the method further includes:

将原始电路板与第一预设数量个参考电路板进行比对,获得所述第一预设数量个比对结果,所述原始电路板为预先指定的基准电路板,所述参考电路板为各所述元器件类别的元器件数量均为所述未缺失数量的待检测电路板;Compare the original circuit board with a first preset number of reference circuit boards to obtain the first preset number of comparison results, wherein the original circuit board is a pre-specified reference circuit board, and the reference circuit board is a circuit board to be detected in which the number of components of each component category is the non-missing number;

若不存在第二预设数量个所述比对结果为元器件位置正确,则确定其中一个所述参考电路板为所述原始电路板,并返回执行步骤:将原始电路板与第一预设数量个参考电路板进行比对,获得所述第一预设数量个比对结果,直至存在所述第二预设数量个所述比对结果为所述元器件位置正确;If there are not a second preset number of comparison results indicating that the component position is correct, then determine that one of the reference circuit boards is the original circuit board, and return to the execution step: compare the original circuit board with the first preset number of reference circuit boards to obtain the first preset number of comparison results, until there are a second preset number of comparison results indicating that the component position is correct;

若存在所述第二预设数量个所述比对结果为元器件位置正确,则确定所述原始电路板为所述基准电路板;If there are the second preset number of the comparison results indicating that the component positions are correct, determining that the original circuit board is the reference circuit board;

其中,所述第一预设数量大于所述第二预设数量。Wherein, the first preset number is greater than the second preset number.

在一个实施例中,所述对多个待检测电路板进行目标检测,获得检测结果,包括:In one embodiment, the step of performing target detection on a plurality of circuit boards to be detected and obtaining detection results includes:

利用已训练的目标检测模型,对多个待检测电路板进行目标检测,获得检测结果。The trained target detection model is used to perform target detection on multiple circuit boards to obtain detection results.

第二方面,本申请实施例提供了一种元器件缺失检测装置,包括:In a second aspect, an embodiment of the present application provides a component missing detection device, comprising:

目标检测模块,用于对多个待检测电路板进行目标检测,获得检测结果,各所述待检测电路板为同一种电路板,所述检测结果包括各所述待检测电路板的检测信息和各元器件的检测信息;A target detection module is used to perform target detection on multiple circuit boards to be detected and obtain detection results, wherein the circuit boards to be detected are of the same type, and the detection results include detection information of the circuit boards to be detected and detection information of each component;

元器件缺失检测模块,用于根据各所述待检测电路板的所述检测信息和各所述元器件的所述检测信息,确定各所述元器件所在的电路板,获得各所述元器件的电路板信息;A component missing detection module, used to determine the circuit board where each component is located according to the detection information of each circuit board to be detected and the detection information of each component, and obtain the circuit board information of each component;

还用于根据各所述元器件的所述电路板信息和所述检测信息,确定各所述待检测电路板设置的元器件类别和对应的元器件数量;It is also used to determine the component category and the corresponding component quantity of each circuit board to be detected according to the circuit board information and the detection information of each component;

还用于根据各所述待检测电路板上各所述元器件类别的所述元器件数量,确定各所述元器件类别的未缺失数量;It is also used to determine the non-missing quantity of each component category according to the quantity of components of each component category on each circuit board to be inspected;

还用于根据各所述元器件类别的所述未缺失数量,确定缺失电路板和各缺失元器件类别的缺失数量。It is also used to determine the missing quantity of missing circuit boards and each missing component category based on the non-missing quantity of each component category.

在一个实施例中,元器件缺失检测模块,还用于根据各所述元器件的所述电路板信息和所述检测信息,确定各所述待检测电路板上各所述元器件的位置;针对各所述缺失电路板,将所述基准电路板与所述缺失电路板进行比对,确定所述缺失电路板上各缺失元器件的缺失位置,所述基准电路板为元器件未缺失且元器件位置正确的待检测电路板。In one embodiment, the component missing detection module is also used to determine the position of each component on each circuit board to be detected based on the circuit board information and the detection information of each component; for each missing circuit board, the reference circuit board is compared with the missing circuit board to determine the missing position of each missing component on the missing circuit board, and the reference circuit board is a circuit board to be detected in which no components are missing and the component positions are correct.

在一个实施例中,元器件缺失检测模块,具体用于针对各所述缺失电路板的各所述缺失元器件类别,确定所述基准电路板上属于所述缺失元器件类别的各所述元器件与所述缺失电路板上属于所述缺失元器件类别对应的所述元器件之间的第一重合度;针对各所述第一重合度,当所述第一重合度小于第一预设重合度,获得对应的所述基准电路板上目标元器件,并根据所述目标元器件的所述位置确定对应的所述缺失元器件的所述缺失位置;或,针对各所述缺失电路板,将所述基准电路板与所述缺失电路板进行图像做差,获得各目标图像区域和对应的所述基准电路板上所述目标元器件,所述目标图像区域的像素值大于预设像素值;针对各所述目标图像区域,根据所述目标图像区域,确定对应所述目标元器件的所述缺失元器件的所述缺失位置;其中,所述缺失元器件的类型与所述目标元器件的类型相同。In one embodiment, a missing component detection module is specifically used to determine, for each missing component category of each missing circuit board, a first degree of overlap between each component belonging to the missing component category on the reference circuit board and the component corresponding to the missing component category on the missing circuit board; for each first degree of overlap, when the first degree of overlap is less than a first preset degree of overlap, obtain the corresponding target component on the reference circuit board, and determine the missing position of the corresponding missing component according to the position of the target component; or, for each missing circuit board, perform image subtraction between the reference circuit board and the missing circuit board to obtain each target image area and the corresponding target component on the reference circuit board, the pixel value of the target image area being greater than the preset pixel value; for each target image area, determine the missing position of the missing component corresponding to the target component according to the target image area; wherein the type of the missing component is the same as the type of the target component.

在一个实施例中,元器件缺失检测模块,具体用于针对各所述缺失电路板,确定所述基准电路板上各所述元器件与所述缺失电路板上对应的所述元器件之间的第二重合度;若各所述第二重合度均小于第二预设重合度,则从未选择变换操作中确定当次变换操作;根据所述当次变换操作,对所述基准电路板进行方向变换,获得变换后基准电路板;确定所述变换后基准电路板上各所述元器件与所述缺失电路板上对应的所述元器件之间的第三重合度;若各所述第三重合度均小于所述第二预设重合度,则返回执行步骤:从未选择变换操作中确定当次变换操作,直至各所述第三重合度均大于或等于所述第二预设重合度,获得目标基准电路板;将所述目标基准电路板与所述缺失电路板进行比对,确定各所述缺失元器件的所述缺失位置。In one embodiment, a component missing detection module is specifically used to determine, for each missing circuit board, a second degree of overlap between each component on the reference circuit board and the corresponding component on the missing circuit board; if each of the second degrees of overlap is less than a second preset degree of overlap, determine the current transformation operation from an unselected transformation operation; according to the current transformation operation, perform a direction transformation on the reference circuit board to obtain a transformed reference circuit board; determine a third degree of overlap between each component on the transformed reference circuit board and the corresponding component on the missing circuit board; if each of the third degrees of overlap is less than the second preset degree of overlap, return to the execution step: determine the current transformation operation from an unselected transformation operation until each of the third degrees of overlap is greater than or equal to the second preset degree of overlap to obtain a target reference circuit board; compare the target reference circuit board with the missing circuit board to determine the missing position of each missing component.

在一个实施例中,元器件缺失检测模块,具体用于针对各所述缺失电路板,根据所述缺失电路板的板类型,确定所述基准电路板的目标变换操作;根据所述目标变换操作,对所述基准电路板进行方向变换,获得目标基准电路板;将所述目标基准电路板与所述缺失电路板进行比对,确定各所述缺失元器件的所述缺失位置。In one embodiment, the missing component detection module is specifically used to determine, for each missing circuit board, a target transformation operation of the reference circuit board according to the board type of the missing circuit board; according to the target transformation operation, transform the direction of the reference circuit board to obtain a target reference circuit board; and compare the target reference circuit board with the missing circuit board to determine the missing position of each missing component.

在一个实施例中,元器件缺失检测模块,还用于将原始电路板与第一预设数量个参考电路板进行比对,获得所述第一预设数量个比对结果,所述原始电路板为预先指定的基准电路板,所述参考电路板为各所述元器件类别的元器件数量均为所述未缺失数量的待检测电路板;若不存在第二预设数量个所述比对结果为元器件位置正确,则确定其中一个所述参考电路板为所述原始电路板,并返回执行步骤:将原始电路板与第一预设数量个参考电路板进行比对,获得所述第一预设数量个比对结果,直至存在所述第二预设数量个所述比对结果为所述元器件位置正确;若存在所述第二预设数量个所述比对结果为元器件位置正确,则确定所述原始电路板为所述基准电路板;其中,所述第一预设数量大于所述第二预设数量。In one embodiment, the component missing detection module is further used to compare the original circuit board with a first preset number of reference circuit boards to obtain the first preset number of comparison results, wherein the original circuit board is a pre-specified reference circuit board, and the reference circuit board is a circuit board to be detected in which the number of components of each component category is the non-missing number; if there are not a second preset number of comparison results showing that the component positions are correct, then one of the reference circuit boards is determined to be the original circuit board, and the execution step is returned to: comparing the original circuit board with a first preset number of reference circuit boards to obtain the first preset number of comparison results, until there are a second preset number of comparison results showing that the component positions are correct; if there are a second preset number of comparison results showing that the component positions are correct, then the original circuit board is determined to be the reference circuit board; wherein the first preset number is greater than the second preset number.

在一个实施例中,目标检测模块,具体用于利用已训练的目标检测模型,对多个所述待检测电路板进行目标检测,获得所述检测结果。In one embodiment, the target detection module is specifically used to perform target detection on the plurality of circuit boards to be detected using a trained target detection model to obtain the detection results.

第三方面,本申请实施例提供了一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上述第一方面中任一项所述的方法。In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a method as described in any one of the above-mentioned first aspects when executing the computer program.

第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如上述第一方面中任一项所述的方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method as described in any one of the above-mentioned first aspects is implemented.

第五方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行上述第一方面中任一项所述的方法。In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes any one of the methods described in the first aspect.

本申请实施例与现有技术相比存在的有益效果是:Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

本申请实施例通过根据各待检测电路板的检测信息和各元器件的检测信息,确定各元器件所在的电路板,获得各元器件的电路板信息;根据各元器件的电路板信息和检测信息,确定各待检测电路板设置的元器件类别和对应的元器件数量;以获知待检测电路板上全部元器件的类型和各元器件类型的数量;以及通过根据各待检测电路板上各元器件类别的元器件数量,确定各元器件类别的未缺失数量;根据各元器件类别的未缺失数量,确定缺失电路板和各缺失元器件类别的缺失数量,能够基于统计原理,获知各元器件类别的未缺失时的数量,进而经过比对,获知各电路板的缺失元器件类别以及对应的缺失数量,无需使用模板与电路板比对以获知电路板的缺失情况,降低检测成本。The embodiment of the present application determines the circuit board where each component is located according to the detection information of each circuit board to be detected and the detection information of each component, and obtains the circuit board information of each component; determines the component category and the corresponding component quantity set on each circuit board to be detected according to the circuit board information and detection information of each component; so as to know the types of all components and the quantity of each component type on the circuit board to be detected; and determines the non-missing number of each component category according to the number of components of each component category on each circuit board to be detected; determines the missing circuit boards and the missing number of each missing component category according to the non-missing number of each component category, so that the number of each component category when it is not missing can be known based on statistical principles, and then the missing component category and the corresponding missing number of each circuit board can be known through comparison, without using templates and circuit boards to compare to know the missing situation of the circuit boards, thereby reducing the detection cost.

可以理解的是,上述第二方面至第五方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

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

图1是本申请一实施例提供的元器件缺失检测方法的第一种流程示意图;FIG1 is a schematic diagram of a first flow chart of a component missing detection method provided by an embodiment of the present application;

图2是本申请一实施例提供的大电路板的第一种示例图;FIG2 is a first exemplary diagram of a large circuit board provided by an embodiment of the present application;

图3是本申请一实施例提供的元器件位于待检测电路板内的示例图;FIG3 is an exemplary diagram of components provided by an embodiment of the present application being located in a circuit board to be tested;

图4是本申请一实施例提供的元器件缺失检测方法的第二种流程示意图;FIG4 is a schematic diagram of a second flow chart of a component missing detection method provided in an embodiment of the present application;

图5是本申请一实施例提供的获得缺失位置的第一种示例图;FIG5 is a first exemplary diagram of obtaining a missing position provided by an embodiment of the present application;

图6是本申请一实施例提供的获得缺失位置的第二种示例图;FIG6 is a second example diagram of obtaining a missing position provided by an embodiment of the present application;

图7是本申请一实施例提供的大电路板的第二种示例图;FIG7 is a second example diagram of a large circuit board provided in an embodiment of the present application;

图8是本申请一实施例提供的变换关系的示例图;FIG8 is an example diagram of a transformation relationship provided by an embodiment of the present application;

图9是本申请一实施例提供的元器件缺失检测装置的结构示意图;FIG9 is a schematic diagram of the structure of a component missing detection device provided in an embodiment of the present application;

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

具体实施方式Detailed ways

以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and/or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and/or combinations thereof.

还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should also be understood that the term “and/or” used in the specification and appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

请参照图1,图1是本申请一实施例提供的元器件缺失检测方法的第一种流程示意图。如图1所示,所述方法,包括:Please refer to Figure 1, which is a schematic diagram of a first flow chart of a component missing detection method provided by an embodiment of the present application. As shown in Figure 1, the method includes:

S11:对多个待检测电路板进行目标检测,获得检测结果。S11: Perform target detection on multiple circuit boards to be detected to obtain detection results.

其中,各待检测电路板为同一种电路板,检测结果包括各待检测电路板的检测信息和各元器件的检测信息。The circuit boards to be tested are of the same type, and the test results include test information of the circuit boards to be tested and test information of each component.

在实际情况中,生产线上,一般同一场景下多个待检测电路板会以一定形式拼接为一个尺寸更大的大电路板的方式出现。请参照图2,图2是本申请一实施例提供的大电路板的第一种示例图。如图2所示,大电路板(二级电路板)上设置有多个待检测电路板(一级电路板),待检测电路板上设置各种元器件。可通过对二级电路板进行目标检测,实现对多个一级电路板进行目标检测。还可逐一对一级电路进行目标检测,实现对多个一级电路板进行目标检测。In actual situations, on a production line, multiple circuit boards to be inspected in the same scenario will generally appear in a form of splicing into a larger circuit board in a certain form. Please refer to Figure 2, which is a first example diagram of a large circuit board provided in an embodiment of the present application. As shown in Figure 2, a large circuit board (secondary circuit board) is provided with multiple circuit boards to be inspected (primary circuit boards), and various components are provided on the circuit boards to be inspected. Target detection can be performed on the secondary circuit board to achieve target detection on multiple primary circuit boards. Target detection can also be performed on the primary circuits one by one to achieve target detection on multiple primary circuit boards.

在一种可能的实现方式中,步骤S11,包括:In a possible implementation, step S11 includes:

利用已训练的目标检测模型,对多个待检测电路板进行目标检测,获得检测结果。The trained target detection model is used to perform target detection on multiple circuit boards to obtain detection results.

在应用中,利用已训练的目标检测模型,对待检测电路板进行检测,识别待检测电路板的位置和全部元器件的类别和位置,获得检测结果。In the application, the trained target detection model is used to detect the circuit board to be inspected, identify the position of the circuit board to be inspected and the types and positions of all components, and obtain the detection results.

其中,已训练的目标检测模型可为已训练的YOLO模型(You Only Look Once,物体检测和图像分割模型)。示例的,YOLO模型为YOLOv8模型。The trained target detection model may be a trained YOLO model (You Only Look Once, object detection and image segmentation model). In an example, the YOLO model is a YOLOv8 model.

目标检测模型训练过程为预先收集实际场景中二级电路板的图像数据,并进行数据标注,标注一级电路板以及一级电路板中元器件的类别、位置,获得训练数据。利用训练数据对目标检测模型进行训练和测试,获得已训练的目标检测模型。The object detection model training process is to collect image data of the secondary circuit board in the actual scene in advance, and perform data annotation, annotate the category and location of the primary circuit board and the components in the primary circuit board, and obtain training data. The training data is used to train and test the object detection model to obtain a trained object detection model.

在一种可能的实现方式中,可在对图像数据标注后,对图像数据进行旋转、缩放、平移、裁剪、填充等数据增强处理,获得训练数据。In a possible implementation, after the image data is labeled, data enhancement processing such as rotation, scaling, translation, cropping, and padding may be performed on the image data to obtain training data.

在一种可能的实现方式中,可获取已预先定义的检测模型,并加载预训练权重。然后利用训练数据进行训练。In a possible implementation, a predefined detection model may be obtained, and pre-trained weights may be loaded, and then training may be performed using training data.

S12:根据各待检测电路板的检测信息和各元器件的检测信息,确定各元器件所在的电路板,获得各元器件的电路板信息。S12: According to the detection information of each circuit board to be detected and the detection information of each component, the circuit board where each component is located is determined, and the circuit board information of each component is obtained.

在应用中,遍历每个元器件和每个待检测电路板后,待检测电路板的检测信息包括位置,元器件的检测信息包括类别和位置。In the application, after traversing each component and each circuit board to be inspected, the inspection information of the circuit board to be inspected includes the position, and the inspection information of the component includes the category and the position.

针对各元器件,将元器件的位置依次与各待检测电路板的位置进行比对,确定元器件所在的电路板。For each component, the position of the component is compared with the position of each circuit board to be tested in turn to determine the circuit board where the component is located.

具体的,电路板的位置包括电路板的左上角坐标、右下角坐标。元器件的位置包括元器件的左上角坐标、右下角坐标。将元器件的位置与其中一个待检测电路板的位置进行比对。若该元器件的位置位于该待检测电路板的位置内,则确定该元器件设置于该待检测电路板上。若该元器件的位置不位于该待检测电路板的位置内,则确定该元器件不设置于该待检测电路板。确定下一个待检测电路板,将该元器件的位置与下一个待检测电路板的位置进行比对,直至确定该元器件所在的电路板。每个元器件均执行上述步骤,以获得每个元器件的电路板信息。Specifically, the position of the circuit board includes the coordinates of the upper left corner and the lower right corner of the circuit board. The position of the component includes the coordinates of the upper left corner and the lower right corner of the component. Compare the position of the component with the position of one of the circuit boards to be detected. If the position of the component is within the position of the circuit board to be detected, it is determined that the component is set on the circuit board to be detected. If the position of the component is not within the position of the circuit board to be detected, it is determined that the component is not set on the circuit board to be detected. Determine the next circuit board to be detected, and compare the position of the component with the position of the next circuit board to be detected until the circuit board where the component is located is determined. Each component performs the above steps to obtain the circuit board information of each component.

请参照图3,图3是本申请一实施例提供的元器件位于待检测电路板内的示例图。如图3所示,当元器件的位置满足下述表达式时,确定元器件位于待检测电路板内。Please refer to Figure 3, which is an example diagram of a component located in a circuit board to be detected provided by an embodiment of the present application. As shown in Figure 3, when the position of the component satisfies the following expression, it is determined that the component is located in the circuit board to be detected.

表达式为:,其中,(xi,yi)为元器件的左上角坐标,(xj,yj)为元器件的右下角坐标,(Xi,Yi)为待检测电路板的左上角坐标,(Xj,Yj)为待检测电路板的右下角坐标。The expression is: , where (xi,yi) is the coordinate of the upper left corner of the component, (xj,yj) is the coordinate of the lower right corner of the component, (Xi,Yi) is the coordinate of the upper left corner of the circuit board to be tested, and (Xj,Yj) is the coordinate of the lower right corner of the circuit board to be tested.

S13:根据各元器件的电路板信息和检测信息,确定各待检测电路板设置的元器件类别和对应的元器件数量。S13: Determine the component category and corresponding component quantity of each circuit board to be inspected according to the circuit board information and inspection information of each component.

在应用中,根据各元器件的电路板信息和类别,确定并记录各待检测电路板上元器件的数量和所有元器件的类别。其中,可通过预设程序将这些信息存储在内存或硬盘内,以实现记录。In the application, according to the circuit board information and category of each component, the number of components and the category of all components on each circuit board to be inspected are determined and recorded. Among them, this information can be stored in the memory or hard disk through a preset program to achieve recording.

示例的,共有八个待检测电路板,待检测电路板设置的元器件类别有三个。各待检测电路板设置的元器件类别和对应的元器件数量如表1所示:For example, there are eight circuit boards to be tested, and there are three types of components set on the circuit boards to be tested. The types of components set on each circuit board to be tested and the corresponding number of components are shown in Table 1:

表1Table 1

S14:根据各待检测电路板上各元器件类别的元器件数量,确定各元器件类别的未缺失数量。S14: Determine the non-missing quantity of each component category according to the quantity of components of each component category on each circuit board to be inspected.

在应用中,当生产线上的一级电路板及元器件未发生变动时,经过一次统计即可获得每个元器件类别的未缺失数量,可一直使用。In the application, when the first-level circuit boards and components on the production line have not changed, the non-missing quantity of each component category can be obtained through a single statistics and can be used continuously.

在一种可能的实现方式中,步骤S14,包括:In a possible implementation, step S14 includes:

针对各元器件类别,对各待检测电路板的元器件类别的元器件数量进行统计,获得各元器件数量出现的次数,并确定出现次数最多的元器件数量为元器件类别的未缺失数量。For each component category, the number of components of the component category of each circuit board to be tested is counted to obtain the number of occurrences of each component number, and the component number with the largest number of occurrences is determined as the non-missing number of the component category.

示例的,共有八个待检测电路板,待检测电路板设置的元器件类别有三个。各元器件类别的未缺失数量如表2所示:For example, there are eight circuit boards to be tested, and there are three types of components set on the circuit boards to be tested. The number of components that are not missing in each type is shown in Table 2:

表2Table 2

在一种可能的实现方式中,步骤S14,包括:In a possible implementation, step S14 includes:

对待检测电路板的数量进行统计,获得待检测电路板总量。对各待检测电路板上各元器件类别的元器件数量进行统计,获得各元器件类别的元器件总量。根据各元器件类别的元器件总量和待检测电路板总量,确定各元器件类别的未缺失数量。The number of circuit boards to be tested is counted to obtain the total number of circuit boards to be tested. The number of components of each component category on each circuit board to be tested is counted to obtain the total number of components of each component category. Based on the total number of components of each component category and the total number of circuit boards to be tested, the number of components that are not missing in each component category is determined.

具体的,确定元器件类别的未缺失数量公式为:Specifically, the formula for determining the non-missing quantity of a component category is:

v=C(Mi/N),其中,v为未缺失数量,C用于当结果为小数时向上取整,Mi为第i个元器件类别的元器件总量,N为待检测电路板总量。v=C(Mi/N), where v is the number of non-missing components, C is used to round up when the result is a decimal, Mi is the total number of components in the i-th component category, and N is the total number of circuit boards to be tested.

示例的,共有八个待检测电路板,待检测电路板总量为8。待检测电路板设置的元器件类别有三个。各元器件类别的未缺失数量如表3所示:For example, there are eight circuit boards to be tested, and the total number of circuit boards to be tested is 8. There are three types of components set in the circuit boards to be tested. The number of components that are not missing in each category is shown in Table 3:

表3table 3

S15:根据各元器件类别的未缺失数量,确定缺失电路板和各缺失元器件类别的缺失数量。S15: Determine the missing quantity of missing circuit boards and each missing component category based on the non-missing quantity of each component category.

在应用中,针对各待检测电路板,将待检测电路板上各元器件类别的元器件数量与对应的未缺失数量进行比对,获得各元器件类别的数量比对结果。若存在至少一个目标元器件类别,则确定待检测电路板为缺失电路板,并确定目标元器件类别的数量比对结果为缺失元器件类别的缺失数量,目标元器件类别为数量比对结果不为零的元器件类别。In the application, for each circuit board to be tested, the number of components of each component category on the circuit board to be tested is compared with the corresponding non-missing number to obtain the quantity comparison result of each component category. If there is at least one target component category, the circuit board to be tested is determined to be a missing circuit board, and the quantity comparison result of the target component category is determined to be the missing quantity of the missing component category, and the target component category is the component category whose quantity comparison result is not zero.

示例的,基于上述表格,将每个待检测电路板的元器件1、2、3的元器件数量与对应的未缺失数量进行比对,获得元器件1、2、3的数量比对结果。For example, based on the above table, the component quantity of components 1, 2, and 3 of each circuit board to be tested is compared with the corresponding non-missing quantity to obtain the quantity comparison result of components 1, 2, and 3.

电路板3存在一个目标元器件类别(元器件1,元器件1的数量比对结果为1-0=1),确定电路板3为缺失电路板,并确定元器件1的数量比对结果为缺失元器件类别(元器件1)的缺失数量。Circuit board 3 has a target component category (component 1, the quantity comparison result of component 1 is 1-0=1), circuit board 3 is determined to be a missing circuit board, and the quantity comparison result of component 1 is determined to be the missing quantity of the missing component category (component 1).

电路板7存在一个目标元器件类别(元器件2,元器件2的数量比对结果为2-0=2),确定电路板7为缺失电路板,并确定元器件2的数量比对结果为缺失元器件类别(元器件2)的缺失数量。Circuit board 7 has a target component category (component 2, the quantity comparison result of component 2 is 2-0=2), circuit board 7 is determined to be a missing circuit board, and the quantity comparison result of component 2 is determined to be the missing quantity of the missing component category (component 2).

电路板4、电路板5、电路板8确定过程相同,故在此不再赘述。The determination process of circuit board 4, circuit board 5, and circuit board 8 is the same, so it will not be repeated here.

可以理解的是,通过根据各待检测电路板上各元器件类别的元器件数量,确定各元器件类别的未缺失数量;根据各元器件类别的未缺失数量,确定缺失电路板和各缺失元器件类别的缺失数量,能够依据场景中各电路板内部的元器件之间的关系检测电路板是否存在元器件缺失情况,使得能够适用于各种场景,不限制于固定或可预测目标外观的场景中。It can be understood that by determining the non-missing number of each component category based on the number of components in each component category on each circuit board to be detected; determining the missing number of missing circuit boards and each missing component category based on the non-missing number of each component category, it is possible to detect whether there are missing components on the circuit board based on the relationship between the components inside each circuit board in the scene, so that it can be applicable to various scenarios and is not limited to scenarios with fixed or predictable target appearance.

另外,通过根据各待检测电路板上各元器件类别的元器件数量,确定各元器件类别的未缺失数量,获得准确的未缺失数量。通过根据各元器件类别的未缺失数量,确定缺失电路板和各缺失元器件类别的缺失数量,获得准确的缺失电路板上各缺失元器件类别的缺失数量,保障检测准确率,有利于保证电路板的质量,提高生产效率,满足市场需求。In addition, by determining the number of components of each component category on each circuit board to be tested, the number of components of each category is determined, and the accurate number of components of each category is obtained. By determining the missing number of missing circuit boards and the missing number of each missing component category according to the non-missing number of each component category, the accurate missing number of each missing component category on the missing circuit board is obtained, which ensures the detection accuracy, is conducive to ensuring the quality of circuit boards, improving production efficiency, and meeting market demand.

本实施例通过根据各待检测电路板的检测信息和各元器件的检测信息,确定各元器件所在的电路板,获得各元器件的电路板信息;根据各元器件的电路板信息和检测信息,确定各待检测电路板设置的元器件类别和对应的元器件数量;以获知待检测电路板上全部元器件的类型和各元器件类型的数量;以及通过根据各待检测电路板上各元器件类别的元器件数量,确定各元器件类别的未缺失数量;根据各元器件类别的未缺失数量,确定缺失电路板和各缺失元器件类别的缺失数量,能够基于统计原理,获知各元器件类别的未缺失时的数量,进而经过比对,获知各电路板的缺失元器件类别以及对应的缺失数量,无需使用模板与电路板比对以获知电路板的缺失情况,降低检测成本。This embodiment determines the circuit board where each component is located according to the detection information of each circuit board to be detected and the detection information of each component, and obtains the circuit board information of each component; determines the component category and the corresponding component quantity set on each circuit board to be detected according to the circuit board information and detection information of each component; so as to know the types of all components and the quantity of each component type on the circuit board to be detected; and determines the non-missing number of each component category according to the number of components of each component category on each circuit board to be detected; determines the missing circuit boards and the missing number of each missing component category according to the non-missing number of each component category, so that the number of each component category when it is not missing can be obtained based on statistical principles, and then the missing component category and the corresponding missing number of each circuit board can be obtained through comparison, without using templates and circuit boards to compare to know the missing situation of the circuit board, thereby reducing the detection cost.

请参照图4,图4是本申请一实施例提供的元器件缺失检测方法的第二种流程示意图。如图4所示,所述方法,还包括:Please refer to FIG. 4 , which is a schematic diagram of a second flow chart of a component missing detection method provided in an embodiment of the present application. As shown in FIG. 4 , the method further includes:

S16:根据各元器件的电路板信息和检测信息,确定各待检测电路板上各元器件的位置。S16: Determine the position of each component on each circuit board to be inspected according to the circuit board information and inspection information of each component.

在应用中,根据元器件所在的电路板和元器件的位置,确定各待检测电路板上各元器件的位置。In the application, the position of each component on each circuit board to be inspected is determined according to the circuit board where the component is located and the position of the component.

S17:针对各缺失电路板,将基准电路板与缺失电路板进行比对,确定缺失电路板上各缺失元器件的缺失位置。S17: For each missing circuit board, compare the reference circuit board with the missing circuit board to determine the missing position of each missing component on the missing circuit board.

其中,基准电路板为元器件未缺失且元器件位置正确的待检测电路板。The reference circuit board is a circuit board to be tested in which all components are not missing and the components are positioned correctly.

在应用中,因基准电路板上不存在元器件缺失且元器件位置正确的情况,基于图像模式,通过将缺失电路板与基准电路板进行比对,依据基准电路板上各元器件的位置确定缺失电路板上各缺失元器件的缺失位置。In the application, since there are no missing components on the reference circuit board and the components are in the correct position, based on the image mode, the missing circuit board is compared with the reference circuit board, and the missing position of each missing component on the missing circuit board is determined according to the position of each component on the reference circuit board.

在一种可能的实现方式中,为了获得准确的缺失元器件的缺失位置,可通过电路板左上角坐标、右下角坐标进行对齐的方式,将缺失电路板与基准电路板匹配后,才将缺失电路板与基准电路板进行比对。In one possible implementation, in order to obtain the accurate missing position of the missing component, the missing circuit board can be matched with the reference circuit board by aligning the coordinates of the upper left corner and the lower right corner of the circuit board, and then the missing circuit board can be compared with the reference circuit board.

具体的,先将缺失电路板的左上角与基准电路板的左上角对齐后,选择其中一个电路板进行缩放,以将缺失电路板的右下角与基准电路板的右下角对齐。而且缩放过程中,电路板缩放同时元器件尺寸、位置也进行缩放。Specifically, the upper left corner of the missing circuit board is aligned with the upper left corner of the reference circuit board, and then one of the circuit boards is selected for scaling to align the lower right corner of the missing circuit board with the lower right corner of the reference circuit board. In addition, during the scaling process, the size and position of the components are also scaled while the circuit board is scaled.

在一种可能的实现方式中,步骤S17,包括:In a possible implementation, step S17 includes:

S21:针对各缺失电路板的各缺失元器件类别,确定基准电路板上属于缺失元器件类别的各元器件与缺失电路板上属于缺失元器件类别对应的元器件之间的第一重合度。S21: For each missing component category of each missing circuit board, determine a first degree of coincidence between each component belonging to the missing component category on the reference circuit board and the components corresponding to the missing component category on the missing circuit board.

在应用中,在一个缺失电路板,针对各缺失器件类别,在基准电路板上属于缺失元器件类别的各元器件与缺失电路板上属于缺失元器件类别的各元器件一一对应后,计算对应的两个元器件之间的第一重合度。In the application, for each missing component category on a missing circuit board, after each component belonging to the missing component category on the reference circuit board is matched one by one with each component belonging to the missing component category on the missing circuit board, a first overlap between the corresponding two components is calculated.

具体的,第一重合度公式为:Specifically, the first coincidence degree formula is:

IOU1=;其中,Ai为基准电路板上元器件的面积,Aj为缺失电路板上元器件的面积。IOU1= ; Where Ai is the area of components on the reference circuit board, and Aj is the area of components on the missing circuit board.

S22:针对各第一重合度,当第一重合度小于第一预设重合度,获得对应的基准电路板上目标元器件,并根据目标元器件的位置确定对应的缺失元器件的缺失位置。S22: For each first overlap, when the first overlap is less than a first preset overlap, a target component on the corresponding reference circuit board is obtained, and a missing position of the corresponding missing component is determined according to the position of the target component.

其中,缺失元器件的类型与目标元器件的类型相同。The type of the missing component is the same as the type of the target component.

在应用中,针对各第一重合度,若第一重合度小于第一预设重合度,则确定该位置存在元器件缺失,同时获得该第一重合度对应的基准电路板上目标元器件和缺失电路板上缺失元器件。根据基准电路板上该目标元器件的位置确定缺失电路板上该缺失元器件的缺失位置。若第一重合度大于或等于第一预设重合度,则确定该位置不存在元器件缺失。In the application, for each first overlap, if the first overlap is less than the first preset overlap, it is determined that there is a component missing at the position, and the target component on the reference circuit board and the missing component on the missing circuit board corresponding to the first overlap are obtained. The missing position of the missing component on the missing circuit board is determined according to the position of the target component on the reference circuit board. If the first overlap is greater than or equal to the first preset overlap, it is determined that there is no component missing at the position.

示例的,缺失电路板的缺失元器件类别为元器件2,未缺失数量为2,缺失数量为1,缺失元器件为2`-2。For example, the missing component category of the missing circuit board is component 2, the non-missing quantity is 2, the missing quantity is 1, and the missing component is 2`-2.

基准电路板与缺失电路板对齐后,针对元器件2,计算基准电路板上属于元器件2的元器件2-1与缺失电路板上属于元器件2对应的元器件2`-1之间的第一重合度。计算基准电路板上属于元器件2的元器件2-2与缺失电路板上属于元器件2对应的元器件2`-2之间的第一重合度。After the reference circuit board is aligned with the missing circuit board, for component 2, a first degree of overlap between component 2-1 on the reference circuit board belonging to component 2 and component 2'-1 on the missing circuit board corresponding to component 2 is calculated. A first degree of overlap between component 2-2 on the reference circuit board belonging to component 2 and component 2'-2 on the missing circuit board corresponding to component 2 is calculated.

因缺失电路板上元器件2`-1不缺失,对应的第一重合度大于第一预设重合度。因缺失电路板上元器件2`-2缺失,对应的第一重合度小于第一预设重合度,获得基准电路板的目标元器件(元器件2-2)和缺失元器件(元器件2`-2)。根据元器件2-2的位置确定缺失元器件(元器件2`-2)的缺失位置。Because component 2`-1 on the missing circuit board is not missing, the corresponding first overlap is greater than the first preset overlap. Because component 2`-2 on the missing circuit board is missing, the corresponding first overlap is less than the first preset overlap, and the target component (component 2-2) and the missing component (component 2`-2) of the reference circuit board are obtained. The missing position of the missing component (component 2`-2) is determined according to the position of component 2-2.

其中,缺失元器件(元器件2`-2)的缺失位置可通过元器件2的形状在缺失电路板的图像上标记出来,或可通过矩形框形式在缺失电路板图像上标记出来。The missing position of the missing component (component 2 '- 2 ) can be marked on the image of the missing circuit board by the shape of component 2 , or can be marked on the image of the missing circuit board by a rectangular frame.

请参照图5,图5是本申请一实施例提供的获得缺失位置的第一种示例图。如图5所示,缺失电路板的缺失元器件类别为元器件2,未缺失数量为2,缺失数量为1,缺失元器件为2`-2(虚线矩形框表示)。经过基准电路板与缺失电路板对齐,求重合度后,获得缺失电路板的缺失元器件2`-2的缺失位置(实心矩形框表示)。Please refer to Figure 5, which is a first example diagram of obtaining the missing position provided by an embodiment of the present application. As shown in Figure 5, the missing component category of the missing circuit board is component 2, the number of non-missing components is 2, the number of missing components is 1, and the missing component is 2`-2 (indicated by the dotted rectangular box). After the reference circuit board is aligned with the missing circuit board and the overlap is calculated, the missing position of the missing component 2`-2 of the missing circuit board is obtained (indicated by the solid rectangular box).

或,S21`:针对各缺失电路板,将基准电路板与缺失电路板进行图像做差,获得各目标图像区域和对应的基准电路板上目标元器件,目标图像区域的像素值大于预设像素值。Or, S21`: for each missing circuit board, perform image subtraction between the reference circuit board and the missing circuit board to obtain each target image area and the corresponding target component on the reference circuit board, and the pixel value of the target image area is greater than the preset pixel value.

在应用中,因缺失电路板上元器件缺失的位置不存在器件,图像做差后该区域的像素值大于预设像素值。而元器件不缺失的位置,图像做差后该区域像素值小于预设像素值。针对各缺失电路板,将基准电路板与缺失电路板进行图像做差后,获得像素值大于预设像素值的区域,即目标图像区域。In the application, there is no component at the position where the component is missing on the missing circuit board, and the pixel value of the area after the image difference is greater than the preset pixel value. However, at the position where the component is not missing, the pixel value of the area after the image difference is less than the preset pixel value. For each missing circuit board, the reference circuit board is image-differencing with the missing circuit board to obtain an area with a pixel value greater than the preset pixel value, i.e., the target image area.

在一种可能的实现方式中,为了获得准确的缺失元器件的缺失位置,可通过电路板左上角坐标、右下角坐标进行对齐的方式,将缺失电路板与基准电路板匹配后,才将基准电路板与缺失电路板进行图像做差。In one possible implementation, in order to obtain the accurate missing position of the missing component, the missing circuit board can be matched with the reference circuit board by aligning the coordinates of the upper left corner and the lower right corner of the circuit board, and then the image difference between the reference circuit board and the missing circuit board can be taken.

S22`:针对各目标图像区域,根据目标图像区域,确定对应目标元器件的缺失元器件的缺失位置。S22': For each target image region, determine the missing position of the missing component corresponding to the target component according to the target image region.

在应用中,针对各目标图像区域,根据目标图像区域的位置确定对应目标元器件的缺失元器件的缺失位置。In the application, for each target image area, the missing position of the missing component corresponding to the target component is determined according to the position of the target image area.

在一种可能的实现方式中,为了获得准确的缺失元器件的缺失位置,可先对目标图像区域进行去噪、边缘特征提取、边缘增强、生成外接矩形后,根据处理后的目标图像区域的位置确定缺失元器件的缺失位置。In one possible implementation, in order to obtain the accurate missing position of the missing component, the target image area can be first denoised, edge features extracted, edges enhanced, and a bounding rectangle generated, and then the missing position of the missing component is determined based on the position of the processed target image area.

示例的,缺失电路板的缺失元器件类别为元器件3,未缺失数量为1,缺失数量为1。For example, the missing component category of the missing circuit board is component 3, the non-missing quantity is 1, and the missing quantity is 1.

基准电路板与缺失电路板对齐后,将基准电路板与缺失电路板进行图像做差,获得目标图像区域(元器件3对应的区域)和对应的基准电路板上目标元器件(元器件3)。根据目标图像区域的位置,确定对应目标元器件(元器件3)的缺失元器件(元器件3`)的位置。After the reference circuit board is aligned with the missing circuit board, the image difference between the reference circuit board and the missing circuit board is performed to obtain the target image area (the area corresponding to component 3) and the corresponding target component (component 3) on the reference circuit board. According to the position of the target image area, the position of the missing component (component 3') corresponding to the target component (component 3) is determined.

请参照图6,图6是本申请一实施例提供的获得缺失位置的第二种示例图。如图6所示,缺失电路板的缺失元器件类别为元器件3,未缺失数量为1,缺失数量为1,缺失元器件3`(虚线矩形框表示)。经过基准电路板与缺失电路板对齐,图像做差后,获得缺失电路板的缺失元器件3`的缺失位置(实心矩形框表示)。Please refer to FIG. 6, which is a second example diagram of obtaining the missing position provided by an embodiment of the present application. As shown in FIG. 6, the missing component category of the missing circuit board is component 3, the number of non-missing components is 1, the number of missing components is 1, and the missing component 3' (indicated by the dotted rectangular box) is missing. After the reference circuit board is aligned with the missing circuit board and the image is subtracted, the missing position of the missing component 3' of the missing circuit board is obtained (indicated by the solid rectangular box).

本实施例通过根据各元器件的电路板信息和检测信息,确定各待检测电路板上各元器件的位置;针对各缺失电路板,将基准电路板与缺失电路板进行比对,确定缺失电路板上各缺失元器件的缺失位置,以获得准确的缺失元器件的缺失位置,使得能够快速定位故障位置,实现自动化监控、数据分析、预防,进而提高生产安全性。This embodiment determines the position of each component on each circuit board to be inspected based on the circuit board information and detection information of each component; for each missing circuit board, the reference circuit board is compared with the missing circuit board to determine the missing position of each missing component on the missing circuit board, so as to obtain the accurate missing position of the missing component, so that the fault position can be quickly located, and automated monitoring, data analysis, and prevention can be realized, thereby improving production safety.

在一个实施例中,在实际情况中,生产线上,一般同一场景下多个待检测电路板会以不同的摆放方向拼接为一个尺寸更大的大电路板。其中摆放方向包括旋转后拼接、翻转后拼接。在该场景中,其他电路板与基准电路板之间的变换关系为左右翻转关系、上下翻转关系、旋转关系。请参照图7,图7是本申请一实施例提供的大电路板的第二种示例图。如图7所示,大电路板(二级电路板)上设置有多个待检测电路板(一级电路板),其中摆放方向包括翻转后拼接。在该情况下,需先判断两个电路板之间的变换关系,对基准电路板进行变换处理,以获得缺失电路板上缺失元器件的缺失位置。In one embodiment, in actual situations, on a production line, multiple circuit boards to be inspected in the same scenario are generally spliced into a larger circuit board in different placement directions. The placement direction includes splicing after rotation and splicing after flipping. In this scenario, the transformation relationship between other circuit boards and the reference circuit board is a left-right flip relationship, an up-down flip relationship, and a rotation relationship. Please refer to Figure 7, which is a second example diagram of a large circuit board provided in an embodiment of the present application. As shown in Figure 7, a plurality of circuit boards to be inspected (primary circuit boards) are arranged on the large circuit board (secondary circuit board), and the placement direction includes splicing after flipping. In this case, it is necessary to first determine the transformation relationship between the two circuit boards, and transform the reference circuit board to obtain the missing position of the missing components on the missing circuit board.

在一种可能的实现方式中,步骤S17,包括:In a possible implementation, step S17 includes:

S31:针对各缺失电路板,确定基准电路板上各元器件与缺失电路板上对应的元器件之间的第二重合度。S31: For each missing circuit board, determining a second degree of coincidence between each component on the reference circuit board and the corresponding component on the missing circuit board.

在应用中,在基准电路板上各元器件与缺失电路板上各元器件对应后,计算对应的两个元器件之间的第二重合度。In the application, after the components on the reference circuit board correspond to the components on the missing circuit board, the second coincidence degree between the corresponding two components is calculated.

S32:若各第二重合度均小于第二预设重合度,则从未选择变换操作中确定当次变换操作。S32: If all second overlaps are smaller than the second preset overlap, determining the current transformation operation from the unselected transformation operations.

在应用中,当各第二重合度均小于第二预设重合度,说明基准电路板的元器件的位置与缺失电路板的元器件的位置不同,需要对基准电路板进行方向变换。然后从未选择变换操作中选择当次变换操作。In the application, when each second overlap is less than the second preset overlap, it means that the position of the components of the reference circuit board is different from the position of the components of the missing circuit board, and the reference circuit board needs to be transformed. Then the current transformation operation is selected from the unselected transformation operations.

其中,可供选择的变换操作是根据实际场景中各待检测电路板之间变换关系确定。The selectable transformation operations are determined according to the transformation relationship between the circuit boards to be detected in the actual scene.

S33:根据当次变换操作,对基准电路板进行方向变换,获得变换后基准电路板。S33: According to the current transformation operation, the reference circuit board is transformed in direction to obtain a transformed reference circuit board.

S34:确定变换后基准电路板上各元器件与缺失电路板上对应的元器件之间的第三重合度。S34: Determine a third degree of coincidence between each component on the transformed reference circuit board and the corresponding component on the missing circuit board.

在应用中,在变换后基准电路板上各元器件与缺失电路板上各元器件对应后,计算对应的两个元器件之间的第三重合度。In the application, after the components on the transformed reference circuit board correspond to the components on the missing circuit board, the third coincidence degree between the corresponding two components is calculated.

S35:若各第三重合度均小于第二预设重合度,则返回执行步骤:从未选择变换操作中确定当次变换操作,直至各第三重合度均大于或等于第二预设重合度,获得目标基准电路板。S35: If each third overlap degree is less than the second preset overlap degree, return to the execution step: determine the current transformation operation from the unselected transformation operations until each third overlap degree is greater than or equal to the second preset overlap degree, and obtain the target reference circuit board.

在应用中,当各第三重合度均小于第二预设重合度,说明变换后基准电路板的元器件的位置与缺失电路板的元器件的位置还是不同,需要继续对基准电路板进行方向变换。然后从未选择变换操作中选择当次变换操作。其中,当前的未选择变换操作不包括上一次已执行的变换操作。In the application, when each third overlap is less than the second preset overlap, it means that the position of the components of the reference circuit board after the transformation is still different from the position of the components of the missing circuit board, and the reference circuit board needs to be further transformed. Then, the current transformation operation is selected from the unselected transformation operations. Among them, the current unselected transformation operation does not include the transformation operation that was executed last time.

然后继续根据当次变换操作对基准电路板进行方向变换,获得变换后基准电路板,确定变换后基准电路板上各元器件与缺失电路板上对应的元器件之间的第三重合度。Then, the reference circuit board is continuously transformed in direction according to the current transformation operation to obtain a transformed reference circuit board, and a third degree of coincidence between each component on the transformed reference circuit board and the corresponding component on the missing circuit board is determined.

若各第三重合度均小于第二预设重合度,则继续从未选择变换操作中确定当次变换操作,直至各第三重合度均大于第二预设重合度。If each of the third degrees of overlap is smaller than the second preset degree of overlap, the current transformation operation continues to be determined from the unselected transformation operations until each of the third degrees of overlap is larger than the second preset degree of overlap.

当各第三重合度均大于或等于第二预设重合度,说明此时获得的变换后基准电路板的元器件的位置与缺失电路板的元器件的位置相同,将该变换后基准电路板确定为目标基准电路板。同时可获得目标变换操作。When each third overlap degree is greater than or equal to the second preset overlap degree, it means that the position of the components of the transformed reference circuit board is the same as the position of the components of the missing circuit board, and the transformed reference circuit board is determined as the target reference circuit board. At the same time, the target transformation operation can be obtained.

S36:将目标基准电路板与缺失电路板进行比对,确定各缺失元器件的缺失位置。S36: Compare the target reference circuit board with the missing circuit board to determine the missing position of each missing component.

示例的,其他电路板与基准电路板之间的变换关系为左右翻转关系、上下翻转关系、旋转关系。对应的,变换操作包括上下翻转、左右翻转、旋转。For example, the transformation relationship between the other circuit boards and the reference circuit board is a left-right flip relationship, an up-down flip relationship, and a rotation relationship. Correspondingly, the transformation operation includes up-down flip, left-right flip, and rotation.

在一般场景中,多个一级电路板需有效拼接成二级电路板,因此变换关系一般具体为180°左右翻转关系、180°上下翻转关系、180°旋转关系。请参照图8,图8是本申请一实施例提供的变换关系的示例图。如图8所示,位于中心的是基准电路板。基准电路板与位于其上方的电路板之间的变换关系为180°上下翻转关系。基准电路板与位于其右方的电路板之间的变换关系为180°左右翻转关系。基准电路板与位于其下方的电路板之间的变换关系为180°旋转关系。In general scenarios, multiple first-level circuit boards need to be effectively spliced into a second-level circuit board, so the transformation relationship is generally specifically a 180° left-right flip relationship, a 180° up-and-down flip relationship, and a 180° rotation relationship. Please refer to Figure 8, which is an example diagram of the transformation relationship provided by an embodiment of the present application. As shown in Figure 8, the reference circuit board is located in the center. The transformation relationship between the reference circuit board and the circuit board located above it is a 180° up-and-down flip relationship. The transformation relationship between the reference circuit board and the circuit board located to its right is a 180° left-right flip relationship. The transformation relationship between the reference circuit board and the circuit board located below it is a 180° rotation relationship.

对应的,变换操作包括180°上下翻转、180°左右翻转、180°旋转。180°上下翻转的公式为:;180°左右翻转的公式为;180°旋转的公式为;其中,(xt,yt)为变换后坐标点,(xb,yb)为变换前坐标点,(xc,yc)为电路板中心坐标点,w、h为电路板的图像宽度、图像高度。Correspondingly, the transformation operations include 180° upside down flip, 180° left-right flip, and 180° rotation. The formula for 180° upside down flip is: ; The formula for 180° flip is ; The formula for 180° rotation is ; Among them, (xt, yt) is the coordinate point after transformation, (xb, yb) is the coordinate point before transformation, (xc, yc) is the center coordinate point of the circuit board, w and h are the image width and image height of the circuit board.

预设基准电路板与缺失电路板之间的变换关系为180°旋转关系。确定基准电路板与缺失电路板之间的第二重合度。各第二重合度均小于第二预设重合度,从未选择变换操作(180°上下翻转、180°左右翻转、180°旋转)中选择当次变换操作:180°左右翻转。对基准电路板进行180°左右翻转操作,获得变换后基准电路板。确定变换后基准电路板与缺失电路板之间的第三重合度。The transformation relationship between the preset reference circuit board and the missing circuit board is a 180° rotation relationship. Determine the second overlap between the reference circuit board and the missing circuit board. Each second overlap is less than the second preset overlap, and select the current transformation operation: 180° left-right flip from the unselected transformation operations (180° up and down flip, 180° left-right flip, 180° rotation). Perform a 180° left-right flip operation on the reference circuit board to obtain a transformed reference circuit board. Determine the third overlap between the transformed reference circuit board and the missing circuit board.

各第三重合度均小于第二预设重合度,继续从未选择变换操作(180°上下翻转、180°旋转)中选择当次变换操作:180°上下翻转。对基准电路板进行180°上下翻转,获得变换后基准电路板。确定变换后基准电路板与缺失电路板之间的第三重合度。If each third overlap is less than the second preset overlap, the current transformation operation is selected from the unselected transformation operations (180° upside down flip, 180° rotation): 180° upside down flip. The reference circuit board is flipped 180° upside down to obtain a transformed reference circuit board. The third overlap between the transformed reference circuit board and the missing circuit board is determined.

各第三重合度均小于第二预设重合度,继续从未选择变换操作(180°旋转)中选择当次变换操作:180°旋转。对基准电路板进行180°旋转,获得变换后基准电路板。确定变换后基准电路板与缺失电路板之间的第三重合度。各第三重合度均大于第二预设重合度,获得基准电路板与缺失电路板之间的变换关系为180°旋转关系,以及目标基准电路板(180°旋转后的基准电路板)。If each third degree of overlap is less than the second preset degree of overlap, the current transformation operation is selected from the unselected transformation operations (180° rotation): 180° rotation. The reference circuit board is rotated 180° to obtain a transformed reference circuit board. The third degree of overlap between the transformed reference circuit board and the missing circuit board is determined. If each third degree of overlap is greater than the second preset degree of overlap, the transformation relationship between the reference circuit board and the missing circuit board is a 180° rotation relationship, and the target reference circuit board (the reference circuit board after 180° rotation) is obtained.

可以理解的是,通过确定变换后基准电路板与缺失电路板之间的重合度,以准确获知基准电路板与缺失电路板之间的变换关系,以及将目标基准电路板与缺失电路板进行比对,确定各缺失元器件的缺失位置,以获得准确的缺失电路板的各缺失元器件的缺失位置,使得能够快速定位故障位置,进一步实现自动化监控、数据分析、预防,进而提高生产安全性。It can be understood that by determining the degree of overlap between the transformed reference circuit board and the missing circuit board, the transformation relationship between the reference circuit board and the missing circuit board can be accurately known, and the target reference circuit board is compared with the missing circuit board to determine the missing position of each missing component, so as to obtain the accurate missing position of each missing component of the missing circuit board, so that the fault position can be quickly located, and automated monitoring, data analysis, and prevention can be further realized, thereby improving production safety.

以及在基准电路板与缺失电路板之间存在变换关系时,能够确定缺失电路板的缺失元器件的缺失位置,进一步提高方案适用性。And when there is a transformation relationship between the reference circuit board and the missing circuit board, the missing position of the missing components of the missing circuit board can be determined, further improving the applicability of the solution.

在一种可能的实现方式中,步骤S17,包括:In a possible implementation, step S17 includes:

S31`:针对各缺失电路板,根据缺失电路板的板类型,确定基准电路板的目标变换操作。S31': For each missing circuit board, determine the target transformation operation of the reference circuit board according to the board type of the missing circuit board.

其中,板类型包括上下翻转板、左右翻转板、旋转板、基准板。Among them, the board types include upside-down flip board, left-right flip board, rotating board, and reference board.

在应用中,利用已训练的目标检测模型,对待检测电路板进行检测,识别待检测电路板的板类型。根据缺失电路板的板类型,确定基准电路板与缺失电路板之间的变换关系,以及基准电路板的目标变换操作。In the application, the trained target detection model is used to detect the circuit board to be detected and identify the board type of the circuit board to be detected. According to the board type of the missing circuit board, the transformation relationship between the reference circuit board and the missing circuit board and the target transformation operation of the reference circuit board are determined.

S32`:根据目标变换操作,对基准电路板进行方向变换,获得目标基准电路板。S32`: According to the target transformation operation, the reference circuit board is transformed in direction to obtain a target reference circuit board.

S33`:将目标基准电路板与缺失电路板进行比对,确定各缺失元器件的缺失位置。S33`: Compare the target reference circuit board with the missing circuit board to determine the missing position of each missing component.

在应用中,目标基准电路板的元器件的位置与缺失电路板的元器件的位置相同,可将目标基准电路板与缺失电路板进行比对,确定各缺失元器件的缺失位置。In an application, the positions of the components of the target reference circuit board are the same as the positions of the components of the missing circuit board. The target reference circuit board can be compared with the missing circuit board to determine the missing position of each missing component.

可以理解的是,根据缺失电路板的板类型,确定基准电路板的目标变换操作,能够快速、准确确定基准电路板与缺失电路板之间的变换关系和目标变换操作,进而将目标基准电路板与缺失电路板进行比对,确定各缺失元器件的缺失位置,以获得准确的缺失电路板的各缺失元器件的缺失位置,使得能够快速定位故障位置,进一步实现自动化监控、数据分析、预防,进而提高生产安全性。It can be understood that by determining the target transformation operation of the reference circuit board based on the board type of the missing circuit board, the transformation relationship and target transformation operation between the reference circuit board and the missing circuit board can be quickly and accurately determined, and then the target reference circuit board is compared with the missing circuit board to determine the missing position of each missing component, so as to obtain the accurate missing position of each missing component of the missing circuit board, so that the fault position can be quickly located, and automated monitoring, data analysis, and prevention can be further realized, thereby improving production safety.

在一个实施例中,步骤S17之前,还包括:In one embodiment, before step S17, the method further includes:

S41:将原始电路板与第一预设数量个参考电路板进行比对,获得第一预设数量个比对结果。S41: Compare the original circuit board with a first preset number of reference circuit boards to obtain a first preset number of comparison results.

其中,原始电路板为预先指定的基准电路板,参考电路板为各元器件类别的元器件数量均为未缺失数量的待检测电路板。The original circuit board is a pre-specified reference circuit board, and the reference circuit board is a circuit board to be tested in which the number of components of each component category is not missing.

一般参考电路板选择位于原始电路板周围的不存在缺失元器件的待检测电路板。参考电路板与原始电路板对齐后,参考电路板的元器件与原始电路的元器件对应匹配。Generally, the reference circuit board is selected as the circuit board to be tested which is located around the original circuit board and does not have any missing components. After the reference circuit board is aligned with the original circuit board, the components of the reference circuit board are matched with the components of the original circuit board.

在应用中,防止出现原始电路板实际存在缺失元器件但未检测到,导致原始电路板作为基准电路板的情况,即防止出现原始电路板误检的情况,将原始电路板与第一预设数量个参考电路板进行比对,获得第一预设数量个比对结果。In the application, to prevent the situation where there are actually missing components in the original circuit board but they are not detected, resulting in the original circuit board being used as the reference circuit board, that is, to prevent the original circuit board from being misdetected, the original circuit board is compared with a first preset number of reference circuit boards to obtain a first preset number of comparison results.

可以理解的是,将原始电路板与第一预设数量个参考电路板进行比对,能够减少出现某个参考电路板存在元器件位置不准确影响原始电路板检测的情况。It can be understood that comparing the original circuit board with the first preset number of reference circuit boards can reduce the situation where the inaccurate position of components on a certain reference circuit board affects the detection of the original circuit board.

S42:若不存在第二预设数量个比对结果为元器件位置正确,则确定其中一个参考电路板为原始电路板,并返回执行步骤:将原始电路板与第一预设数量个参考电路板进行比对,获得第一预设数量个比对结果,直至存在第二预设数量个比对结果为元器件位置正确。S42: If there are not a second preset number of comparison results indicating that the component position is correct, determine that one of the reference circuit boards is the original circuit board, and return to the execution step: compare the original circuit board with the first preset number of reference circuit boards to obtain a first preset number of comparison results, until there are a second preset number of comparison results indicating that the component position is correct.

在应用中,若不存在第二预设数量个比对结果为元器件位置正确,说明原始电路板的情况与周围大部分的参考电路板的情况不一致,包括原始电路板存在元器件缺失和/或各元器件位置不对应,使得原始电路板存在缺失元器件类别,需使用其他未缺失元器件的电路板替换原本的原始电路板,确定其中一个参考电路板为原始电路板。In the application, if there is no second preset number of comparison results showing that the component positions are correct, it means that the situation of the original circuit board is inconsistent with the situation of most of the surrounding reference circuit boards, including missing components on the original circuit board and/or the positions of the components do not correspond, resulting in missing component categories on the original circuit board. It is necessary to use other circuit boards without missing components to replace the original circuit board and determine that one of the reference circuit boards is the original circuit board.

为了确定替换后获得的原始电路板是准确的,继续对替换后获得的原始电路板进行判断。继续将替换后获得的原始电路板与第一预设数量个参考电路板进行比对,获得第一预设数量个比对结果。若还是不存在第二预设数量个比对结果为元器件位置正确,继续将其替换成其他未缺失元器件的电路板,并继续执行步骤:与第一预设数量个参考电路板进行比对,直至存在第二预设数量个比对结果为元器件位置正确。In order to determine whether the original circuit board obtained after replacement is accurate, continue to judge the original circuit board obtained after replacement. Continue to compare the original circuit board obtained after replacement with the first preset number of reference circuit boards to obtain the first preset number of comparison results. If there are still no second preset number of comparison results that the position of the components is correct, continue to replace it with other circuit boards without missing components, and continue to perform the steps of comparing with the first preset number of reference circuit boards until there are second preset number of comparison results that the position of the components is correct.

S43:若存在第二预设数量个比对结果为元器件位置正确,则确定原始电路板为基准电路板。S43: If there are a second preset number of comparison results indicating that the component positions are correct, the original circuit board is determined to be the reference circuit board.

其中,第一预设数量大于第二预设数量。第一预设数量和第二预设数量根据实际场景需求进行设置。The first preset number is greater than the second preset number. The first preset number and the second preset number are set according to actual scene requirements.

在应用中,若存在第二预设数量个比对结果为元器件位置正确,说明原始电路板的情况与周围大部分的参考电路板的情况一致(因可能出现某个参考电路板存在元器件位置不准确,只要求与大部分一致),原始电路板上不存在元器件缺失和各元器件的位置均对应,使得原始电路板不存在缺失元器件类别,然后将其作为基准电路板。In the application, if there are a second preset number of comparison results that the component positions are correct, it means that the situation of the original circuit board is consistent with that of most of the surrounding reference circuit boards (because there may be inaccurate component positions on a certain reference circuit board, it is only required to be consistent with most of them), there are no missing components on the original circuit board and the positions of each component correspond, so that the original circuit board does not have any missing component categories, and then it is used as the reference circuit board.

本实施例通过将原始电路板与第一预设数量个参考电路板进行比对,获得第一预设数量个比对结果,若不存在第二预设数量个比对结果为元器件位置正确,则确定其中一个参考电路板为原始电路板,并返回执行步骤:将原始电路板与第一预设数量个参考电路板进行比对,获得第一预设数量个比对结果,直至存在第二预设数量个比对结果为元器件位置正确;若存在第二预设数量个比对结果为元器件位置正确,则确定原始电路板为基准电路板,能够获得元器件未缺失,且元器件位置准确的基准电路板,为获得准确的缺失元器件的缺失位置提供保障。In this embodiment, the original circuit board is compared with a first preset number of reference circuit boards to obtain a first preset number of comparison results. If there are no comparison results showing that the components are correctly positioned within the second preset number, one of the reference circuit boards is determined to be the original circuit board, and the execution step is returned to: the original circuit board is compared with the first preset number of reference circuit boards to obtain a first preset number of comparison results, until there are comparison results showing that the components are correctly positioned within the second preset number; if there are comparison results showing that the components are correctly positioned within the second preset number, the original circuit board is determined to be a reference circuit board, so that a reference circuit board with no missing components and accurate component positions can be obtained, thereby providing a guarantee for obtaining the accurate missing positions of the missing components.

应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

对应于上文实施例所述的方法,为了便于说明,仅示出了与本申请实施例相关的部分。Corresponding to the method described in the above embodiment, for the convenience of explanation, only the part related to the embodiment of the present application is shown.

请参照图9,图9是本申请一实施例提供的元器件缺失检测装置的结构示意图。如图9所示,所述装置,包括:Please refer to FIG9 , which is a schematic diagram of the structure of a component missing detection device provided by an embodiment of the present application. As shown in FIG9 , the device includes:

目标检测模块10,用于对多个待检测电路板进行目标检测,获得检测结果,各待检测电路板为同一种电路板,检测结果包括各待检测电路板的检测信息和各元器件的检测信息。The target detection module 10 is used to perform target detection on multiple circuit boards to be detected and obtain detection results. The circuit boards to be detected are of the same type. The detection results include detection information of each circuit board to be detected and detection information of each component.

元器件缺失检测模块11,用于根据各待检测电路板的检测信息和各元器件的检测信息,确定各元器件所在的电路板,获得各元器件的电路板信息;The component missing detection module 11 is used to determine the circuit board where each component is located according to the detection information of each circuit board to be detected and the detection information of each component, and obtain the circuit board information of each component;

还用于根据各元器件的电路板信息和检测信息,确定各待检测电路板设置的元器件类别和对应的元器件数量;It is also used to determine the component category and corresponding component quantity of each circuit board to be tested according to the circuit board information and test information of each component;

还用于根据各待检测电路板上各元器件类别的元器件数量,确定各元器件类别的未缺失数量;It is also used to determine the non-missing quantity of each component category according to the quantity of components of each component category on each circuit board to be detected;

还用于根据各元器件类别的未缺失数量,确定缺失电路板和各缺失元器件类别的缺失数量。It is also used to determine the missing quantity of missing circuit boards and each missing component category based on the non-missing quantity of each component category.

在一个实施例中,元器件缺失检测模块,还用于根据各元器件的电路板信息和检测信息,确定各待检测电路板上各元器件的位置;针对各缺失电路板,将基准电路板与缺失电路板进行比对,确定缺失电路板上各缺失元器件的缺失位置,基准电路板为元器件未缺失且元器件位置正确的待检测电路板。In one embodiment, the component missing detection module is also used to determine the position of each component on each circuit board to be detected based on the circuit board information and detection information of each component; for each missing circuit board, the reference circuit board is compared with the missing circuit board to determine the missing position of each missing component on the missing circuit board, and the reference circuit board is a circuit board to be detected in which no components are missing and the component positions are correct.

在一个实施例中,元器件缺失检测模块,具体用于针对各缺失电路板的各缺失元器件类别,确定基准电路板上属于缺失元器件类别的各元器件与缺失电路板上属于缺失元器件类别对应的元器件之间的第一重合度;针对各第一重合度,当第一重合度小于第一预设重合度,获得对应的基准电路板上目标元器件,并根据目标元器件的位置确定对应的缺失元器件的缺失位置;或,针对各缺失电路板,将基准电路板与缺失电路板进行图像做差,获得各目标图像区域和对应的基准电路板上目标元器件,目标图像区域的像素值大于预设像素值;针对各目标图像区域,根据目标图像区域,确定对应目标元器件的缺失元器件的缺失位置;其中,缺失元器件的类型与目标元器件的类型相同。In one embodiment, a missing component detection module is specifically used to determine, for each missing component category of each missing circuit board, a first degree of overlap between each component belonging to the missing component category on the reference circuit board and the component corresponding to the missing component category on the missing circuit board; for each first degree of overlap, when the first degree of overlap is less than a first preset degree of overlap, obtain the corresponding target component on the reference circuit board, and determine the missing position of the corresponding missing component according to the position of the target component; or, for each missing circuit board, perform image subtraction between the reference circuit board and the missing circuit board to obtain each target image area and the corresponding target component on the reference circuit board, the pixel value of the target image area being greater than the preset pixel value; for each target image area, determine the missing position of the missing component corresponding to the target component according to the target image area; wherein the type of the missing component is the same as the type of the target component.

在一个实施例中,元器件缺失检测模块,具体用于针对各缺失电路板,确定基准电路板上各元器件与缺失电路板上对应的元器件之间的第二重合度;若各第二重合度均小于第二预设重合度,则从未选择变换操作中确定当次变换操作;根据当次变换操作,对基准电路板进行方向变换,获得变换后基准电路板;确定变换后基准电路板上各元器件与缺失电路板上对应的元器件之间的第三重合度;若各第三重合度均小于第二预设重合度,则返回执行步骤:从未选择变换操作中确定当次变换操作,直至各第三重合度均大于或等于第二预设重合度,获得目标基准电路板;将目标基准电路板与缺失电路板进行比对,确定各缺失元器件的缺失位置。In one embodiment, a component missing detection module is specifically used to determine, for each missing circuit board, a second degree of overlap between each component on a reference circuit board and a corresponding component on the missing circuit board; if each second degree of overlap is less than a second preset degree of overlap, then determine the current transformation operation from an unselected transformation operation; according to the current transformation operation, perform a direction transformation on the reference circuit board to obtain a transformed reference circuit board; determine a third degree of overlap between each component on the transformed reference circuit board and a corresponding component on the missing circuit board; if each third degree of overlap is less than the second preset degree of overlap, then return to the execution step: determine the current transformation operation from an unselected transformation operation until each third degree of overlap is greater than or equal to the second preset degree of overlap to obtain a target reference circuit board; compare the target reference circuit board with the missing circuit board to determine the missing position of each missing component.

在一个实施例中,元器件缺失检测模块,具体用于针对各缺失电路板,根据缺失电路板的板类型,确定基准电路板的目标变换操作;根据目标变换操作,对基准电路板进行方向变换,获得目标基准电路板;将目标基准电路板与缺失电路板进行比对,确定各缺失元器件的缺失位置。In one embodiment, the missing component detection module is specifically used to determine, for each missing circuit board, a target transformation operation of a reference circuit board according to the board type of the missing circuit board; according to the target transformation operation, transform the direction of the reference circuit board to obtain a target reference circuit board; and compare the target reference circuit board with the missing circuit board to determine the missing position of each missing component.

在一个实施例中,元器件缺失检测模块,还用于将原始电路板与第一预设数量个参考电路板进行比对,获得第一预设数量个比对结果,原始电路板为预先指定的基准电路板,参考电路板为各元器件类别的元器件数量均为未缺失数量的待检测电路板;若不存在第二预设数量个比对结果为元器件位置正确,则确定其中一个参考电路板为原始电路板,并返回执行步骤:将原始电路板与第一预设数量个参考电路板进行比对,获得第一预设数量个比对结果,直至存在第二预设数量个比对结果为元器件位置正确;若存在第二预设数量个比对结果为元器件位置正确,则确定原始电路板为基准电路板;其中,第一预设数量大于第二预设数量。In one embodiment, the component missing detection module is also used to compare the original circuit board with a first preset number of reference circuit boards to obtain a first preset number of comparison results, where the original circuit board is a pre-specified reference circuit board, and the reference circuit board is a circuit board to be detected in which the number of components of each component category is not missing; if there is not a second preset number of comparison results showing that the component positions are correct, then one of the reference circuit boards is determined to be the original circuit board, and the execution step is returned to: compare the original circuit board with the first preset number of reference circuit boards to obtain a first preset number of comparison results, until there is a second preset number of comparison results showing that the component positions are correct; if there is a second preset number of comparison results showing that the component positions are correct, then the original circuit board is determined to be the reference circuit board; wherein the first preset number is greater than the second preset number.

在一个实施例中,目标检测模块,具体用于利用已训练的目标检测模型,对多个待检测电路板进行目标检测,获得检测结果。In one embodiment, the target detection module is specifically used to perform target detection on multiple circuit boards to be detected using a trained target detection model to obtain detection results.

图10为本申请一实施例提供的电子设备的结构示意图。如图10所示,该实施例的电子设备9包括:至少一个处理器90(图10中仅示出一个)、存储器91以及存储在所述存储器91中并可在所述至少一个处理器90上运行的计算机程序99,所述处理器90执行所述计算机程序99时实现上述任意各个方法实施例中的步骤。Figure 10 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. As shown in Figure 10, the electronic device 9 of this embodiment includes: at least one processor 90 (only one is shown in Figure 10), a memory 91, and a computer program 99 stored in the memory 91 and executable on the at least one processor 90, and when the processor 90 executes the computer program 99, the steps in any of the above-mentioned method embodiments are implemented.

所述电子设备9可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。该电子设备9可包括,但不仅限于,处理器90、存储器91。本领域技术人员可以理解,图10仅仅是电子设备9的举例,并不构成对电子设备9的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如还可以包括输入输出设备、网络接入设备等。The electronic device 9 may be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server. The electronic device 9 may include, but is not limited to, a processor 90 and a memory 91. Those skilled in the art may understand that FIG. 10 is only an example of the electronic device 9 and does not constitute a limitation on the electronic device 9. The electronic device 9 may include more or fewer components than shown in the figure, or may combine certain components, or different components, for example, may also include input and output devices, network access devices, etc.

所述处理器90可以是中央处理单元(Central Processing Unit,CPU),该处理器90还可以是其他通用处理器、数字信号处理器 (Digital Signal Processor,DSP)、专用集成电路 (Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA) 或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 90 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

所述存储器91在一些实施例中可以是所述电子设备9的内部存储单元,例如电子设备9的硬盘或内存。所述存储器91在另一些实施例中也可以是所述电子设备9的外部存储设备,例如所述电子设备9上配备的插接式硬盘,智能存储卡(Smart Media Card, SMC),安全数字(Secure Digital, SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器91还可以既包括所述电子设备9的内部存储单元也包括外部存储设备。所述存储器91用于存储操作系统、应用程序、引导装载程序(BootLoader)、数据以及其他程序等,例如所述计算机程序的程序代码等。所述存储器91还可以用于暂时地存储已经输出或者将要输出的数据。In some embodiments, the memory 91 may be an internal storage unit of the electronic device 9, such as a hard disk or memory of the electronic device 9. In other embodiments, the memory 91 may also be an external storage device of the electronic device 9, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 9. Further, the memory 91 may also include both an internal storage unit of the electronic device 9 and an external storage device. The memory 91 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 91 may also be used to temporarily store data that has been output or is to be output.

需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。It should be noted that the information interaction, execution process, etc. between the above-mentioned devices/units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时可实现上述各个方法实施例中的步骤。An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

本申请实施例提供了一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行时可实现上述各个方法实施例中的步骤。An embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/终端设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,RandomAccess Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些情况下,计算机可读介质不可以是电载波信号和电信信号。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera/terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some cases, the computer-readable medium cannot be an electric carrier signal and a telecommunication signal.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

在本申请所提供的实施例中,应该理解到,所揭露的装置/网络设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/网络设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in the present application, it should be understood that the disclosed devices/network equipment and methods can be implemented in other ways. For example, the device/network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

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

以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims (9)

1. A component missing detection method is characterized by comprising the following steps:
Performing target detection on a plurality of circuit boards to be detected to obtain detection results, wherein each circuit board to be detected is the same circuit board, and the detection results comprise detection information of each circuit board to be detected and detection information of each component;
determining a circuit board where each component is located according to the detection information of each circuit board to be detected and the detection information of each component, and obtaining circuit board information of each component;
determining the types of the components and the number of the corresponding components, which are arranged on each circuit board to be detected, according to the circuit board information and the detection information of each component;
Determining the undelayed quantity of each component category according to the quantity of the components of each component category on each circuit board to be detected;
And determining the missing circuit board and the missing quantity of each missing component category according to the missing quantity of each component category.
2. The method as recited in claim 1, further comprising:
Determining the positions of components on the circuit boards to be detected according to the circuit board information and the detection information of the components;
And comparing the reference circuit board with the missing circuit boards aiming at the missing circuit boards, and determining missing positions of missing components on the missing circuit boards, wherein the reference circuit board is a circuit board to be detected, the components of which are not missing and the positions of the components are correct.
3. The method of claim 2, wherein the comparing the reference circuit board with the missing circuit boards for each missing circuit board to determine missing positions of each missing component on the missing circuit board comprises:
Determining a first contact ratio between each component belonging to the missing component category on the reference circuit board and the component corresponding to the missing component category on the missing circuit board according to each missing component category of each missing circuit board;
For each first contact ratio, when the first contact ratio is smaller than a first preset contact ratio, obtaining a corresponding target component on the reference circuit board, and determining the missing position of the corresponding missing component according to the position of the target component;
Or, for each missing circuit board, performing image difference on the reference circuit board and the missing circuit board to obtain each target image area and the corresponding target component on the reference circuit board, wherein the pixel value of the target image area is larger than a preset pixel value;
determining the missing positions of the missing components corresponding to the target components according to the target image areas for each target image area;
the type of the missing component is the same as the type of the target component.
4. The method of claim 2, wherein the comparing the reference circuit board with the missing circuit boards for each missing circuit board to determine missing positions of each missing component on the missing circuit board comprises:
for each missing circuit board, determining a second degree of coincidence between each component on the reference circuit board and the corresponding component on the missing circuit board;
If the second overlapping degree is smaller than the second preset overlapping degree, determining the current transformation operation from the unselected transformation operations;
According to the current transformation operation, carrying out direction transformation on the reference circuit board to obtain a transformed reference circuit board;
Determining a third degree of integration between each component on the transformed reference circuit board and the corresponding component on the missing circuit board;
if each third degree of overlap is smaller than the second preset degree of overlap, returning to the execution step: determining the current transformation operation from the unselected transformation operations until each third contact ratio is greater than or equal to the second preset contact ratio, so as to obtain a target reference circuit board;
and comparing the target reference circuit board with the missing circuit board to determine the missing position of each missing component.
5. The method of claim 2, wherein the comparing the reference circuit board with the missing circuit boards for each missing circuit board to determine missing positions of each missing component on the missing circuit board comprises:
for each missing circuit board, determining target transformation operation of the reference circuit board according to the board type of the missing circuit board;
According to the target transformation operation, carrying out direction transformation on the reference circuit board to obtain a target reference circuit board;
and comparing the target reference circuit board with the missing circuit board to determine the missing position of each missing component.
6. The method of claim 2, wherein the comparing the reference circuit board with the missing circuit board for each missing circuit board, before determining the missing position of each missing component on the missing circuit board, further comprises:
comparing an original circuit board with a first preset number of reference circuit boards to obtain a first preset number of comparison results, wherein the original circuit board is a pre-designated reference circuit board, and the reference circuit board is a circuit board to be detected with the number of components of each component category being the non-missing number;
If the second preset number of comparison results are that the positions of the components are correct, determining one of the reference circuit boards as the original circuit board, and returning to the execution step: comparing the original circuit board with a first preset number of reference circuit boards to obtain a first preset number of comparison results until the second preset number of comparison results exist, and the positions of the components are correct;
if the second preset number of comparison results are that the positions of the components are correct, determining that the original circuit board is the reference circuit board;
wherein the first preset number is greater than the second preset number.
7. The method according to any one of claims 1 to 6, wherein performing object detection on the plurality of circuit boards to be detected to obtain a detection result includes:
And carrying out target detection on a plurality of circuit boards to be detected by using the trained target detection model to obtain detection results.
8. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 7 when the computer program is executed.
9. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the method according to any one of claims 1 to 7.
CN202410833127.5A 2024-06-26 2024-06-26 A component missing detection method, electronic device and readable storage medium Active CN118393327B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410833127.5A CN118393327B (en) 2024-06-26 2024-06-26 A component missing detection method, electronic device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410833127.5A CN118393327B (en) 2024-06-26 2024-06-26 A component missing detection method, electronic device and readable storage medium

Publications (2)

Publication Number Publication Date
CN118393327A true CN118393327A (en) 2024-07-26
CN118393327B CN118393327B (en) 2024-09-06

Family

ID=92001572

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410833127.5A Active CN118393327B (en) 2024-06-26 2024-06-26 A component missing detection method, electronic device and readable storage medium

Country Status (1)

Country Link
CN (1) CN118393327B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119269946A (en) * 2024-11-21 2025-01-07 佛山市美瑞电子科技有限公司 A circuit board component missing detection method based on electrical performance parameters

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022021151A1 (en) * 2020-07-29 2022-02-03 西门子(中国)有限公司 Inspection method and device for assembled assemblies of production line
CN115937170A (en) * 2022-12-23 2023-04-07 正泰集团研发中心(上海)有限公司 Circuit board detection method and device, computer equipment and storage medium
CN116228741A (en) * 2023-04-10 2023-06-06 广东工业大学 PCBA (printed circuit board assembly) component defect detection method and device
CN117871545A (en) * 2023-12-25 2024-04-12 人工智能与数字经济广东省实验室(深圳) Method and device for detecting defects of circuit board components, terminal and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022021151A1 (en) * 2020-07-29 2022-02-03 西门子(中国)有限公司 Inspection method and device for assembled assemblies of production line
CN115937170A (en) * 2022-12-23 2023-04-07 正泰集团研发中心(上海)有限公司 Circuit board detection method and device, computer equipment and storage medium
CN116228741A (en) * 2023-04-10 2023-06-06 广东工业大学 PCBA (printed circuit board assembly) component defect detection method and device
CN117871545A (en) * 2023-12-25 2024-04-12 人工智能与数字经济广东省实验室(深圳) Method and device for detecting defects of circuit board components, terminal and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
黄艳军等: "电路板元器件缺陷检测研究", 数字技术与应用, vol. 37, no. 03, 25 March 2019 (2019-03-25), pages 110 - 111 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119269946A (en) * 2024-11-21 2025-01-07 佛山市美瑞电子科技有限公司 A circuit board component missing detection method based on electrical performance parameters

Also Published As

Publication number Publication date
CN118393327B (en) 2024-09-06

Similar Documents

Publication Publication Date Title
CN113077524B (en) Automatic calibration method, device and equipment for binocular fisheye camera and storage medium
WO2023185234A1 (en) Image processing method and apparatus, and electronic device and storage medium
CN110929738A (en) Certificate card edge detection method, device, equipment and readable storage medium
JP7121132B2 (en) Image processing method, apparatus and electronic equipment
CN111768346A (en) Method, device and equipment for correcting back image of identity card and storage medium
CN118393327B (en) A component missing detection method, electronic device and readable storage medium
CN118587213B (en) Vision-based bottle-down counting method and device on filling production line and readable medium
CN118450090A (en) A camera inspection method and device based on blockchain
CN114067145B (en) Passive optical splitter detection method, device, equipment and medium
CN111768345A (en) Method, device and equipment for correcting back image of identity card and storage medium
CN117094986A (en) Self-adaptive defect detection method based on small sample and terminal equipment
CN111291767A (en) Fine granularity identification method, terminal equipment and computer readable storage medium
CN113870292B (en) Edge detection method and device of depth image and electronic equipment
CN116071586A (en) Image screening method, device, electronic equipment and computer readable storage medium
WO2021073576A1 (en) Intelligent vehicle verification method and system, computer device, and storage medium
CN110929708A (en) Method, equipment and storage medium for identifying national flag in Thai identity card
CN115049620B (en) Paper stack appearance detection method, device, equipment and storage medium
CN111832491B (en) Text detection method, device and processing equipment
CN118038464A (en) License plate detection method based on segmentation network and with arbitrary inclination angle
CN117291862A (en) Data analysis method, device, equipment and computer readable storage medium
CN115082932A (en) Text positioning method and electronic equipment
CN117829080A (en) Method, device, equipment and storage medium for processing interval error result
CN118674766A (en) Tunnel water seepage area detection method, detection terminal and storage medium
CN118570543A (en) Weld joint type identification method based on man-machine interaction, terminal and storage medium
CN118447347A (en) Image processing method, device, terminal device and computer readable 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
GR01 Patent grant
GR01 Patent grant