Path planning method, terminal device and computer readable storage medium

By calculating the minimal cost combination solution for paths in multi-camera detection scenarios, the camera path planning is optimized, and the problem of low multi-camera detection efficiency is solved, and faster image acquisition and detection is achieved.

CN115469653BActive Publication Date: 2025-01-10OPTIMA OPTICAL TECH (SHEN ZHEN CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211009962.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-22
Publication Date
2025-01-10
Estimated Expiration
2042-08-22

AI Technical Summary

Technical Problem

In industrial detection, as the number of defects increases, the time for multi-camera to acquire images becomes longer, resulting in low detection efficiency and lack of path planning methods suitable for multi-camera detection scenarios.

Method used

A path planning method is proposed. By obtaining the current position of the camera and the location information of the defect to be detected, the path cost of multiple combination schemes is calculated, the combination scheme with the lowest path cost is selected, and the path planning of the camera is carried out to ensure the shortest camera acquisition path and improve the Detection efficiency.

Benefits of technology

By optimizing the camera's path planning, it reduces image acquisition time and improves detection efficiency, and is suitable for multi-camera detection scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115469653B_ABST
    Figure CN115469653B_ABST
Patent Text Reader

Abstract

The present application discloses a path planning method, a terminal device and a computer-readable storage medium, the path planning method comprising: obtaining the current position of the camera, the camera comprising at least a first camera and a second camera; obtaining the position information of several defect positions to be detected of the board to be tested, and obtaining multiple combination schemes for allocating the several position information to the first camera and the second camera; calculating the path cost of each combination scheme, wherein the path cost at least comprises the first path length of the first camera and the second path length of the second camera; obtaining the combination scheme with the minimum path cost, and performing path planning for the first camera and the second camera according to the combination scheme with the minimum path cost. Through the method of the present application, several position information can be allocated to the first camera and the second camera according to the combination scheme with the minimum path cost, so that the acquisition path of the first camera and the second camera is the shortest, the image acquisition time is reduced, and the detection efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of path planning, and in particular to a path planning method, a terminal device, and a computer-readable storage medium. Background Art

[0002] In recent years, vision systems have become more and more popular in human production and life, and their applications in industrial inspection, positioning navigation, dynamic tracking, 3D reconstruction, etc. have become increasingly widespread. Among them, defect detection based on vision systems plays a very important role in the production process of industrial products.

[0003] Current detection methods mostly use optical imaging technology (usually using cameras and lenses) to obtain images of the target to be tested, and then use certain image processing algorithms to obtain the defect locations from the captured images. When there are multiple defects on a single target to be tested, in order to further detect the multiple defects, the images of the multiple defects need to be recaptured.

[0004] However, as the number of defects increases, the time it takes for the camera to collect images becomes longer, which is not conducive to improving the detection efficiency. Therefore, there is an urgent need for a multi-camera path planning method that is suitable for multi-camera detection scenarios. Summary of the invention

[0005] To solve the above problems, the present application provides a path planning method, a terminal device and a computer-readable storage medium.

[0006] To solve the above problems, the present application provides a path planning method, comprising: obtaining the current position of a camera, the camera comprising at least a first camera and a second camera; obtaining position information of several defect positions to be detected of a board to be tested, and obtaining multiple combination schemes for assigning the several position information to the first camera and the second camera, wherein each of the combination schemes comprises the position information of all defect positions to be detected, and a camera assigned to each defect position to be detected; calculating the path cost of each of the combination schemes, wherein the path cost comprises at least a first path length from the current position of the first camera to all the defect positions to be detected assigned to the first camera in the combination scheme, and a second path length from the current position of the second camera to all the defect positions to be detected assigned to the second camera in the combination scheme; obtaining the combination scheme with the minimum path cost, and performing path planning for the first camera and the second camera according to the combination scheme with the minimum path cost.

[0007] Among them, the obtaining of position information of several defect positions to be detected on the plate to be tested, and obtaining multiple combination schemes for assigning the several position information to the first camera and the second camera, includes: assigning a first set of defect positions to be detected corresponding to the first camera and a second set of defect positions to be detected corresponding to the second camera based on the position information of the several defect positions to be detected; obtaining a first combination scheme of the first camera according to the first set of defect positions to be detected, and obtaining a second combination scheme of the second camera according to the second set of defect positions to be detected; and obtaining a combination scheme of the first camera and the second camera based on the first combination scheme and the second combination scheme.

[0008] Among them, obtaining the first combination scheme of the first camera according to the first set of defect positions to be detected includes: sorting the first set of defect positions to be detected according to the position relationship of the defects to be detected in a first direction, wherein the first direction is perpendicular to the running direction of the first camera; and allocating the acquisition order and acquisition position of the first camera according to the sorted first set of defect positions to be detected to form a first combination scheme of the first camera.

[0009] Wherein, the sorting of the first set of defect positions to be detected according to the position relationship of the defects to be detected in the first direction includes: when the positions of several defects to be detected in the first direction do not overlap, sorting the first set of defect positions to be detected according to the position relationship of the defects to be detected in the first direction; when the positions of several defects to be detected in the first direction overlap, sorting the first set of defect positions to be detected according to the position relationship of the defects to be detected in the first direction and the position relationship of the overlapping defects to be detected in the second direction, wherein the second direction is the running direction of the first camera.

[0010] Wherein, the board to be tested includes a first plane and a second plane opposite to each other, and the position information of several defect positions to be detected on the board to be tested includes first position information of several first defect positions to be detected corresponding to the first plane, and second position information of several second defect positions to be detected corresponding to the second plane; the camera also includes a third camera and a fourth camera, the first camera and the second camera are arranged on one side of the first plane of the board to be tested, and the third camera and the fourth camera are arranged on one side of the second plane of the board to be tested.

[0011] Among them, the steps of obtaining the position information of several defect positions to be detected on the board to be tested, and obtaining multiple combination schemes of assigning the several position information to the first camera and the second camera include: creating multiple tree nodes, wherein the tree nodes at least include a first tree node for storing the first camera and a second tree node for storing the second camera; recursively calculating the several position information to construct multiple layers of sub-nodes of the first tree node and the second tree node according to the several position information; traversing the first tree node and the second tree node to obtain multiple combination schemes of the first camera and the second camera.

[0012] Among them, the obtaining of position information of several defect positions to be detected of the board to be tested includes: obtaining defect data of the board to be tested; collecting a positioning image of the board to be tested, and identifying reference points on the positioning image; and obtaining position information of several defect positions to be detected of the board to be tested based on the defect data and the reference points.

[0013] Among them, after the step of performing path planning for the first camera and the second camera according to the combination scheme with the minimum path cost, the path planning method also includes: generating a first control signal for the first camera and a second control signal for the second camera according to the combination scheme with the minimum path cost; based on the first control signal, controlling the first camera to move in sequence from the current position to the defect position to be detected assigned to the first camera in the combination scheme, and collecting a first defect image for each defect position to be detected; based on the second control signal, controlling the second camera to move in sequence from the current position to the defect position to be detected assigned to the second camera in the combination scheme, and collecting a second defect image for each defect position to be detected.

[0014] To solve the above problems, the present application provides a terminal device, which includes a processor and a memory connected to the processor, wherein program data is stored in the memory, and the processor calls the program data stored in the memory to execute the path planning method as described above.

[0015] To solve the above problems, the present application provides a computer-readable storage medium storing program instructions, wherein the program instructions are executed to implement the path planning method as described above.

[0016] The present application proposes a path planning method, a terminal device and a computer-readable storage medium, the path planning method includes obtaining the current position of the camera, the camera includes at least a first camera and a second camera; obtaining the position information of several defect positions to be detected of the board to be tested, and obtaining multiple combination schemes for assigning the several position information to the first camera and the second camera, wherein each combination scheme includes the position information of all defect positions to be detected, and the camera assigned to each defect position to be detected; calculating the path cost of each combination scheme, wherein the path cost includes at least the first path length from the current position of the first camera to all defect positions to be detected assigned to the first camera in the combination scheme, and the second path length from the current position of the second camera to all defect positions to be detected assigned to the second camera in the combination scheme; obtaining the combination scheme with the minimum path cost, and performing path planning for the first camera and the second camera according to the combination scheme with the minimum path cost. Through the method of the present application, it is possible to assign several position information to the first camera and the second camera according to the combination scheme with the minimum path cost, so that the acquisition path of the first camera and the second camera is the shortest, reducing the image acquisition time and improving the detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:

[0018] Figure 1 is a flowchart of a first embodiment of a path planning method provided by the present application;

[0019] Figure 2 is a flowchart of a second embodiment of the path planning method provided by the present application;

[0020] Figure 3 is a flowchart of a third embodiment of the path planning method provided by the present application;

[0021] Figure 4 is a flowchart of a fourth embodiment of the path planning method provided by the present application;

[0022] Figure 5 It is a schematic diagram of a framework of an embodiment of a terminal device provided by the present application;

[0023] Figure 6 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium provided by the present application. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0025] It should be noted that if the embodiments of the present invention involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0026] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0027] The present application first proposes a path planning method, which is applied to a terminal device. Specifically, the terminal device can be applied to the field of defect detection of PCB circuit boards. The terminal device is used to plan the moving path of multiple cameras to collect multiple defect positions to be detected. In one embodiment, the terminal device can be a defect detection device for re-inspecting defects detected by an AOI detection system on the PCB circuit board. In other embodiments, the terminal device can also be connected to the defect detection device to provide a device for planning a path for the defect detection device.

