Method, device and equipment for generating template of circuit board and storage medium
By obtaining and matching the attribute information of the standard positioning frame and the captured image, the circuit board template is generated, which solves the problems of long time and low accuracy of printed circuit board template generation, and achieves efficient and accurate template generation.
Patent Information
- Application Number
- CN202310207146.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-27
- Publication Date
- 2024-08-27
AI Technical Summary
During the processing of printed circuit boards, it takes a long time to generate templates, the efficiency is low, and the accuracy of the positioning frame is difficult to guarantee, requiring manual adjustment.
By obtaining the attribute information of the standard positioning frame and the captured image, the target positioning frame that matches the standard positioning frame is determined, and the device tag number is marked on the target positioning frame to generate a circuit board template, and the relative information of the standard positioning frame is used to shorten the generated template. time and improve efficiency.
It greatly shortens the time to generate templates, improves the efficiency of template generation, ensures the accuracy of positioning frames, and reduces the need for manual adjustments.
Smart Images

Figure CN118551701A
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic detection technology, and in particular to a method, device, equipment and storage medium for generating a template for a circuit board. Background Art
[0002] At present, in the process of processing printed circuit boards (PCBs), an automatic optical inspection (AOI) system is usually used to perform quality inspection on the inspection targets corresponding to the components on the PCB (the inspection targets are, for example, the pads, solder joints, and plug-in directions of the components). For example, for the PCB to be inspected, the AOI system is used to photograph the PCB to obtain a photographed image, and then, with the PCB template (a standard PCB photographed image marked with a positioning frame, which can indicate the position of the inspection target on the component) as a reference, the photographed image is compared with the template to determine the position of the inspection target on the component in the photographed image, so as to perform quality inspection on these inspection targets.
[0003] In the related art, when generating a PCB template, a corresponding positioning frame is usually directly added to the captured image of the standard PCB based on the attribute information of the positioning frame (such as the position, size, rotation angle, etc. of the positioning frame). However, this method is difficult to ensure the accuracy of the positioning frame, and manual intervention is often required to adjust the positioning frame, resulting in a long time-consuming and low efficiency in generating the template. Summary of the invention
[0004] The embodiment of the present application provides a method, device, equipment and storage medium for generating a circuit board template, which can significantly shorten the time for generating a template and effectively improve the efficiency of generating a template. The technical solution is as follows:
[0005] In a first aspect, a method for generating a template of a circuit board is provided, wherein the circuit board includes components, and a detection target is correspondingly disposed on the components, and the method includes:
[0006] Acquire attribute information of a standard positioning frame of the circuit board and a captured image of the circuit board, wherein the standard positioning frame indicates the position of the detection target on the component, the attribute information of the standard positioning frame includes a distance between the standard positioning frame and the component center, a size of the standard positioning frame, and a type of the standard positioning frame, and the captured image includes at least one first positioning frame, which refers to a pre-marked positioning frame;
[0007] Based on the attribute information of the standard positioning frame and the captured image, determining a target positioning frame that matches the attribute information of the standard positioning frame from the at least one first positioning frame;
[0008] The component position number of the component is marked on the target positioning frame in the captured image to generate a template of the circuit board, wherein the component position number indicates the position of the component on the circuit board.
[0009] In the above method, since the attribute information of the standard positioning frame records the relative information of the standard positioning frame, and the positioning frame is pre-marked on the captured image, according to the attribute information of the standard positioning frame, the target positioning frame that matches the attribute information of the standard positioning frame can be found from the positioning frame pre-marked on the captured image, and the template of the circuit board is generated by marking the device position number of the component on the target positioning frame, thereby greatly shortening the time for generating the template and effectively improving the efficiency of generating the template. In contrast, the solution of directly generating the positioning frame on the captured image according to the attribute information of the standard positioning frame in the related art is highly dependent on the attribute information of the standard positioning frame, and has weak generalization ability. After the positioning frame is generated, manual adjustment is often required, resulting in a long time-consuming template generation.
[0010] In some embodiments, the determining, from the at least one first positioning frame, a target positioning frame that matches the attribute information of the standard positioning frame based on the attribute information of the standard positioning frame and the captured image, includes:
[0011] Determining an attribute difference between the standard positioning frame and the at least one first positioning frame based on the attribute information of the standard positioning frame and the captured image;
[0012] Based on the attribute difference between the standard positioning frame and the at least one first positioning frame, a target positioning frame matching the attribute information of the standard positioning frame is determined from the at least one first positioning frame.
[0013] In some embodiments, the attribute information matching with the standard positioning frame means that the attribute difference with the standard positioning frame is a minimum attribute difference, and the minimum attribute difference is less than a target threshold.
[0014] Through the above method, the minimum attribute difference between the standard positioning frame and each first positioning frame is determined by using the attribute information of the standard positioning frame, so as to determine the target positioning frame matching the standard positioning frame, thereby ensuring the accuracy of the target positioning frame.
[0015] In some embodiments, the captured image is a captured image including a plurality of the components on the circuit board, and the component position numbers of the components are marked on the target positioning frame in the captured image, and the template of the circuit board is generated, including:
[0016] Marking the device position number of the component on the target positioning frame in the captured image to obtain the marked captured image;
[0017] Based on the captured image, a plurality of sub-captured images of the circuit board are acquired, wherein the sub-captured images include at least one of the components and at least one second positioning frame, where the second positioning frame refers to a pre-marked positioning frame;
[0018] The marked captured image and each of the sub-captured images are registered to determine the target positioning frame in each of the sub-captured images, and the device position number of the component is marked on the target positioning frame in each of the sub-captured images to generate a template for the circuit board.
[0019] It should be understood that the sub-shot image of the circuit board is the FOV image obtained by re-shooting the complete shot image of the circuit board. Through the above method, a template based on the sub-shot image can be generated. In other words, the generated template of the circuit board is a plurality of FOV images marked with positioning frames. In this way, in the subsequent quality inspection process of the circuit board, the FOV image of the circuit board to be inspected can be directly compared with the template, thereby greatly improving the quality inspection efficiency of the circuit board.
[0020] In some embodiments, the captured image is a plurality of sub-captured images of the circuit board, the sub-captured images include at least one of the components and at least one second positioning frame, the second positioning frame refers to a pre-marked positioning frame, the component position number of the component is marked on the target positioning frame in the captured image, and the template of the circuit board is generated, including:
[0021] The device position number of the component is marked on the target positioning frame in each of the sub-shot images to obtain a plurality of the marked sub-shot images and generate a template of the circuit board.
[0022] Through the above method, the template of the circuit board generated is a plurality of FOV images marked with positioning frames. In this way, in the subsequent circuit board quality inspection process, the FOV image of the circuit board to be inspected can be directly compared with the template, thereby greatly improving the circuit board quality inspection efficiency.
[0023] In some embodiments, the method further comprises:
[0024] Acquire a component image of the component, and determine the standard positioning frame based on the position of the detection target on the component in the component image;
[0025] Based on the distance between the standard positioning frame and the component center of the component in the component image, the size of the standard positioning frame, and the type of the standard positioning frame, attribute information of the standard positioning frame is determined.
[0026] In some embodiments, the method further comprises:
[0027] If the target positioning frame that matches the attribute information of the standard positioning frame is not determined from the at least one first positioning frame, a third positioning frame is generated based on the attribute information of the standard positioning frame, the third positioning frame is added to the captured image, and the device position number of the component is marked on the third positioning frame.
[0028] In this way, a safety mechanism is provided to ensure that each detection target corresponding to each component in the captured image has a positioning frame, thereby ensuring the accuracy of the circuit board template.
[0029] In some embodiments, the method is performed by a computing device, the computing device is associated with a circuit board quality inspection platform, and the method further includes:
[0030] Receiving a template generation request sent by the circuit board quality inspection platform, wherein the template generation request indicates generating a template of the circuit board for the circuit board;
[0031] The acquiring the property information of the standard target frame of the circuit board and the captured image of the circuit board includes: acquiring the property information of the standard target frame and the captured image of the circuit board based on the template generation request.
[0032] In some embodiments, the method further comprises:
[0033] Receiving a circuit board quality inspection request sent by the circuit board quality inspection platform, wherein the circuit board quality inspection request indicates to perform quality inspection on the circuit board to be inspected;
[0034] Based on the circuit board quality inspection request, a first captured image of the circuit board to be inspected is obtained, a template of the circuit board is registered with the first captured image, and a position of the inspection target on the component in the first captured image is determined;
[0035] Based on the position of the inspection target on the component in the first captured image, the inspection target is quality inspected to obtain a quality inspection result of the circuit board.
[0036] In a second aspect, an embodiment of the present application provides a device for generating a template for a circuit board, the device comprising at least one functional module for executing a method for generating a template for a circuit board as provided in the aforementioned first aspect or any possible implementation of the first aspect.
[0037] In a third aspect, an embodiment of the present application provides a computing device, comprising a processor and a memory, wherein the memory is used to store at least one piece of program code, and the at least one piece of program code is loaded by the processor and executed as provided in the first aspect or any possible implementation of the first aspect.
[0038] In a fourth aspect, an embodiment of the present application provides a computing device cluster, comprising at least one computing device, each computing device comprising a processor and a memory; the processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method for generating a template for a circuit board as provided in the aforementioned first aspect or any possible implementation of the first aspect.
[0039] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, including computer program instructions. When the computer program instructions are executed by a computing device, the computing device executes the method for generating a circuit board template as provided in the first aspect or any possible implementation of the first aspect; or, when the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method for generating a circuit board template as provided in the first aspect or any possible implementation of the first aspect. The storage medium includes but is not limited to volatile memory, such as random access memory, non-volatile memory, such as flash memory, hard disk drive (HDD), solid state drive (SSD).
[0040] In a sixth aspect, an embodiment of the present application provides a computer program product, which, when running on a computing device, enables the computing device to implement the method for generating a template for a circuit board as provided in the aforementioned first aspect or any possible implementation of the first aspect; or, when running on a computing device cluster, enables the computing device cluster to implement the method for generating a template for a circuit board as provided in the aforementioned first aspect or any possible implementation of the first aspect; the computer program product may be a software installation package, and when the method needs to be implemented, the computer program product may be downloaded and executed on a computing device or a computing device cluster. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 This is a schematic diagram of a template of a circuit board provided in an embodiment of the present application;
[0042] Figure 2is a schematic diagram of a circuit board quality inspection process provided by an embodiment of the present application;
[0043] Figure 3 It is a schematic diagram of an implementation environment provided by an embodiment of the present application;
[0044] Figure 4 is a schematic diagram of the architecture of a computing device provided in an embodiment of the present application;
[0045] Figure 5 is a schematic diagram of the hardware structure of a computing device provided in an embodiment of the present application;
[0046] Figure 6 It is a flow chart of a method for generating a template of a circuit board provided in an embodiment of the present application;
[0047] Figure 7 is a schematic diagram of a component library provided in an embodiment of the present application;
[0048] Figure 8 It is a schematic diagram of creating a component library provided by an embodiment of the present application;
[0049] Fig. 9 is a schematic diagram of a search target positioning frame provided in an embodiment of the present application;
[0050] Fig.10 It is a schematic diagram of generating a circuit board template and performing quality inspection on a circuit board provided in an embodiment of the present application;
[0051] Fig.11 It is a schematic diagram of generating a circuit board template provided by an embodiment of the present application;
[0052] Fig.12 It is a structural schematic diagram of a device for generating a template for a circuit board provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0054] For ease of understanding, the key terms and key concepts involved in this application are explained below.
[0055] Artificial intelligence quality inspection (AI quality inspection) refers to an industrial quality inspection method based on artificial intelligence. Its main method is to conduct quality inspection on products in industry based on the application of deep learning in the field of computer vision.
[0056] The automatic optical inspection (AOI) system is a system that detects common defects of products based on optical principles. The AOI system is based on mechanical vision inspection technology, using cameras or other types of photoelectric sensors to replace human eyes to obtain images or information of products to be inspected, and using computer programming algorithms to replace human brains for image processing, analysis, and quality inspection to obtain product quality inspection results. In the embodiments of the present application, the device used to photograph products in the AOI system is referred to as an AOI device.
[0057] PCB (printed circuit board and assembly, PCBA) with components refers to a PCB that has completed the welding process, assembled components on the surface, and has completed electrical connection performance. It should be understood that the circuit boards involved in this application are all PCBA, referred to as circuit board PCB, and will not be repeated in the following.
[0058] The template of a circuit board is a standard circuit board captured image marked with a positioning frame, which can indicate the position of the detection target on the component, wherein the detection target is, for example, the pad, solder point, plug-in direction, etc. of the component, which is not limited. It should be understood that in the circuit board quality inspection scenario, for the circuit board to be inspected, the circuit board is photographed to obtain a captured image, and then, with the template of the circuit board as a reference, the captured image is compared with the template to determine the position of the detection target on the component in the captured image, and the detection target is inspected according to the position of the detection target to obtain a quality inspection result.
[0059] A part reference is a part identification mark on a circuit board. It can indicate the location of a component on the circuit board. The part references at the same location on circuit boards of the same model are unique and identical.
[0060] The application scenarios of this application are introduced below.
[0061] The present application provides a method for generating a template for a circuit board, which can be applied to a circuit board quality inspection scenario. At present, in a circuit board quality inspection scenario, an AOI device is usually used to photograph the circuit board to obtain a photographed image of the circuit board. Since the size of the photographed image of the circuit board is large, the AOI device will re-photograph the photographed image according to a specified trajectory to obtain a field of view (FOV) image (also referred to as a sub-photographed image of the circuit board in this application), and perform quality inspection based on these FOV images. Accordingly, in order to determine the position of the detection target on the component on the FOV image, it is necessary to generate a template based on the FOV image. Schematically, refer to Figure 1 , Figure 1Schematic diagram of a circuit board template provided by an embodiment of the present application. Figure 1 As shown, for the components on the circuit board (as shown in position 1 and position 2), the computer aided design (CAD) file information usually includes the device identification, coordinates and device position number of the components. After the circuit board is photographed to obtain a captured image (this captured image is also a complete captured image of the circuit board), a positioning frame is added to the captured image, and the type of the detection target (such as plug-in, patch, etc.) and the device position number of the component to which the detection target belongs are marked on the positioning frame. In this way, the position of the detection target on the component can be indicated by the positioning frame, thereby generating a template for the circuit board. Furthermore, based on the template, a positioning frame is added to the FOV image of the circuit board (obtained by photographing the captured image again), and the type of the detection target and the device position number of the component to which the detection target belongs are marked on the positioning frame to obtain a template based on the FOV image. In this way, in the subsequent quality inspection process of the circuit board, quality inspection can be performed based on the FOV image (of course, quality inspection can also be performed directly based on the complete captured image of the circuit board, and the present application is not limited to this). For example, refer to Figure 2 , Figure 2 FIG. 1 is a schematic diagram of a circuit board quality inspection process provided by an embodiment of the present application. Figure 2 As shown, in the process of generating a template for a circuit board, a positioning frame is added to the FOV image of the circuit board, and the type of the detection target and the device position number of the component to which the detection target belongs are marked on the positioning frame to obtain a template based on the FOV image. In the process of circuit board quality inspection, the FOV image and template of the circuit board to be inspected are two-dimensionally aligned (i.e., 2D alignment) to determine the position of the detection target on the component in the FOV image to be inspected, and the detection target is inspected to obtain a quality inspection result. For example, the area where the detection target is located in the FOV image is cut out, and the image of the detection target is input into the classification model to identify whether the detection target has defects. This application does not limit the process of how to achieve defect recognition.
[0062] Based on the above circuit board quality inspection scenario, the present application provides a method for generating a circuit board template, which can save time for generating templates and improve the efficiency of generating templates. The implementation environment of the present application is introduced below.
[0063] Figure 3 This is a schematic diagram of an implementation environment provided by the embodiment of the present application. Figure 3 As shown, the implementation environment includes a circuit board quality inspection platform 100 and a computing device 200. The circuit board quality inspection platform 100 and the computing device 200 are directly or indirectly connected via a wired network or a wireless network, which is not limited here.
[0064] The circuit board quality inspection platform 100 is used to provide users with the functions of generating templates for circuit boards and performing quality inspection on circuit boards to be inspected. Schematically, the circuit board quality inspection platform 100 runs on a terminal, which can be at least one of a smart phone, a desktop computer, an augmented reality terminal, a tablet computer, an e-book reader, and a laptop. For example, the terminal runs the circuit board quality inspection platform 100 in the form of a client, displays the operation interface of the circuit board quality inspection platform 100, generates a template for the circuit board in response to a template generation operation for the circuit board implemented by the user on the operation interface; and, in response to a quality inspection operation for the circuit board to be inspected implemented by the user on the operation interface, performs quality inspection on the circuit board to be inspected and obtains a quality inspection result.
[0065] The computing device 200 is used to provide background services for the circuit board quality inspection platform 100, that is, to execute the method for generating the template of the circuit board provided by the present application. Schematically, the computing device 200 receives the template generation request for the circuit board sent by the circuit board quality inspection platform 100, generates the corresponding template, and receives the quality inspection request for the circuit board to be inspected sent by the circuit board quality inspection platform 100, performs quality inspection on the circuit board, outputs the quality inspection result, etc., and the present application is not limited thereto. The computing device 200 can be an independent physical server, or a server cluster or distributed file system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (content delivery networks, CDN) and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms. In some embodiments, taking the computing device 200 as a cloud server as an example, the computing device 200 can also be referred to as a cloud platform (i.e., the abbreviation of cloud computing platform), which refers to a service based on hardware resources and software resources, providing computing, network and storage capabilities. Through the network "cloud", huge data computing is processed and analyzed remotely and then returned to the user, with the characteristics of large-scale, distributed, virtualized, high availability, scalability, on-demand service and security. The cloud platform can achieve the rapid release and publication of configurable computing resources with a small management cost or low interaction complexity between users and service providers.
[0066] In some embodiments, the implementation environment further includes an AOI device 300, which is used to photograph the circuit board to obtain a photographed image of the circuit board (including the original complete photographed image and FOV image of the circuit board, etc., but the present application is not limited thereto), so that the circuit board quality inspection platform 100 and / or the computing device 200 can realize the function of generating a template for the circuit board and the function of performing quality inspection on the circuit board to be inspected according to the photographed image output by the AOI device 300. Schematically, the implementation environment can also be understood as an AOI system.
[0067] In some embodiments, when implementing the above-mentioned functions of generating templates for circuit boards and performing quality inspection on circuit boards to be inspected, the circuit board quality inspection platform 100 and the computing device 200 can work together or separately. For example, if the terminal running the circuit board quality inspection platform 100 has data processing capabilities, the circuit board quality inspection platform 100 can generate templates for circuit boards by itself without the need for the computing device 200 to provide background services. This application does not limit this. In addition, the figures are only for illustrative purposes, and this application does not limit the number and type of each device in the implementation environment.
[0068] In addition, the above wireless network or wired network uses standard communication technology and / or protocol. The network includes but is not limited to a data center network, a storage area network (SAN), a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a dedicated network or any combination of a virtual private network. In some implementations, technologies and / or formats including hypertext markup language (HTML), extensible markup language (XML) are used to represent data exchanged through the network. In addition, conventional encryption technologies such as secure sockets layer (SSL), transport layer security (TLS), virtual private network (VPN), and Internet protocol security (IPsec) can also be used to encrypt all or part of the links. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above data communication technologies.
[0069] The functions of the computing device 200 are introduced below.
[0070] Figure 4 is a schematic diagram of the architecture of a computing device provided in an embodiment of the present application. It should be understood that Figure 4 The structure diagram of the computing device 200 is merely an exemplary diagram. The present application does not limit the division of the functions of the computing device 200. Schematically, Figure 4 As shown, taking the computing device 200 providing background services for the circuit board quality inspection platform 100, that is, executing the method for generating a circuit board template provided in the present application as an example, the functions possessed by the computing device 200 include but are not limited to: information acquisition function 201, positioning frame determination function 202 and template generation function 203. In some embodiments, the computing device 200 also includes a component library creation function 204, a circuit board quality inspection function 205 and a storage function 206, etc., but the present application is not limited to this.
[0071] The information acquisition function 201 is used to obtain the attribute information of the standard positioning frame of the circuit board and the captured image of the circuit board, wherein the circuit board refers to the circuit board for which the template is to be generated, which can be understood as a standard circuit board, or a qualified circuit board, and the circuit board includes components, and the components correspond to detection targets. The standard positioning frame can indicate the position of the detection target on the component, and the attribute information of the standard positioning frame includes the distance between the standard positioning frame and the device center of the component, the size of the standard positioning frame, and the type of the standard positioning frame, etc. In addition, the captured image of the circuit board includes at least one first positioning frame, which refers to a pre-marked positioning frame. For example, the first positioning frame is a positioning frame pre-marked based on a target positioning model, and the target positioning model can be a neural network model based on a YOLO algorithm (such as a YOLOX algorithm, wherein YOLO is the abbreviation of "you only look once", which is a common target detection algorithm), and the present application is not limited to this.
[0072] The positioning frame determination function 202 is used to determine a target positioning frame that matches the attribute information of the standard positioning frame from at least one first positioning frame based on the attribute information of the standard positioning frame and the captured image. This process is to use the attribute information of the standard positioning frame to find the first positioning frame that is most similar to the standard positioning frame in the captured image of the circuit board and use it as the target positioning frame.
[0073] The template generation function 203 is used to mark the device position number of the component on the target positioning frame in the captured image to generate a template of the circuit board, and the device position number indicates the position of the component on the circuit board. This process is that after finding the target positioning frame in the captured image of the circuit board, the component to which the target positioning frame belongs can be determined according to the standard positioning frame matching the target positioning frame. Based on this, the device position number of the component to which it belongs is marked on the target positioning frame to complete the template construction of the circuit board.
[0074] The component library creation function 204 is used to determine the attribute information of the standard positioning frame according to the relevant information of the detection target on the component image of the component, and store the attribute information of the standard positioning frame in the component library to provide technical support for generating a circuit board template.
[0075] The circuit board quality inspection function 205 is used to perform quality inspection on the circuit board to be inspected according to the quality inspection request for the circuit board and based on the template of the circuit board to obtain the quality inspection result of the circuit board.
[0076] The storage function 206 is used to store the CAD file of the circuit board, the attribute information of the standard positioning frame (ie, the component library), the generated circuit board template, and the target positioning model for pre-marking the positioning frame, etc., but the present application is not limited thereto.
[0077] In addition, the functions of the computing device 200 are not limited to the above-mentioned 201 to 206. In actual applications, more functions can be set according to user needs. For example, the computing device 200 also has a positioning frame pre-marking function (i.e., using the target positioning model to pre-mark the positioning frame on the captured image), a CAD alignment function (i.e., aligning the coordinates of the circuit board in the CAD file with the coordinates of the circuit board on the captured image) and an image registration function (such as aligning the captured image of the circuit board to be inspected with the template), etc. It should be understood that the embodiment of the present application does not limit the function setting of the computing device 200.
[0078] Through the above functions, the computing device 200 provided by the present application can realize the function of generating templates for circuit boards and the function of performing quality inspection on circuit boards to be inspected. Moreover, when generating the template of the circuit board, the attribute information of the standard positioning frame is used to find the target positioning frame that matches the standard positioning frame in the captured image, and the device position numbers of the components are marked on the target positioning frame, which greatly shortens the time for generating templates and effectively improves the efficiency of generating templates.
[0079] The hardware structure of the computing device 200 is introduced below.
[0080] The present application embodiment provides a computing device that can be configured as the above computing device 200, referring to Figure 5 , Figure 5Schematic diagram of the hardware structure of a computing device provided in an embodiment of the present application. Figure 5 As shown, the computing device includes a memory 501, a processor 502, a communication interface 503 and a bus 504. The memory 501, the processor 502 and the communication interface 503 are connected to each other through the bus 504.
[0081] The memory 501 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including a compressed optical disc, a laser disc, an optical disc, a digital versatile disc, a Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. Schematically, the memory 501 is used to store at least one section of program code, and when the program code stored in the memory 501 is executed by the processor 502, the processor 502 and the communication interface 503 are used to execute the following method for generating a template for a circuit board.
[0082] The processor 502 may be a network processor (NP), a central processing unit (CPU), an application-specific integrated circuit (ASIC), or an integrated circuit for controlling the execution of the program of the present application. The processor 502 may be a single-CPU processor or a multi-CPU processor. The number of processors 502 may be one or more. The communication interface 503 uses a transceiver module such as a transceiver to implement communication between the computing device and other devices or a communication network. For example, data may be acquired through the communication interface 503.
[0083] The memory 501 and the processor 502 may be separately provided or integrated together.
[0084] Bus 504 may include a path for transmitting information between various components of computing device 500 (eg, memory 501 , processor 502 , communication interface 503 ).
[0085] In some embodiments, the method for generating a circuit board template provided by the present application can also be implemented by multiple computing devices distributed in different environments, that is, by a computing device cluster. Figure 4 Taking the functions of the computing device shown as an example, each function is deployed separately on a computing device, which is not limited to the embodiments of the present application.
[0086] Based on the above introduction, the method for generating a circuit board template provided by the present application is introduced below.
[0087] Figure 6 1 is a flow chart of a method for generating a circuit board template provided by an embodiment of the present application. Figure 6 As shown, this method is applied to the above Figure 3 In the illustrated implementation environment, the interaction between a circuit board quality inspection platform and a computing device is taken as an example for introduction. The method includes the following steps 601 to 608 .
[0088] 601. In response to a component library creation operation, a circuit board quality inspection platform sends a component library creation request to a computing device.
[0089] In an embodiment of the present application, a circuit board quality inspection platform runs on a terminal, and the terminal displays an operation interface of the circuit board quality inspection platform, and in response to a component library creation operation implemented by a user on the operation interface, a component library creation request is sent to a computing device. Among them, the component library can be a component library for a circuit board of a certain board type, or a component library for circuit boards of multiple board types. For example, the operation interface of the circuit board quality inspection platform includes a control for creating a component library, and the terminal responds to a trigger operation on the control, displays multiple board types of circuit boards for user selection, and responds to the circuit board selected by the user, sends a component library creation request to the computing device, and accordingly, the component library creation request carries the board type identification of the circuit board, or the operation interface can also display multiple components for user selection, and in response to the components selected by the user, sends a component library creation request to the computing device, and accordingly, the component library creation request carries the device identification of the component, etc., and the present application does not limit the creation scope of the component library.
[0090] 602. The computing device receives a component library creation request.
[0091] 603. The computing device creates a component library based on the component library creation request, where the component library includes attribute information of a standard positioning frame of a circuit board.
[0092] In an embodiment of the present application, the standard positioning frame of the circuit board indicates the position of the detection target on the component, and the attribute information of the standard positioning frame includes at least: the distance between the standard positioning frame and the device center of the component, the size of the standard positioning frame, and the type of the standard positioning frame (such as plug-in, patch, etc.).
[0093] Schematically, the computing device determines the device identification of the component to be created based on the component library creation request, obtains the component image of the component according to the device identification, determines the standard positioning frame based on the position of the detection target on the component in the component image, determines the attribute information of the standard positioning frame based on the distance between the standard positioning frame and the device center of the component in the component image, the size of the standard positioning frame and the type of the standard positioning frame, and stores the attribute information of the standard positioning frame in the component library. For example, the computing device obtains the CAD file of the circuit board where the component is located based on the device identification of the component, cuts out the captured image of the circuit board where the component is located according to the information in the CAD file, obtains the component image of the component, inputs the component image into the target positioning model, determines the standard positioning frame through the target positioning model, and thus obtains the attribute information of the standard positioning frame. It should be noted that in other embodiments, the user can also manually mark the standard positioning frame according to the component image, for example, the computing device sends the component image to the circuit board quality inspection platform, and displays the component image on the operation interface to facilitate the user to manually mark the standard positioning frame or adjust the position of the standard positioning frame, etc., and the present application is not limited to this.
[0094] The specific contents of the component library are introduced below. In the component library, the attribute information of the standard positioning frame is stored with the device identification of the component as the index. In some embodiments, the attribute information of the standard positioning frame also includes the angle of the standard positioning frame, the board type identification of the circuit board to which it belongs, the device number of the component to which it belongs, and the position of the component to which it belongs (such as the coordinates of the four corners of the rectangular frame corresponding to the component), etc., but the present application is not limited to this. For example, refer to Figure 7 , Figure 7 is a schematic diagram of a component library provided in an embodiment of the present application. Figure 7As shown, the component library uses the device identification (part_no) of the component as an index, and stores the number of standard positioning boxes corresponding to the component (pad_number, that is, the number of detection targets on the component), the distance between the standard positioning box and the device center of the component (pad_dist), the size of the standard positioning box (pad_whs), the angle of the standard positioning box (angle), the type of the standard positioning box (pad_type), the board type identification of the circuit board to which it belongs (src_block), the device position number of the component to which it belongs (src_ref) and the position of the component to which it belongs (src_box), etc. It should be understood that what is shown in the figure is only an example and does not constitute a limitation on the content contained in the component library in this application.
[0095] After the above steps 601 to 603, the computing device creates a component library according to the component library creation request sent by the circuit quality inspection platform. The component library includes the attribute information of the standard positioning frame of the circuit board. Schematically, this process can be referred to Figure 8 , Figure 8 is a schematic diagram of creating a component library provided by an embodiment of the present application, such as Figure 8 As shown, when creating a component library, for components with different device identifications, the detection targets corresponding to each component are determined respectively, and for the detection targets corresponding to components with different device identifications, the attribute information of the standard positioning frame used to locate these detection targets is determined to create a component library. It should be understood that the component library is the basis for generating a template for a circuit board. By creating a component library, when subsequently generating a template for a circuit board, the attribute information of the standard positioning frame in the component library is used to find an accurate positioning frame on the captured image of the circuit board pre-marked with the positioning frame, thereby improving the efficiency of generating templates.
[0096] The following describes the process of generating a template for a circuit board by taking any circuit board as an example through steps 604 to 608 .
[0097] 604. The circuit board quality inspection platform sends a template generation request to the computing device in response to the template generation operation for the circuit board. The template generation request indicates generating a circuit board template for the circuit board.
[0098] In the embodiment of the present application, the circuit board refers to the circuit board for which the template is to be generated, and the circuit board includes components, and there are detection targets on the components. It should be noted that the present application does not limit the number of components on the circuit board and the number of detection targets on the components. Schematically, the terminal displays the operation interface of the circuit board quality inspection platform, and in response to the template generation operation for the circuit board implemented by the user on the operation interface, sends a template generation request to the computing device.
[0099] 605. The computing device receives a template generation request.
[0100] 606. The computing device generates a request based on the template to obtain attribute information of the standard positioning frame of the circuit board and a captured image of the circuit board.
[0101] In an embodiment of the present application, the template production request carries the board type identification of the circuit board, and the computing device can obtain the CAD file of the circuit board according to the board type identification, and obtain the attribute information of the standard positioning frame of the circuit board from the component library according to the device identification of the components in the CAD file. In addition, the computing device can obtain the captured image of the circuit board according to the board type identification of the circuit board, wherein the computing device can send a request for obtaining the captured image to the AOI device according to the board type identification to obtain the corresponding captured image, or the AOI device regularly sends the captured image to the computing device, which is stored by the computing device. In this step, the computing device receives the template generation request, and can obtain the captured image of the circuit board from the stored captured images according to the board type identification, or the template generation request sent by the computing device can also carry the captured image of the circuit board, and the present application is not limited to this.
[0102] The captured image of the circuit board includes at least one first positioning frame, which refers to a pre-marked positioning frame. That is, when the computing device obtains the captured image output by the AOI device, it pre-marks the positioning frame based on the position of the detection target on the component in the captured image. It should be noted that the positioning frame here can be marked using the same target positioning model as in the above step 603, but it should be understood that the positioning frame here does not mark the device position number of the component, that is, although the computing device uses the target positioning model to predict the position of the detection target on the component in the captured image and pre-marks the corresponding positioning frame, it cannot determine which component these positioning frames belong to. Subsequently, by combining the attribute information of the standard positioning frame, it is determined which component these pre-marked positioning frames belong to, and then the template of the circuit board is quickly generated to improve the efficiency of generating the template.
[0103] 607. The computing device determines, from at least one first positioning frame, a target positioning frame that matches the attribute information of the standard positioning frame based on the attribute information of the standard positioning frame and the captured image.
[0104] In the embodiment of the present application, taking any component in the captured image as an example, this step includes the following steps 1 and 2:
[0105] Step 1: Based on the attribute information of the standard positioning frame and the captured image, determine the attribute difference between the standard positioning frame and at least one first positioning frame.
[0106] For any standard positioning frame corresponding to the component, the computing device determines the attribute difference between the standard positioning frame and each first positioning frame based on the captured image and each item of the attribute information of the standard positioning frame. Of course, the computing device may also determine the attribute difference between the standard positioning frame and each first positioning frame based on at least one item of the attribute information of the standard positioning frame, which is not limited thereto.
[0107] For example, based on the above introduction, it can be known that the attribute information of the standard positioning frame at least includes the distance between the standard positioning frame and the device center of the component, the size of the standard positioning frame and the type of the standard positioning frame. Then, for any first positioning frame, the computing device determines the first attribute difference based on the distance between the first positioning frame and the device center of the component and the distance between the standard positioning frame and the device center of the component (for example, calculating the difference between the two distances); determines the second attribute difference based on the size of the first positioning frame and the size of the standard positioning frame (for example, calculating the difference between the two sizes); determines the third attribute difference based on the type of the first positioning frame and the type of the standard positioning frame (for example, if the types are the same, the attribute difference is 0, and if the types are different, the attribute difference is 1, and this is not limited); obtains the attribute difference between the standard positioning frame and the first positioning frame based on the sum of the first attribute difference, the second attribute difference and the third attribute difference.
[0108] Step 2: Based on the attribute difference between the standard positioning frame and the at least one first positioning frame, determine a target positioning frame that matches the attribute information of the standard positioning frame from the at least one first positioning frame.
[0109] The attribute information matching with the standard positioning frame means that the attribute difference with the standard positioning frame is the minimum attribute difference, and the minimum attribute difference is less than the target threshold value, and the target threshold value can be set according to actual needs and is not limited to this. That is, the computing device determines the minimum attribute difference from the attribute difference between the standard positioning frame and each first positioning frame, and if the minimum attribute difference is less than the target threshold value, the first positioning frame corresponding to the minimum attribute difference is determined as the target positioning frame matching the attribute information with the standard positioning frame.
[0110] It should be understood that the operations shown in the above steps 1 and 2 are performed for each standard positioning frame corresponding to the component, so that a target positioning frame belonging to this component is found for each component in the captured image, or in other words, a target positioning frame that can indicate the positions of these detection targets is found for each detection target on the component.
[0111] 608. The computing device marks the device position number of the component on the target positioning frame in the captured image and generates a template of the circuit board, wherein the device position number indicates the position of the component on the circuit board.
[0112] In the embodiment of the present application, after the above step 607, the computing device finds the target positioning frame belonging to each component in the captured image. Then, the computing device marks the device position number of the component on each target positioning frame in the captured image, and generates a template for the circuit board, which is a captured image of a standard circuit board marked with a positioning frame.
[0113] In some embodiments, if a target positioning frame that matches the attribute information of the standard positioning frame is not determined from at least one first positioning frame, the computing device generates a third positioning frame based on the attribute information of the standard positioning frame, adds the third positioning frame to the captured image, and marks the device number of the component on the third positioning frame. In this way, a bottom-up mechanism is provided to ensure that the detection target corresponding to each component in the captured image has a positioning frame, thereby ensuring the accuracy of the circuit board template.
[0114] After the above steps 606 to 608, the computing device uses the attribute information of the standard positioning frame to find the target positioning frame corresponding to the detection target on each component from the first positioning frame pre-marked on the captured image, thereby improving the efficiency of generating templates. This process can also be understood as a process of searching for the target positioning frame belonging to a component on the captured image based on the standard positioning frame corresponding to the component. Fig. 9 , an example is given to illustrate this process.
[0115] Fig. 9 is a schematic diagram of a search target positioning frame provided in an embodiment of the present application. Fig. 9 As shown, taking any component in the captured image as an example, the computing device obtains the attribute information of the standard positioning frame corresponding to the component from the component library based on the component identification (i.e., the distance between the standard positioning frame and the component center, the size of the standard positioning frame, and the type of the standard positioning frame, etc. The specific content of the attribute information can be referred to Figure 7). Then, for any standard positioning frame, the computing device searches for the first positioning frame with the smallest attribute difference with the standard positioning frame among the multiple first positioning frames on the captured image, that is, the computing device traverses each first positioning frame on the captured image, determines the attribute difference between the standard positioning frame and each first positioning frame, and if there is a first positioning frame corresponding to the smallest attribute difference, determines whether the smallest attribute difference is less than the target threshold, and if so, determines that the attribute information of the first positioning frame corresponding to the smallest attribute difference matches that of the standard positioning frame (or the two positioning frames are the most similar), determines this first positioning frame as the target positioning frame (the above process can refer to step 607, which will not be repeated), and marks the device position number of the component on the target positioning frame. If the first positioning frame with the smallest attribute difference with the standard positioning frame is not searched, it indicates that the first positioning frame matching the attribute information of the standard positioning frame cannot be found on the current captured image, then the computing device generates a third positioning frame according to the attribute information of the standard positioning frame, adds it to the captured image, and marks the device position number on the third positioning frame. In this way, a template for the circuit board is generated.
[0116] In addition, based on the above introduction to the application scenarios of the present application, it can be known that in the circuit board quality inspection scenario, quality inspection is often performed based on FOV images. Therefore, it is often necessary to generate a template based on FOV images. It should be understood that the method for generating a template for a circuit board provided in the present application is also applicable to generating a template based on a FOV image. Schematically, in the above steps 606 to 608, the captured image of the circuit board may be a captured image including multiple components on the circuit board, or it may be a plurality of sub-captured images of the circuit board, that is, the FOV image of the circuit board, each sub-captured image including at least one component, and each sub-captured image including at least one second positioning frame. In this way, the computing device can generate a template based on the FOV image, so that in the subsequent circuit board quality inspection process, quality inspection can be performed directly based on the FOV image of the circuit board. The two situations are introduced respectively below:
[0117] Case 1: The captured image of the circuit board includes a plurality of components on the circuit board.
[0118] For example, the captured image includes all components on the circuit board, that is, the captured image is a complete captured image of the circuit board. For another example, the captured image is a large stitched image of the circuit board. The large stitched image refers to a group of images obtained by photographing different areas of the circuit board, and the image is obtained by stitching the group of images in sequence. The present application is not limited to this. Based on this, the aforementioned step 608 includes the following steps A1 to A3:
[0119] Step A1: marking the device position number of the component on the target positioning frame in the captured image to obtain the marked captured image.
[0120] Step A2: Based on the captured image, a plurality of sub-images of the circuit board are acquired, wherein the sub-images include at least one component and at least one second positioning frame, wherein the second positioning frame refers to a pre-marked positioning frame. That is, a positioning frame is also pre-marked on each sub-image, and the marking process is the same as that of the aforementioned step 606, so it will not be described in detail.
[0121] Step A3, aligning the marked captured image and each sub-captured image, determining the target positioning frame in each sub-captured image, marking the device position number of the component on the target positioning frame in each sub-captured image, and generating a template of the circuit board. It should be understood that the sub-captured image is a FOV image obtained by re-shooting the captured image, therefore, by performing two-dimensional alignment (i.e., 2D alignment) on the marked captured image and each sub-captured image, it is possible to determine a target positioning frame that matches the attribute information of the standard positioning frame on each sub-captured image, and mark the device position number of the component on the target positioning frame in each sub-captured image, and generate a template based on the FOV image.
[0122] Through the above method, the computing device can generate a template based on the FOV image. In other words, the generated circuit board template is a plurality of FOV images marked with positioning frames. In this way, in the subsequent circuit board quality inspection process, the FOV image of the circuit board to be inspected can be directly compared with the template, thereby greatly improving the circuit board quality inspection efficiency.
[0123] Case 2: the captured image of the circuit board is a plurality of sub-images of the circuit board.
[0124] Among them, the sub-captured image includes at least one component and at least one second positioning frame, and the second positioning frame refers to a pre-marked positioning frame, that is, the captured image of the circuit board acquired by the computing device is already a plurality of FOV images of the circuit board. Based on this, the aforementioned step 608 includes: marking the device position number of the component on the target positioning frame in each sub-captured image, obtaining a plurality of marked sub-captured images, and generating a template of the circuit board. In other words, the generated circuit board template is a plurality of FOV images marked with positioning frames, so that in the subsequent circuit board quality inspection process, the FOV image of the circuit board to be inspected can be directly compared with the template, thereby greatly improving the efficiency of circuit board quality inspection.
[0125] In summary, the present application provides a method for generating a template for a circuit board. For the circuit board whose template is to be generated, the attribute information of the standard positioning frame of the circuit board and the captured image of the circuit board are obtained, wherein the standard positioning frame can indicate the position of the detection target on the components of the circuit board. Furthermore, since the attribute information of the standard positioning frame records the relative information of the standard positioning frame, and the positioning frame is pre-marked on the captured image, therefore, according to the attribute information of the standard positioning frame, a target positioning frame that matches the attribute information of the standard positioning frame can be found from the positioning frame pre-marked on the captured image, and a template for the circuit board is generated by marking the device position numbers of the components on the target positioning frame, thereby greatly shortening the time for generating the template and effectively improving the efficiency of generating the template.
[0126] Based on the above Figure 6 The embodiment shown in the figure introduces the method for generating a circuit board template provided by the present application. According to the above introduction, the circuit board quality inspection platform and computing device of the present application can also realize the function of quality inspection for the circuit board. Fig.10 , combined with the above Figure 6 The illustrated embodiment further introduces the overall process of generating a circuit board template and performing quality inspection on the circuit board.
[0127] Fig.10 Schematic diagram of generating a circuit board template and performing quality inspection on a circuit board provided in an embodiment of the present application. Fig.10 As shown, the process of generating a circuit board template is called a modeling state, and the process of performing quality inspection on the circuit board is called a running state.
[0128] In the modeling state, for the circuit board whose template is to be generated, the AOI device is used to shoot the circuit board to obtain a standard circuit board image. Then, the user implements the template generation operation for the circuit board in the operation interface of the circuit board quality inspection platform, triggering the circuit board quality inspection platform to send a template generation request to the computing device, so that the computing device can automatically generate a circuit board template according to the template generation request (this process can also be understood as entering the program of quickly building a template, and the specific process refers to the aforementioned Figure 6 The embodiment shown is not described in detail here) to complete the modeling.
[0129] In the running state, for the circuit board to be inspected, the AOI device is used to shoot the circuit board to obtain the first shot image of the circuit board to be inspected. Then, the user implements the quality inspection operation for the circuit board in the operation interface of the circuit board quality inspection platform, triggering the circuit board quality inspection platform to send a circuit board quality inspection request to the computing device, the circuit board quality inspection request indicates to perform quality inspection on the circuit board to be inspected, the computing device receives the circuit board quality inspection request, and based on the circuit board quality inspection request, obtains the first shot image, aligns the template of the circuit board with the first shot image, determines the position of the detection target on the component in the first shot image, and based on the position of the detection target on the component in the first shot image, performs quality inspection on the detection target to obtain the quality inspection result of the circuit board. For example, after determining the position of the detection target on the component in the first shot image, the computing device cuts out the area where the detection target is located in the first shot image, inputs the image of the detection target into the classification model, and identifies whether the detection target has defects.
[0130] Next, refer to Fig.11 , the above process of generating a circuit board template is further illustrated by examples. Fig.11 Schematic diagram of generating a circuit board template provided by an embodiment of the present application. Fig.11 As shown, in the process of generating a circuit board template, for the complete captured image (or spliced large image) and multiple sub-captured images (also called FOV images) of the circuit board, a pre-trained target positioning model is used to pre-mark positioning frames on these captured images to obtain "complete captured image + positioning frame" and "FOV image + positioning frame". Next, based on the relative relationship between the CAD file of the circuit board and the components on the complete captured image, the coordinates of the components in the CAD file are mapped to the coordinate system of the complete captured image to obtain "complete captured image + positioning frame + component coordinates". Further, based on the device identification of the components in the CAD file, the attribute information of the standard positioning frame corresponding to each component is obtained from the component library. Based on the attribute information of these standard positioning frames, a target positioning frame matching the attribute information of the standard positioning frame is found in the pre-marked positioning frame on the complete captured image, and the device position number of the component is marked on the target positioning frame to obtain the marked complete captured image, that is, "complete captured image + positioning frame + component information (component coordinates + device position number)". Finally, the annotated complete captured image and each sub-captured image are registered, the target positioning frame in each sub-captured image is determined, and the template of the circuit board is generated, that is, the template based on the FOV image "sub-captured image + positioning frame + component information (component coordinates + component position number)".
[0131] It can be seen that the above-mentioned method of generating circuit board templates greatly shortens the time for generating templates and improves efficiency. Moreover, the generated circuit board template is a plurality of FOV images marked with positioning frames. In this way, in the subsequent circuit board quality inspection process, the FOV image of the circuit board to be inspected can be directly compared with the template, thereby greatly improving the circuit board quality inspection efficiency.
[0132] In contrast, the solution in the related art that directly generates a target positioning frame on the captured image based on the attribute information of the standard positioning frame strongly relies on the attribute information of the standard positioning frame, that is, the absolute information of the standard positioning frame, and has weak generalization ability. Manual adjustment is often required after the target positioning frame is generated. However, when creating a component library, the present application records the relative information of the standard positioning frame and pre-marks the first positioning frame on the captured image. Therefore, based on the attribute information of the standard positioning frame, the target positioning frame that matches the attribute information of the standard positioning frame can be found from the positioning frame on the captured image, and the device position number of the component can be marked on the target positioning frame to generate a template for the circuit board, thereby greatly shortening the time for generating the template and improving efficiency, which can be reduced from 3 to 4 hours required by the related art to 30 minutes to 1 hour. In addition, in the related art, if a deviation occurs when aligning coordinates based on the CAD file, that is, the coordinates are inaccurate, it will also affect the accuracy of the generated target positioning frame. However, this application uses the attribute information of the standard positioning frame to match the pre-marked positioning frame on the captured image. After finding the corresponding target positioning frame, the device position number of the component in the CAD file is marked on the target positioning frame, thereby effectively improving the accuracy of the target positioning frame. Furthermore, since the generated circuit board template is a plurality of FOV images marked with positioning frames, in this way, in the subsequent circuit board quality inspection process, the FOV image of the circuit board to be inspected can be directly compared with the template, thereby greatly improving the efficiency of circuit board quality inspection.
[0133] Fig.12 1 is a schematic diagram of a structure of a device for generating a circuit board template provided by an embodiment of the present application. The device can implement the aforementioned method for generating a circuit board template by software, hardware, or a combination of both. Fig.12 As shown, the device includes an acquisition module 1201 , a positioning frame determination module 1202 and a template generation module 1203 .
[0134] The acquisition module 1201 is used to acquire the attribute information of the standard positioning frame of the circuit board and the captured image of the circuit board, the standard positioning frame indicates the position of the detection target on the component, the attribute information of the standard positioning frame includes the distance between the standard positioning frame and the device center of the component, the size of the standard positioning frame and the type of the standard positioning frame, and the captured image includes at least one first positioning frame, which refers to a pre-marked positioning frame;
[0135] A positioning frame determining module 1202 is used to determine a target positioning frame that matches the attribute information of the standard positioning frame from at least one first positioning frame based on the attribute information of the standard positioning frame and the captured image;
[0136] The template generation module 1203 is used to mark the device position number of the component on the target positioning frame in the captured image to generate a template of the circuit board, and the device position number indicates the position of the component on the circuit board.
[0137] In some embodiments, the positioning frame determination module 1202 is used to:
[0138] Determine, based on the attribute information of the standard positioning frame and the captured image, an attribute difference between the standard positioning frame and at least one first positioning frame;
[0139] Based on the attribute difference between the standard positioning frame and the at least one first positioning frame, a target positioning frame matching the attribute information of the standard positioning frame is determined from the at least one first positioning frame.
[0140] In some embodiments, the attribute information matching with the standard positioning frame means that the attribute difference between the standard positioning frame and the standard positioning frame is a minimum attribute difference, and the minimum attribute difference is less than a target threshold.
[0141] In some embodiments, the captured image is a captured image including multiple components on a circuit board, and the template generation module 1203 is used to:
[0142] Marking the device position number of the component on the target positioning frame in the captured image to obtain a marked captured image;
[0143] Based on the captured image, a plurality of sub-captured images of the circuit board are acquired, wherein the sub-captured images include at least one component and at least one second positioning frame, where the second positioning frame refers to a pre-marked positioning frame;
[0144] The marked captured image and each sub-captured image are registered to determine the target positioning frame in each sub-captured image, and the device position number of the component is marked on the target positioning frame in each sub-captured image to generate a template for the circuit board.
[0145] In some embodiments, the captured image is a plurality of sub-captured images of a circuit board, the sub-captured images include at least one component and at least one second positioning frame, the second positioning frame refers to a pre-marked positioning frame, and the template generation module 1203 is used to:
[0146] The device position number of the component is marked on the target positioning frame in each sub-shot image, and a plurality of marked sub-shot images are obtained to generate a template of the circuit board.
[0147] In some embodiments, the apparatus further comprises an attribute information determination module, the attribute information determination module being configured to:
[0148] Acquire a component image of the component, and determine a standard positioning frame based on a position of the detection target on the component in the component image;
[0149] Based on the distance between the standard positioning frame in the component image and the device center of the component, the size of the standard positioning frame, and the type of the standard positioning frame, attribute information of the standard positioning frame is determined.
[0150] In some embodiments, the apparatus further comprises:
[0151] A positioning frame generation module is used to generate a third positioning frame based on the attribute information of the standard positioning frame if a target positioning frame matching the attribute information of the standard positioning frame is not determined from at least one first positioning frame, add the third positioning frame to the captured image, and mark the device position number of the component on the third positioning frame.
[0152] In some embodiments, the apparatus is configured in a computing device, the computing device is associated with a circuit board quality inspection platform, and the apparatus further includes:
[0153] A receiving module, used for receiving a template generation request sent by a circuit board quality inspection platform, wherein the template generation request indicates generating a circuit board template for the circuit board;
[0154] The acquisition module 1201 is used to: acquire the attribute information of the standard target frame and the captured image of the circuit board based on the template generation request.
[0155] In some embodiments, the receiving module is further used to receive a circuit board quality inspection request sent by the circuit board quality inspection platform, where the circuit board quality inspection request indicates to perform quality inspection on the circuit board to be inspected;
[0156] The acquisition module 1201 is further used to acquire a first captured image of the circuit board to be inspected based on the circuit board quality inspection request, align the template of the circuit board with the first captured image, and determine the position of the inspection target on the component in the first captured image;
[0157] The device also includes a quality inspection module, which is used to perform quality inspection on the inspection target based on the position of the inspection target on the component in the first captured image to obtain a quality inspection result of the circuit board.
[0158] Through the above-mentioned device, for the circuit board whose template is to be generated, the attribute information of the standard positioning frame of the circuit board and the captured image of the circuit board are obtained, wherein the standard positioning frame can indicate the position of the detection target on the components of the circuit board. Furthermore, since the attribute information of the standard positioning frame records the relative information of the standard positioning frame, and the positioning frame is pre-marked on the captured image, therefore, according to the attribute information of the standard positioning frame, the target positioning frame that matches the attribute information of the standard positioning frame can be found from the positioning frame pre-marked on the captured image, and the template of the circuit board is generated by marking the device position number of the component on the target positioning frame, thereby greatly shortening the time for generating the template and effectively improving the efficiency of generating the template.
[0159] It should be noted that: the device for generating a circuit board template provided in the above embodiment only uses the division of the above functional modules as an example when generating a circuit board template. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the device for generating a circuit board template provided in the above embodiment and the method embodiment for generating a circuit board template belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0160] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions. For example, the captured images of the circuit board and the attribute information of the standard positioning frame involved in this application are all obtained with full authorization.
[0161] In the present application, the terms "first", "second", etc. are used to distinguish between identical or similar items having substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is the quantity and execution order limited. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of the various described examples, the first positioning frame can be referred to as the second positioning frame, and similarly, the second positioning frame can be referred to as the first positioning frame. Both the first positioning frame and the second positioning frame can be positioning frames, and in some cases, can be separate and different positioning frames.
[0162] In the present application, the term "at least one" means one or more, and the term "plurality" means two or more. For example, a plurality of positioning boxes means two or more positioning boxes.
[0163] The above description is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0164] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of program structure information. The program structure information includes one or more program instructions. When the program instructions are loaded and executed on a computing device, all or part of the processes or functions in the embodiments of the present application are generated.
[0165] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0166] As described above, the above embodiments 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, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for generating a template for a circuit board, characterized in that: The circuit board includes components, and the components correspond to detection targets. The method includes: Acquire attribute information of a standard positioning frame of the circuit board and a captured image of the circuit board, wherein the standard positioning frame indicates the position of the detection target on the component, the attribute information of the standard positioning frame includes a distance between the standard positioning frame and the component center, a size of the standard positioning frame, and a type of the standard positioning frame, and the captured image includes at least one first positioning frame, which refers to a pre-marked positioning frame; Based on the attribute information of the standard positioning frame and the captured image, determining a target positioning frame that matches the attribute information of the standard positioning frame from the at least one first positioning frame; The component position number of the component is marked on the target positioning frame in the captured image to generate a template of the circuit board, wherein the component position number indicates the position of the component on the circuit board.
2. The method according to claim 1, characterized in that The determining, based on the attribute information of the standard positioning frame and the captured image, a target positioning frame matching the attribute information of the standard positioning frame from the at least one first positioning frame comprises: Determining an attribute difference between the standard positioning frame and the at least one first positioning frame based on the attribute information of the standard positioning frame and the captured image; Based on the attribute difference between the standard positioning frame and the at least one first positioning frame, a target positioning frame matching the attribute information of the standard positioning frame is determined from the at least one first positioning frame.
3. The method according to claim 2, characterized in that The attribute information matching with the standard positioning frame means that the attribute difference with the standard positioning frame is a minimum attribute difference, and the minimum attribute difference is less than a target threshold.
4. The method according to any one of claims 1 to 3, characterized in that The captured image is a captured image including a plurality of components on the circuit board, and the component position numbers of the components are marked on the target positioning frame in the captured image to generate a template for the circuit board, including: Marking the device position number of the component on the target positioning frame in the captured image to obtain the marked captured image; Based on the captured image, a plurality of sub-captured images of the circuit board are acquired, wherein the sub-captured images include at least one of the components and at least one second positioning frame, where the second positioning frame refers to a pre-marked positioning frame; The marked captured image and each of the sub-captured images are registered to determine the target positioning frame in each of the sub-captured images, and the device position number of the component is marked on the target positioning frame in each of the sub-captured images to generate a template for the circuit board.
5. The method according to any one of claims 1 to 3, characterized in that The captured image is a plurality of sub-captured images of the circuit board, the sub-captured images include at least one of the components and at least one second positioning frame, the second positioning frame refers to a pre-marked positioning frame, the component position number of the component is marked on the target positioning frame in the captured image, and the template of the circuit board is generated, including: The device position number of the component is marked on the target positioning frame in each of the sub-shot images to obtain a plurality of the marked sub-shot images and generate a template of the circuit board.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: Acquire a component image of the component, and determine the standard positioning frame based on the position of the detection target on the component in the component image; Based on the distance between the standard positioning frame and the component center of the component in the component image, the size of the standard positioning frame, and the type of the standard positioning frame, attribute information of the standard positioning frame is determined.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: If the target positioning frame that matches the attribute information of the standard positioning frame is not determined from the at least one first positioning frame, a third positioning frame is generated based on the attribute information of the standard positioning frame, the third positioning frame is added to the captured image, and the device position number of the component is marked on the third positioning frame.
8. The method according to any one of claims 1 to 7, characterized in that The method is performed by a computing device, the computing device is associated with a circuit board quality inspection platform, and the method further includes: Receiving a template generation request sent by the circuit board quality inspection platform, wherein the template generation request indicates generating a template of the circuit board for the circuit board; The acquiring the property information of the standard target frame of the circuit board and the captured image of the circuit board includes: acquiring the property information of the standard target frame and the captured image of the circuit board based on the template generation request.
9. The method according to claim 8, characterized in that The method further comprises: Receiving a circuit board quality inspection request sent by the circuit board quality inspection platform, wherein the circuit board quality inspection request indicates to perform quality inspection on the circuit board to be inspected; Based on the circuit board quality inspection request, a first captured image of the circuit board to be inspected is obtained, a template of the circuit board is registered with the first captured image, and a position of the inspection target on the component in the first captured image is determined; Based on the position of the inspection target on the component in the first captured image, the inspection target is quality inspected to obtain a quality inspection result of the circuit board.
10. A device for generating a template for a circuit board, characterized in that: The circuit board includes components, and the components have detection targets corresponding thereto. The device includes: an acquisition module, configured to acquire attribute information of a standard positioning frame of the circuit board and a captured image of the circuit board, wherein the standard positioning frame indicates the position of the detection target on the component, and the attribute information of the standard positioning frame includes a distance between the standard positioning frame and a device center of the component, a size of the standard positioning frame, and a type of the standard positioning frame, and the captured image includes at least one first positioning frame, which is a pre-marked positioning frame; a positioning frame determining module, configured to determine, from the at least one first positioning frame, a target positioning frame that matches the attribute information of the standard positioning frame based on the attribute information of the standard positioning frame and the captured image; The template generation module is used to mark the device position number of the component on the target positioning frame in the captured image to generate a template of the circuit board, wherein the device position number indicates the position of the component on the circuit board.
11. The device according to claim 10, characterized in that The positioning frame determination module is used to: Determining an attribute difference between the standard positioning frame and the at least one first positioning frame based on the attribute information of the standard positioning frame and the captured image; Based on the attribute difference between the standard positioning frame and the at least one first positioning frame, a target positioning frame matching the attribute information of the standard positioning frame is determined from the at least one first positioning frame.
12. The device according to claim 11, characterized in that The attribute information matching with the standard positioning frame means that the attribute difference with the standard positioning frame is a minimum attribute difference, and the minimum attribute difference is less than a target threshold.
13. The device according to any one of claims 10 to 12, characterized in that The captured image is a captured image including a plurality of components on the circuit board, and the template generating module is used to: Marking the device position number of the component on the target positioning frame in the captured image to obtain the marked captured image; Based on the captured image, a plurality of sub-captured images of the circuit board are acquired, wherein the sub-captured images include at least one of the components and at least one second positioning frame, where the second positioning frame refers to a pre-marked positioning frame; The marked captured image and each of the sub-captured images are registered to determine the target positioning frame in each of the sub-captured images, and the device position number of the component is marked on the target positioning frame in each of the sub-captured images to generate a template for the circuit board.
14. The device according to any one of claims 10 to 12, characterized in that The captured image is a plurality of sub-captured images of the circuit board, the sub-captured images include at least one of the components and at least one second positioning frame, the second positioning frame refers to a pre-marked positioning frame, and the template generation module is used to: The device position number of the component is marked on the target positioning frame in each of the sub-shot images to obtain a plurality of the marked sub-shot images and generate a template of the circuit board.
15. The device according to any one of claims 10 to 14, characterized in that The device further includes an attribute information determining module, wherein the attribute information determining module is configured to: Acquire a component image of the component, and determine the standard positioning frame based on the position of the detection target on the component in the component image; Based on the distance between the standard positioning frame and the component center of the component in the component image, the size of the standard positioning frame, and the type of the standard positioning frame, attribute information of the standard positioning frame is determined.
16. The device according to any one of claims 10 to 15, characterized in that The device also includes: A positioning frame generating module is used to generate a third positioning frame based on the attribute information of the standard positioning frame if the target positioning frame matching the attribute information of the standard positioning frame is not determined from the at least one first positioning frame, add the third positioning frame to the captured image, and mark the device position number of the component on the third positioning frame.
17. The device according to any one of claims 10 to 16, characterized in that The device is configured on a computing device, the computing device is associated with a circuit board quality inspection platform, and the device further includes: A receiving module, used for receiving a template generation request sent by the circuit board quality inspection platform, wherein the template generation request indicates generating a template for the circuit board for the circuit board; The acquisition module is used to acquire the attribute information of the standard target frame and the captured image of the circuit board based on the template generation request.
18. The device according to claim 17, characterized in that The receiving module is further used to receive a circuit board quality inspection request sent by the circuit board quality inspection platform, wherein the circuit board quality inspection request indicates to perform quality inspection on the circuit board to be inspected; The acquisition module is further used to acquire a first captured image of the circuit board to be inspected based on the circuit board quality inspection request, align the template of the circuit board with the first captured image, and determine the position of the inspection target on the component in the first captured image; The device also includes a quality inspection module, which is used to perform quality inspection on the inspection target based on the position of the inspection target on the component in the first captured image to obtain a quality inspection result of the circuit board.
19. A computing device, characterized in that The computing device includes a processor and a memory, wherein the memory is used to store at least one section of program code, and the at least one section of program code is loaded by the processor and executes the method for generating a template for a circuit board according to any one of claims 1 to 9.
20. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method for generating a template for a circuit board according to any one of claims 1 to 9.
21. A computer-readable storage medium, characterized in that: It includes computer program instructions. When the computer program instructions are executed by a computing device, the computing device executes the method for generating a template for a circuit board as described in any one of claims 1 to 9; or, when the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method for generating a template for a circuit board as described in any one of claims 1 to 9.
22. A computer program product, characterized in that When the computer program product runs on a computing device, the computing device executes the method for generating a template for a circuit board as described in any one of claims 1 to 9; or, when the computer program product runs on a computing device cluster, the computing device cluster executes the method for generating a template for a circuit board as described in any one of claims 1 to 9.
Citation Information
Cited By
Comparison template generation method, apparatus and device, and computer readable storage medium
CN119494837A
Template generation method and device, electronic equipment and storage medium
CN120563402A
Quality inspection programming method and quality inspection processing method of AOI equipment, equipment and storage medium
CN122345613A