[0028] The terminal device of the present application may be a server, or a system in which a server and a local terminal cooperate with each other. Accordingly, the various parts of the terminal device, such as various units, subunits, modules, and submodules, may all be arranged in the server, or may be arranged in the server and the local terminal respectively.

[0029] Furthermore, the above-mentioned server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules, such as software or software modules used to provide distributed servers, or it can be implemented as a single software or software module, which is not specifically limited here. In some possible implementations, the attack protection method of the embodiment of the present application can be implemented by a processor calling a computer-readable instruction stored in a memory.

[0030] See also Figure 1 , Figure 1 Schematic diagram of the first embodiment of the path planning method provided by this application. Figure 1 As shown, the path planning method of this embodiment includes the following steps:

[0031] Step S11: obtaining the current position of the camera, where the camera includes at least a first camera and a second camera.

[0032] Specifically, the terminal device includes at least a first camera and a second camera, or the terminal device is connected to the first camera and the second camera to plan the collection paths of the first camera and the second camera. When planning the paths of the first camera and the second camera, the current positions of the first camera and the second camera need to be obtained.

[0033] Among them, the current position of the camera can be the final stop position when the first camera and the second camera capture defect images of the previous board to be tested, or it can be the reset position of the first camera and the second camera after capturing the previous board to be tested, and there is no specific limitation on this.

[0034] Step S12: Obtain position information of several defect positions to be detected on the board to be tested, and obtain multiple combination schemes for assigning the several position information to the first camera and the second camera, wherein each combination scheme includes the position information of all defect positions to be detected and the camera assigned to each defect position to be detected.

[0035] The position information of the positions of the defects to be detected is obtained, and the position information is the position coordinates corresponding to the defects on the plate to be detected. In order to re-inspect the defects and further determine whether the defects are real defects, the defect detection device needs to re-acquire defect images of the defects. To this end, the terminal device needs to allocate the position information of the positions of the defects to be detected to the first camera and the second camera, so that the first camera and the second camera can re-collect the positions of the defects to be detected.

[0036] Since each position information can only be assigned to the first camera or the second camera, and the position information of several defect locations to be detected can be assigned to the first camera and the second camera in multiple ways, it is possible to obtain multiple combination schemes for assigning several position information to the first camera and the second camera. Each combination scheme should include all the position information and the camera assigned to each position information, that is, all the position information in each combination scheme has a corresponding assigned camera, and the position information of the first camera and the second camera is not repeated in each combination scheme.

[0037] Step S13: Calculate the path cost of each combination scheme, wherein the path cost includes at least a first path length from the current position of the first camera to all defect positions to be detected assigned to the first camera in the combination scheme, and a second path length from the current position of the second camera to all defect positions to be detected assigned to the second camera in the combination scheme.

[0038] After obtaining multiple combination schemes that assign a number of position information to the first camera and the second camera, the path cost of each combination scheme is calculated respectively, and the path cost includes a first path length from the current position of the first camera to all defect positions to be detected assigned to the first camera in the combination scheme and a second path length from the current position of the second camera to all defect positions to be detected assigned to the second camera in the combination scheme.

[0039] Among them, the acquisition order when the first camera or the second camera runs according to the position information in the combination scheme can be generated according to the distance between the position information and the camera. The camera will give priority to collecting defects that are closer to the position of the defect to be inspected, so as to make the path cost of the combination scheme smaller.

[0040] Step S14: Obtain a combination scheme with the minimum path cost, and perform path planning for the first camera and the second camera according to the combination scheme with the minimum path cost.

[0041] A combination scheme with the smallest path cost among all combination schemes is obtained, and a planning path of the first camera and the second camera is generated according to the moving sequence of the combination scheme with the smallest path cost, so that the first camera and the second camera capture defect images according to the planned path.

[0042] In an embodiment of the present application, multiple combination schemes for allocating a number of position information to the first camera and the second camera are obtained, and the path cost of each combination scheme is calculated, so as to plan the paths of the first camera and the second camera by selecting the combination scheme with the smallest path cost, so that the path for the first camera and the second camera to move to a number of defect positions is the shortest, thereby effectively reducing the time required for image acquisition and improving the efficiency of defect detection.

[0043] See also Figure 2 , Figure 22 is a flow chart of the second embodiment of the path planning method provided by the present application. Figure 2 As shown, in this embodiment, step S12 also includes the following steps:

[0044] Step S21: acquiring a first data set of a first camera and a second data set of a second camera based on a number of position information.

[0045] The plurality of position information is allocated to the first camera and the second camera to obtain a first data set of the first camera and a second data set of the second camera, wherein the intersection of the first data set and the second data set is an empty set, and the union of the first data set and the second data set includes all the position information.

[0046] Step S22: acquiring a first combination solution of the first camera according to the first data set, and acquiring a second combination solution of the second camera according to the second data set.

[0047] A first combination scheme for the first camera is obtained according to the first data set, and a second combination scheme for the second camera is obtained according to the second data set. The first combination scheme includes the first data set and the order in which the first camera runs the first data set, and the second combination scheme includes the second data set and the order in which the second camera runs the second data set.

[0048] Step S23: acquiring a combination scheme of the first camera and the second camera based on the first combination scheme and the second combination scheme.

[0049] According to the obtained first combination scheme and the second combination scheme, a combination scheme of the first camera and the second camera is obtained, and then a plurality of combination schemes for allocating a number of position information to the first camera and the second camera are obtained.

[0050] Therefore, in the above-mentioned embodiment, by acquiring the first data set of the first camera and the second data set of the second camera, the first combination scheme of the first camera and the second combination scheme of the second camera are acquired, so that the paths of the first camera and the second camera are planned according to the first combination scheme and the second combination scheme, thereby improving the efficiency of defect detection.

[0051] Further, step S22 includes the following steps: sorting the first defect position set to be detected according to the position relationship of the defects to be detected in the first direction, wherein the first direction is perpendicular to the running direction of the first camera; assigning the acquisition order and acquisition position of the first camera according to the sorted first defect position set to be detected to form a first combination scheme of the first camera.

[0052] Specifically, during the process of the defect detection device conveying the board to be tested, the defect detection device collects images of the board to be tested. The first camera and the second camera are arranged in parallel in the image collection area of ​​the defect detection device along the conveying direction, and the defect detection device includes a sliding track, and the first camera and the second camera can slide in the vertical direction of the conveying direction through the sliding track to collect images of multiple position information of the board to be tested.

[0053] Before the board to be tested enters the image acquisition area, the position of the circuit board will be adjusted by a baffle set in the defect detection device so that the first direction of the coordinate system of the board to be tested is basically parallel to the vertical direction of the conveying direction, so that when the position information of the first data set is not equal in the first direction, the combination scheme of the first camera and the second camera is obtained in the order of the first direction of the position information.

[0054] In the above embodiment, the first set of defect positions to be detected is sorted according to the position relationship of the defects to be detected in the first direction, so that in the combination scheme, the camera will prioritize the capture of defects closer to the defect positions to be detected according to the distance relationship between the current position and the defect positions to be detected, thereby reducing the amount of calculation of the terminal device.

[0055] See also Figure 3 , Figure 3 FIG. 1 is a flow chart of the third embodiment of the path planning method provided by the present application. Figure 3 As shown, in this embodiment, the first direction is perpendicular to the running direction of the first camera, and the second direction is parallel to the running direction of the first camera. The first combination scheme of obtaining the first camera according to the first defect position set to be detected in step S22 also includes the following steps:

[0056] Step S31: when the positions of several defects to be detected in the first direction do not overlap, the first set of positions of defects to be detected is sorted according to the position relationship of the defects to be detected in the first direction.

[0057] When the data of the defects to be detected in the first set of defect positions to be detected in the first direction are not equal, for example, the position information of the defect positions to be detected is represented by the coordinate system position composed of the first direction and the second direction, if there are not more than two defect positions to be detected in the first set of defect positions to be detected whose position information has the same coordinate values ​​in the first direction, then the first set of defect positions to be detected is sorted according to the position relationship of the defects to be detected in the first direction.

[0058] Step S32: When the positions of several defects to be detected overlap in the first direction, the first set of positions of defects to be detected is sorted according to the positional relationship of the defects to be detected in the first direction and the positional relationship of the overlapping defects to be detected in the second direction, wherein the second direction is the running direction of the first camera.

[0059] When the data of the defects to be detected in the first defect position set in the first direction are equal, or when the position information of two or more defect positions to be detected in the first defect position set have equal coordinate values ​​in the first direction, the first defect position set to be detected is sorted according to the position relationship of the defects to be detected in the first direction, and the position information of the overlapping defect positions to be detected is sorted according to the position relationship of the overlapping defects to be detected in the second direction.

[0060] Step S33: allocating the acquisition sequence and acquisition positions of the first camera according to the sorted first set of defect positions to be detected, to form a first combination scheme of the first camera.

[0061] The sorted first defect position set to be detected is obtained, and the acquisition order and acquisition position of the first camera are allocated according to the order of the first defect position set to be detected and the current position of the first camera. Specifically, the acquisition order of the first camera can be allocated according to the distance relationship between the current position of the first camera and the defect position to be detected, so that when calculating the first path length from the current position of the first camera to the defect position to be detected in the first defect position set to be detected, it is not necessary to calculate all the sorting schemes of the several defect positions to be detected in the first combination scheme.

[0062] In the above embodiment, the first set of defect positions to be detected is sorted according to the position relationship of the defects to be detected in the first direction. When the positions in the first direction overlap, the first set of defect positions to be detected can be sorted according to the position relationship of the defects to be detected in the first direction and the position relationship of the overlapping defects to be detected in the second direction. There is no need to calculate all sorting schemes for several defect positions to be detected of the first combination scheme, thereby reducing the amount of calculation of the terminal device and improving the efficiency of defect detection.

[0063] Optionally, a specific implementation of acquiring a second combination scheme of the second camera according to the second set of defect positions to be detected is similar to steps S31-S33, which will not be described herein.

[0064] Optionally, the board to be tested includes a first plane and a second plane opposite to each other, and the position information of the plurality of defect positions to be detected on the board to be tested includes first position information of the plurality of first defect positions to be detected corresponding to the first plane, and second position information of the plurality of second defect positions to be detected corresponding to the second plane.

[0065] Among them, the first plane and the second plane of the board to be tested can be the upper and lower surfaces of the board to be tested. The board to be tested enters the defect detection device with the first plane facing upward and the second plane facing downward, so that the defect detection device can simultaneously detect defects on the first plane and the second plane of the board to be tested.

[0066] Specifically, the camera further includes a third camera and a fourth camera, the first camera and the second camera are arranged on one side of the first plane of the board to be tested, and the third camera and the fourth camera are arranged on one side of the second plane of the board to be tested. The first camera, the second camera and the third camera, the fourth camera are arranged correspondingly, the first camera and the second camera are used to capture images of defects on the first plane of the board to be tested, and the third camera and the fourth camera are used to capture images of defects on the second plane of the board to be tested.

[0067] When the control terminal device obtains the combination scheme of the first plane and the combination scheme of the second plane, since each defect position to be detected can only exist in the first plane or the second plane, classification can be performed when obtaining the position information of several defect positions to be detected on the board to be tested, and the position information of the defect positions to be detected on the first plane can be distinguished from the position information of the defect positions to be detected on the second plane to obtain the first position information of the first plane and the second position information of the second plane.

[0068] In the above-mentioned embodiment, the first camera can be used to capture images of defects on the first plane of the board to be tested, and the third camera and the fourth camera can be used to capture images of defects on the second plane of the board to be tested, so as to simultaneously perform defect detection on the first plane and the second plane of the board to be tested. There is no need to flip the board to be tested after detecting the first plane and then detect the second plane, thereby avoiding damage to the circuit board during manual or mechanical flipping, and improving detection efficiency.

[0069] See also Figure 4 , Figure 4 is a flow chart of the fourth embodiment of the path planning method provided by the present application. Figure 4 As shown, in this embodiment, a binary tree is used to obtain multiple combination schemes for allocating a number of position information to the first camera and the second camera. Specifically, step S12 further includes the following steps:

[0070] Step S41: creating a plurality of tree nodes, wherein the tree nodes at least include a first tree node for storing a first camera and a second tree node for storing a second camera.

[0071] Specifically, when obtaining multiple combination schemes for allocating a number of position information to the first camera and the second camera, multiple tree nodes are first created, the number of tree nodes corresponds to the number of cameras, and the tree nodes include at least a first tree node for storing the first camera and a second tree node for storing the second camera.

[0072] Step S42: recursively perform a plurality of position information to construct multiple layers of child nodes of the first tree node and the second tree node according to the plurality of position information.

[0073] When a number of position information is assigned to the first camera and the second camera, for the first tree node of the first camera, multiple child nodes need to be constructed according to multiple possible assigned position information. For example, the position information includes the first position information, the second position information, the third position information and the fourth position information. In a possible solution, the first position information, the second position information and the third position information are assigned to the first camera, then the child nodes of each layer of the first tree node need to include the first position information, the second position information and the third position information, and the reference relationship between the child nodes of each layer of the first tree node is the order of the first camera from the current position to the first position information, the second position information and the third position information.

[0074] Among them, recursion refers to the method in which a function calls itself as a subroutine. Recursive multiple position information refers to the process of allocating multiple position information to the first tree node and the second tree node, while referencing the previously allocated position information. Insert multiple position information into the first tree node and the second tree node in sequence, and construct the child nodes of each layer of the first tree node and the second tree node in sequence according to the order of insertion. Specifically, the tree node includes multiple layers of child nodes. When searching for each layer of child nodes of the tree node, it is necessary to reference all child nodes before the child nodes of this layer, that is, the multiple layers of child nodes of the first tree node and the second tree node can be obtained by recursively applying multiple position information.

[0075] Step S43: traverse the first tree node and the second tree node to obtain multiple combination solutions of the first camera and the second camera.

[0076] After obtaining the multi-layer child nodes of the first tree node and the multi-layer child nodes of the second tree node, all objects of the first tree node and the second tree node are traversed to export all objects stored in the binary tree to form a combination scheme of the first camera and the second camera. The traversal method includes but is not limited to post-order traversal or pre-order traversal.

[0077] In the above implementation, a plurality of combination schemes for allocating a plurality of position information to the first camera and the second camera are obtained by using a tree data structure of a binary tree, so that the plurality of position information are subdivided into the first camera and the second camera, and the relevant information allocated to the first camera and the second camera is stored in child nodes. The combination scheme of the first camera and the second camera can be obtained by traversing the tree nodes. The tree data structure is clear, the position allocation method between cameras is simple, and the operation efficiency is improved.

[0078] Optionally, when the board to be tested includes a first plane and a second plane facing away from each other, and the camera includes a third camera and a fourth camera, the specific method of obtaining multiple combination solutions by means of tree nodes is adjusted accordingly.

[0079] Specifically, the first camera and the second camera are used to capture images of defects on the first plane of the board to be tested, and the third camera and the fourth camera are used to capture images of defects on the second plane of the board to be tested. Therefore, multiple combination schemes for allocating a number of position information to the first camera and the second camera can be obtained by constructing a tree structure of a quadtree. Among them, the tree node includes a first tree node for storing the first camera, a second tree node for storing the second camera, a third tree node for storing the third camera, and a fourth tree node for storing the fourth camera. The specific steps of obtaining multiple combination schemes by constructing each layer of sub-nodes of the tree node are similar to the above-mentioned embodiment and will not be repeated here.

[0080] Optionally, step S11 further includes the following steps: acquiring defect data of the board to be tested; acquiring a positioning image of the board to be tested, and identifying reference points on the positioning image; and acquiring position information of several defect positions to be detected of the board to be tested based on the defect data and the reference points.

[0081] The defect data is the detection result obtained after the board to be tested is optically inspected by the AOI detection system, and the defect data includes coordinate data of several defects of the board to be tested and the mapping relationship between the board to be tested and the coordinate data.

[0082] The positioning image of the board to be tested corresponds to the actual board to be tested, and is used to identify the reference point of the board to be tested in the positioning image, and determine the position information of several defects in the defect data in the actual board to be tested based on the mapping relationship between the reference point, the board to be tested and the coordinate data, so that when the path planning is performed on the combination scheme of assigning several position information to the first camera and the second camera in the subsequent process, the first camera and the second camera can locate the specific defect area according to the position information.

[0083] Optionally, after step S14, the path planning method may further include the following steps: generating a first control signal for the first camera and a second control signal for the second camera according to a combination scheme with the minimum path cost; based on the first control signal, controlling the first camera to move in sequence from the current position to the defect position to be detected assigned to the first camera in the combination scheme, and collecting a first defect image for each defect position to be detected; based on the second control signal, controlling the second camera to move in sequence from the current position to the defect position to be detected assigned to the second camera in the combination scheme, and collecting a second defect image for each defect position to be detected.

[0084] After obtaining the combination solution with the minimum path cost, a first control signal and a second control signal are generated to control the first camera and the second camera respectively, thereby reducing the time required for camera acquisition and improving the speed of defect detection.

[0085] See also Figure 5 , Figure 5Schematic diagram of a terminal device according to an embodiment of the present application. Figure 5 As shown, the terminal device 100 includes a processor 101 and a memory 102 connected to the processor 101, wherein the memory 102 stores program data, and the processor 101 calls the program data stored in the memory 102 to execute the above-mentioned path planning method.

[0086] Optionally, in one embodiment, the processor 101 is used to execute program data to implement the following method: obtain the current position of the camera, the camera includes at least a first camera and a second camera; obtain the position information of several defect positions to be detected of the board to be tested, and obtain multiple combination schemes for assigning the several position information to the first camera and the second camera, wherein each combination scheme includes the position information of all defect positions to be detected, and the camera assigned to each defect position to be detected; calculate the path cost of each combination scheme, wherein the path cost includes at least a first path length from the current position of the first camera to all defect positions to be detected assigned to the first camera in the combination scheme, and a second path length from the current position of the second camera to all defect positions to be detected assigned to the second camera in the combination scheme; obtain the combination scheme with the minimum path cost, and plan the path for the first camera and the second camera according to the combination scheme with the minimum path cost.

[0087] The processor 101 may also be referred to as a CPU (Central Processing Unit). The processor 101 may be an electronic chip having the ability to process signals. The processor 101 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0088] The memory 102 can be a memory stick, a TF card, etc., which can store all the information in the terminal device 100, including the input raw data, computer programs, intermediate operation results and final operation results are all stored in the memory 102. It stores and retrieves information according to the location specified by the processor 101. With the memory 102, the terminal device 100 has a memory function and can ensure normal operation. The memory 102 of the terminal device 100 can be divided into main memory (internal memory) and auxiliary memory (external memory) according to its purpose, and there is also a classification method of dividing it into external memory and internal memory. External memory is usually a magnetic medium or an optical disk, etc., which can store information for a long time. Memory refers to the storage component on the motherboard, which is used to store the data and programs currently being executed, but is only used to temporarily store programs and data. If the power is turned off or the power is cut off, the data will be lost.

[0089] Optionally, after planning the path of the camera, the terminal device can also perform motion control on the first camera and the second camera according to the combination scheme with the minimum path cost, so that the first camera and the second camera can capture the defective area of ​​the board to be tested according to the scheme with the minimum path cost. The motion control function of the terminal device can be implemented by a motion control card or other devices, which is not specifically limited here.

[0090] See also Figure 6 , Figure 6 Schematic diagram of a computer-readable storage medium according to an embodiment of the present invention. Figure 6 As shown, the computer-readable storage medium 200 stores program instructions 211 capable of implementing all the above methods.

[0091] If the integrated units of the functional units in the various embodiments of the present application are implemented in the form of software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium 200. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer-readable storage medium 200 includes several instructions in a program instruction 211 to enable a computer device (which can be a personal computer, a system server, or a network device, etc.), an electronic device (such as MP3, MP4, etc., or a mobile terminal such as a mobile phone, a tablet computer, a wearable device, or a desktop computer, etc.) or a processor to execute all or part of the steps of the methods of various implementation methods of the present application.

[0092] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-readable storage media 200 (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0093] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by the computer-readable storage medium 200. These computer-readable storage media 200 can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the program instructions 211 executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0094] These computer-readable storage media 200 may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the program instructions 211 stored in the computer-readable storage medium 200 produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0095] These computer-readable storage media 200 can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing program instructions 211 executed on the computer or other programmable device for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0096] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A path planning method, characterized in that: include: Acquire a current position of a camera, where the camera includes at least a first camera and a second camera; Acquire position information of several to-be-detected defect positions of the to-be-detected plate body, and acquire multiple combination schemes for assigning the several position information to the first camera and the second camera, wherein each of the combination schemes includes the position information of all to-be-detected defect positions, and the camera assigned to each to-be-detected defect position, and the step of acquiring the multiple combination schemes includes: creating multiple tree nodes, wherein the tree nodes at least include a first tree node for storing the first camera and a second tree node for storing the second camera; Recursively perform some of the position information to construct multiple layers of child nodes of the first tree node and the second tree node according to the some of the position information; Traversing the first tree node and the second tree node to obtain multiple combination solutions of the first camera and the second camera; Calculating the path cost of each combination scheme, wherein the path cost at least includes a first path length from the current position of the first camera to all the defect positions to be detected assigned to the first camera in the combination scheme, and a second path length from the current position of the second camera to all the defect positions to be detected assigned to the second camera in the combination scheme; A combination scheme with the minimum path cost is obtained, and paths are planned for the first camera and the second camera according to the combination scheme with the minimum path cost.

2. The path planning method according to claim 1, characterized in that: The step of obtaining position information of a plurality of positions of defects to be detected on the plate to be tested, and obtaining a plurality of combination schemes for distributing the plurality of position information to the first camera and the second camera includes: Allocating a first set of defect positions to be detected corresponding to the first camera and a second set of defect positions to be detected corresponding to the second camera based on the position information of the plurality of defect positions to be detected; Acquire a first combination scheme of the first camera according to the first set of defect positions to be detected, and acquire a second combination scheme of the second camera according to the second set of defect positions to be detected; A combination scheme of the first camera and the second camera is acquired based on the first combination scheme and the second combination scheme.

3. The path planning method according to claim 2, characterized in that: The step of acquiring a first combination scheme of the first camera according to the first set of defect positions to be detected includes: sorting the first set of positions of defects to be detected according to the position relationship of the defects to be detected in a first direction, wherein the first direction is perpendicular to the running direction of the first camera; The acquisition sequence and acquisition positions of the first cameras are allocated according to the sorted first set of defect positions to be detected, so as to form a first combination scheme of the first cameras.

4. The path planning method according to claim 3, characterized in that: The step of sorting the first set of positions of defects to be detected according to the position relationship of the defects to be detected in the first direction comprises: When the positions of a number of the defects to be detected in the first direction do not overlap, sorting the first set of positions of the defects to be detected according to the position relationship of the defects to be detected in the first direction; When the positions of several defects to be detected overlap in the first direction, the first set of positions of defects to be detected are sorted according to the position relationship of the defects to be detected in the first direction and the position relationship of the overlapping defects to be detected in the second direction, wherein the second direction is the running direction of the first camera.

5. The path planning method according to claim 1, characterized in that: The board to be tested includes a first plane and a second plane opposite to each other, and the position information of the plurality of defect positions to be detected on the board to be tested includes first position information of the plurality of first defect positions to be detected corresponding to the first plane, and second position information of the plurality of second defect positions to be detected corresponding to the second plane; The camera further includes a third camera and a fourth camera, wherein the first camera and the second camera are arranged on one side of a first plane of the board to be tested, and the third camera and the fourth camera are arranged on one side of a second plane of the board to be tested.

6. The path planning method according to claim 1, characterized in that: The step of obtaining position information of a plurality of defect positions to be detected on the plate to be tested includes: Acquiring defect data of the board to be tested; Acquire a positioning image of the board to be tested, and identify reference points on the positioning image; The position information of several to-be-detected defect positions of the to-be-detected plate body is acquired based on the defect data and the reference point.

7. The path planning method according to claim 1, characterized in that: After the step of performing path planning for the first camera and the second camera according to the combination scheme with the minimum path cost, the path planning method further includes: Generate a first control signal for the first camera and a second control signal for the second camera according to the combination scheme with the minimum path cost; Based on the first control signal, control the first camera to move from a current position to the defect positions to be detected allocated to the first camera in the combination scheme in sequence, and collect a first defect image of each defect position to be detected; Based on the second control signal, the second camera is controlled to move from the current position to the defect positions to be detected allocated to the second camera in the combination scheme in sequence, and a second defect image of each defect position to be detected is collected.

8. A terminal device, characterized in that: The terminal device includes a processor and a memory connected to the processor, wherein the memory stores program data, and the processor calls the program data stored in the memory to execute the path planning method as described in any one of claims 1-7.

9. A computer-readable storage medium, characterized in that: Program instructions are stored, and the program instructions are executed to implement the path planning method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Multi-agricultural-machine cooperative operation remote management scheduling method based on improved ant colony algorithm

    CN111639811A

  • Detection method, alignment method of detection equipment and detection equipment

    CN112577970A