Detection result processing method and device, computer equipment and storage medium

By determining the positioning information of the alternative objects in the target detection results of the product image and generating tree structure data, the problem of fixture marks being mistaken for dirtyness is solved, and high-accurate product quality detection is achieved.

CN119648637APending Publication Date: 2025-03-18SHENZHEN SMARTMORE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411666762.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

In product quality inspection, the marks left by the fixture are easily mistaken for dirtyness, which affects the accuracy of the test results.

Method used

By determining the positioning information of the alternative objects in the object detection results of the product image, the tree structure data is generated, and the background objects that meet the position relationship of the target shape are searched in the tree structure data, and the detection results of these background objects are eliminated.

Benefits of technology

It realizes accurate deletion of background detection results from target detection results, improves the accuracy of detection results, reduces search complexity and time-consuming, and improves detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119648637A_ABST
    Figure CN119648637A_ABST
Patent Text Reader

Abstract

The invention relates to a detection result processing method and device, computer equipment and a storage medium. The method comprises the steps of determining positioning information of at least one alternative object in a target detection result of a product image; generating tree structure data based on the positioning information of each alternative object and the region corresponding to the tree node; in the tree structure data, searching a plurality of background objects meeting the target shape and position relationship; and removing the detection result of each background object in the target detection result. By adopting the method and the device, the background detection result can be eliminated from the target detection result, and the accuracy of product quality detection 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 detection result processing, and in particular to a detection result processing method, apparatus, computer equipment and storage medium. Background Art

[0002] During the production process, some products need to be fixed with some clamps so that the fixed products can be processed. These clamps will leave marks on the surface of the products when fixing the products.

[0003] When testing the quality of a product, it is necessary to test the dirt on the surface of the product. The marks left by the fixture can easily be mistaken for dirt, affecting the quality test results of the product. Summary of the invention

[0004] Based on this, it is necessary to provide a detection result processing method, device, computer equipment, computer readable storage medium and computer program product to address the above technical problems, which can exclude background detection results from target detection results and improve the accuracy of product quality detection.

[0005] In a first aspect, the present application provides a method for processing a detection result, comprising:

[0006] Determine location information of at least one candidate object in the object detection result of the product image;

[0007] Generate tree structure data based on the location information of each candidate object and the area corresponding to the tree node;

[0008] In the tree structure data, searching for a plurality of background objects that satisfy a target shape position relationship;

[0009] In the target detection results, the detection results of the background objects are eliminated.

[0010] In a second aspect, the present application provides a detection result processing device, comprising:

[0011] A positioning module, used to determine positioning information of at least one candidate object in the object detection result of the product image;

[0012] A generating module, used for generating tree structure data based on the positioning information of each candidate object and the area corresponding to the tree node;

[0013] A search module, used to search for multiple background objects that satisfy the target shape position relationship in the tree structure data;

[0014] The deletion module is used to remove the detection results of each background object from the target detection results.

[0015] In a third aspect, the present application provides a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps in the above method when executing the computer program.

[0016] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps in the above method when executed by a processor.

[0017] In a fifth aspect, the present application provides a computer program product, which includes a computer program, and the computer program implements the steps in the above method when executed by a processor.

[0018] The above-mentioned detection result processing method, device, computer equipment, computer-readable storage medium and computer program product determine the structural relationship of each candidate object according to the positioning information of the candidate object in the target detection result in the product image, and generate tree structure data. From the tree structure data, search for background objects that meet the target shape position relationship as the first object detection result, and delete the first object detection result from the target detection result, retaining only the second object detection result, so as to achieve accurate deletion of background detection results from the target detection result, improve the accuracy of the target detection result, and can generate tree structure data according to the structural relationship of the candidate objects, and search for background objects with specific position relationships in the tree structure data, which can reduce the complexity of the search operation, thereby reducing the time spent in searching for background objects, and then can quickly eliminate non-dirty detection results from the product quality inspection results, thereby improving the accuracy and detection efficiency of the product quality inspection results. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 An application environment diagram of a detection result processing method provided in an embodiment of the present application;

[0020] Figure 2 A flowchart of a method for processing detection results provided in an embodiment of the present application;

[0021] Figure 3 An application scenario diagram of a detection result processing method provided in an embodiment of the present application;

[0022] Figure 4 A structural block diagram of a detection result processing device provided in an embodiment of the present application;

[0023] Figure 5 An internal structure diagram of a computer device provided in an embodiment of the present application;

[0024] Figure 6An internal structure diagram of another computer device provided in an embodiment of the present application;

[0025] Figure 7 An internal structure diagram of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0027] The detection result processing method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through a communication network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0028] like Figure 2 As shown, the present application embodiment provides a detection result processing method, which is applied to Figure 1 The terminal 102 or the server 104 in the example is used for explanation. It is understandable that the computer device may include at least one of the terminal and the server. The method comprises the following steps:

[0029] S201: Determine positioning information of at least one candidate object in the object detection result of the product image.

[0030] In some embodiments, a product image may refer to an image obtained by photographing a product. The product image may be obtained by photographing a flowing product on a production line. The target detection result may refer to the detection result of the target in the product image, wherein the detection result may include the location of the area and the type of the area, etc. In the case where there is no misjudgment in the target detection result, the target detection result should only include the detection result of the target; since there is a misjudgment in the target detection result, the target detection result includes the detection result of the target and the detection result of the non-target. The candidate object may refer to a detection result, that is, an area. The candidate object may include the detection result of the target or the detection result of the non-target. The positioning information of the candidate object is used to determine the position of the candidate object. The positioning information of the candidate object may include the coordinates of the boundary points of the area of ​​the candidate object. For example, the positioning information of the candidate object may include the coordinates of the diagonal vertices of the rectangular area of ​​the candidate object.

[0031] S202: Generate tree structure data based on the location information of each candidate object and the area corresponding to the tree node.

[0032] In some embodiments, the distribution area can be determined according to the positioning information of the candidate object; or the product image can be directly determined as the distribution area. The distribution area is divided into at least one unit area. For each unit area, a corresponding node is generated according to the unit area. For each unit area, at least one new unit area can be further divided, and the node generated by the newly divided unit area is determined as the child node of the node generated by the unit area. The unit area of ​​the generated node is determined as the area corresponding to the node. Based on the parent-child relationship between each node, a tree is generated. Mapping the candidate object to the node is equivalent to adding the candidate object to the tree to obtain tree structure data. For each candidate object, according to the positioning information of the candidate object, the area to which the candidate object belongs is determined, and the candidate object and related information are added to the node corresponding to the area to which it belongs, which is equivalent to mapping the candidate object to the corresponding area according to its positioning information, and adding it to the node corresponding to the corresponding area. The parent-child relationship between the nodes of the tree is used to describe the positional relationship between the areas corresponding to each node. The relevant information may include the positioning information and type of the candidate object. In some examples, the tree structure data may be rectangular tree (Rectangle Tree, R-Tree) structure data. R-Tree is particularly suitable for storing and querying two-dimensional and higher-dimensional spatial objects.

[0033] S203: Search the tree structure data for multiple background objects that satisfy the target shape position relationship.

[0034] In some embodiments, the background object may refer to a non-target. The shape formed by multiple background objects that satisfy the target shape position relationship is the target shape. The first object detection result may refer to the detection result of the non-target. The position relationship of each candidate object is recorded in the tree structure data. According to the position relationship of the candidate objects, multiple candidate objects that satisfy the target shape position relationship can be searched, and these multiple candidate objects are determined as background objects.

[0035] In one example, the target shape is a triangle, and the target shape position relationship may include the position relationship between the three vertices of the triangle. For another example, the target shape is a circle, and the target shape position relationship may include the position relationship between the center of the circle and at least one point on the circle. For another example, the target shape is a rectangle, and the target shape position relationship may include the position relationship between at least two vertices of the rectangle.

[0036] S204: Eliminate the detection results of each background object from the target detection results.

[0037] In some embodiments, in the target detection result, the detection result of each background object is queried, and the detection result of each background object is determined as the first object detection result. The first object detection result is eliminated from the target detection result to obtain the second object detection result. The second object detection result may refer to the detection result of the target. Eliminating the first object detection result from the target detection result indicates that the detection results of non-target background objects are deleted from the target detection result, and the remaining detection results are the detection results of the target. Eliminating the first object detection result is equivalent to eliminating the wrong detection result from the target detection result and retaining the correct detection result.

[0038] It can be seen that in the embodiment of the present application, the structural relationship of each candidate object is determined by using the positioning information of the candidate object in the target detection result in the product image, and the tree structure data is generated. From the tree structure data, the background object that satisfies the target shape position relationship is searched as the first object detection result, and the first object detection result is deleted from the target detection result, and only the second object detection result is retained, so as to achieve accurate deletion of the background detection result from the target detection result, improve the accuracy of the target detection result, and generate tree structure data according to the structural relationship of the candidate object, and search for background objects with specific position relationships in the tree structure data, which can reduce the complexity of the search operation, thereby reducing the time spent in searching for background objects, and then quickly eliminate the non-dirty detection results from the product quality inspection results, thereby improving the accuracy and detection efficiency of the product quality inspection results.

[0039] In some embodiments, searching the tree structure data for a plurality of background objects that satisfy a target shape position relationship includes:

[0040] Traverse each candidate object;

[0041] For each candidate object traversed, search the tree structure data to see whether there is another object that satisfies the target shape position relationship;

[0042] When there are other objects satisfying the target shape position relationship with the candidate objects, the candidate objects and the other objects satisfying the target shape position relationship are determined as background objects.

[0043] Among them, traversing each candidate object may refer to selecting an alternative object in turn. The traversed alternative object may refer to the alternative object currently being processed. The tree structure data records the nodes corresponding to the alternative objects and the positional relationship between the nodes. The alternative objects and the positional relationship between the alternative objects can be searched in the tree structure data. The target shape positional relationship may include the positional relationship between key points in the target shape, and the positional relationship may include: distance and / or direction, etc. The shape formed by the combination of other objects and alternative objects is the same as the target shape, and the positional relationship between other objects and alternative objects is the same as the target shape positional relationship. The number of other objects is at least one. When the number of other objects is multiple, a reference object can be selected from the other objects and alternative objects that have been searched, and the reference object and the remaining objects can be combined respectively, and each combination satisfies the target shape positional relationship. If the detected multiple objects and candidate objects form various combinations, when there is a combination that does not satisfy the target shape position relationship, it is determined that the detected multiple objects are not other objects, and similarly, the multiple objects are not background objects. At this time, continue to detect multiple objects that satisfy the target shape position relationship for the traversed candidate objects.

[0044] When there is no other object in the target shape position relationship among the candidate objects, it is determined that the candidate object and the other object in the target shape position relationship are not background objects, and the next candidate object is traversed. The position relationship recorded in the tree structure data can quickly query multiple objects in the target shape position relationship.

[0045] It can be seen that in this embodiment, each candidate object is traversed, and each candidate object is taken as the starting point to determine whether there are multiple background objects including the candidate object, and whether there is a target shape position relationship between the background objects. The candidate objects can be judged one by one to avoid missing background objects, improve the detection accuracy of background objects, and search for other objects with target shape position relationships in the tree structure data, so that the background objects can be quickly queried.

[0046] In some embodiments, the target shape position relationship is a vertex position relationship of a square; for each candidate object traversed, searching the tree structure data for other objects that satisfy the target shape position relationship includes:

[0047] For each candidate object traversed, search the tree structure data for the first object within a circle range with the candidate object as the center and determined by the side length of the square;

[0048] When there is at least one first object, traverse each first object;

[0049] For each first object traversed, search the tree structure data for a second object within a circular range that is centered on the first object and determined by the side length of a square;

[0050] When there is at least one second object, detecting whether the distance between each second object and the candidate object is consistent with the length of the diagonal of the square;

[0051] When there is a second object with the same length, determining the second object with the same length as the third object;

[0052] Traverse each third object;

[0053] For each traversed third object, search the tree structure data for a fourth object within a circle range that is centered on the third object and is determined by the side length of a square;

[0054] When the fourth object exists, detecting whether the distance between the fourth object and the candidate object is consistent with the side length of the square, and detecting whether the distance between the fourth object and the first object is consistent with the length of the diagonal of the square;

[0055] When the distance between the fourth object and the candidate object is consistent with the side length of the square, and the distance between the fourth object and the first object is consistent with the length of the diagonal of the square, it is determined that the first object, the third object and the fourth object are other objects that meet the target shape position relationship as candidate objects.

[0056] The target shape is a square, and the vertex position relationship of the square may mean that the distance between every two adjacent vertices is the side length of the square, and the distance between every two diagonal vertices is the length of the diagonal of the square. The candidate object may be characterized by its key point, wherein the key point of the candidate object may refer to the center point of the minimum circumscribed rectangle of the candidate object. When the distance between any two objects is subsequently calculated, the distance between the key points of the two objects is used as the distance between the two objects.

[0057] Among them, the first object is searched in the tree structure data, and the distance between the first object and the candidate object is the same or similar to the side length of the square. In fact, the distance between the key point of the first object and the key point of the candidate object is used to characterize the distance between the first object and the candidate object. This is an approximate calculation, and there are errors in the approximate calculation result. Accordingly, the side length of the square can be used as the radius, and a certain distance can be expanded inward and outward to form a circular ring range as the range for searching the first object to avoid missing the first object due to calculation errors. Since the direction between the first object and the candidate object can be arbitrary, a circular ring range can be determined with the candidate object as the center and the same or similar length of the side length of the square as the radius, and the candidate objects distributed within the circular ring range are determined as the first object.

[0058] When the candidate object is the center of the circle and there is no first object within the circular range determined by the side length of the square, the next candidate object is traversed. When there is at least one first object, each first object is traversed.

[0059] Among them, with the first object as the center of the circle and the same or similar length of the side length of the square as the radius, a circular ring range is determined, and the candidate objects distributed within the circular ring range are determined as the second object. At this time, only the second object is preliminarily screened out, and the second object needs to be verified based on the candidate object. In theory, the distance between the first object and the second object is the side length of the square, and the second object and the candidate object are the vertices of the diagonal of the square. Correspondingly, the distance between the candidate object and the second object is expected to be the length of the diagonal of the square. The distance between the candidate object and the second object and the length of the diagonal of the square can be calculated to verify the second object. The distance between the candidate object and the second object is consistent with the length of the diagonal of the square, which can mean that the difference between the distance between the candidate object and the second object and the length of the diagonal of the square is less than the preset first length threshold, that is, it indicates that the distance between the candidate object and the second object is the same or similar to the length of the diagonal of the square. When the distance between the candidate object and the second object is consistent with the length of the diagonal of the square, the second object is determined as the third object, and when there is at least one third object, each third object is traversed. When the distance between the candidate object and the second object is inconsistent with the length of the square diagonal, continue to traverse the second object. When the distance between all the second objects screened based on the first object and the candidate object is inconsistent with the length of the square diagonal, continue to traverse the first object.

[0060] Among them, with the third object as the center and the same or similar length of the side of the square as the radius, a circular range is determined, and the candidate objects distributed within the circular range are determined as the fourth object. At this time, only the fourth object is preliminarily screened out, and the fourth object needs to be verified based on the first object and the candidate object determined previously. In theory, the distance between the candidate object and the fourth object is the side length of the square, and the first object and the fourth object are the vertices of the diagonal of the square. Correspondingly, the distance between the candidate object and the fourth object is expected to be the side length of the square, and the distance between the first object and the fourth object is expected to be the length of the diagonal of the square. The distance between the candidate object and the fourth object, as well as the distance between the first object and the fourth object, can be calculated to verify the fourth object.

[0061] Wherein, the distance between the candidate object and the fourth object is consistent with the side length of the square, and the distance between the first object and the fourth object is consistent with the length of the diagonal of the square, which may mean that the difference between the distance between the candidate object and the fourth object and the side length of the square is less than the preset second length threshold, and the difference between the distance between the first object and the fourth object and the length of the diagonal of the square is less than the preset third length threshold, that is, it indicates that the distance between the candidate object and the fourth object is the same or similar to the side length of the square, and at the same time, the distance between the first object and the fourth object is the same or similar to the length of the diagonal of the square. Wherein, the first length threshold, the second length threshold and the third length threshold may be independent of or the same as each other. When the distance between the candidate object and the fourth object is consistent with the side length of the square, and the distance between the first object and the fourth object is consistent with the length of the diagonal of the square, the first object, the third object and the fourth object are determined as other objects of the target shape position relationship of the candidate object, that is, it indicates that the candidate object has other objects of the target shape position relationship. When the distance between the candidate object and the fourth object is inconsistent with the side length of the square, or the distance between the first object and the fourth object is inconsistent with the length of the diagonal of the square, continue to traverse the fourth object. When all fourth objects screened based on the third object cannot satisfy the positional relationship of the square, the third object is continued to be traversed. The fourth object cannot satisfy the positional relationship of the square, which may mean that the distance between the fourth object and the candidate object is inconsistent with the side length of the square, or the distance between the fourth object and the first object is inconsistent with the length of the diagonal of the square.

[0062] It can be seen that in this embodiment, for the scenario where the target shape position relationship is the vertex position relationship of a square, the traversed alternative object is used as the base point in the tree structure data to search for the first object that meets the vertex position relationship of the square, and the first object is traversed, and the search for the second object that meets the vertex position relationship of the square is continued, and the second object that passes the verification is determined as the third object, and the third object is continued to be traversed, and the search and verification of the fourth object that meets the vertex position relationship of the square can be implemented. The iterative search for objects with the vertex position relationship of the square can be implemented, and the newly determined objects can be verified based on the previously determined objects, so as to ensure the correctness of each other object.

[0063] In some embodiments, when there are other objects among the candidate objects that satisfy the target shape position relationship, determining the candidate objects and the other objects that satisfy the target shape position relationship as background objects includes:

[0064] When there is at least one other object that satisfies the target shape position relationship among the candidate objects, calculating the area variance between the candidate object and each other object;

[0065] When the area variance is less than a preset variance threshold, the candidate object and other objects satisfying the target shape position relationship are determined as background objects.

[0066] Among them, the target shape position relationship can limit the position relationship between multiple objects. The area variance is used to characterize the difference in area between the candidate object and each of the other objects. The preset variance threshold is used to constrain the area variance within a smaller numerical range so that the difference between the area of ​​the candidate object and the other objects is smaller. In some product production scenarios, for example, when a clamp with multiple claws of the same size is used to fix a product, multiple marks of the same size will be left on the appearance of the product. The multiple marks correspond to the candidate object and the other objects respectively. That is to say, the area of ​​the candidate object is the same or similar to the area of ​​the other object, and accordingly, the area variance of the candidate object and the other objects is small.

[0067] It can be seen that in this embodiment, when there is at least one other object with a target shape position relationship with the candidate object, each other object is further verified by calculating the area variance between the candidate object and each other object. Only when the area variance between the candidate object and each other object is small, the candidate object and other objects are determined as background objects. The verification step of the background object can be increased to improve the detection accuracy of the background object.

[0068] In some embodiments, the first object within a circular ring range determined by the side length of a square with the alternative object as the center includes an alternative object within a circular ring range determined by a first radius and a second radius with the alternative object as the center; wherein the first radius is smaller than the second radius, the first radius is the difference between the side length of the square and a preset error, and the second radius is the sum of the side length of the square and the error.

[0069] The first circle is determined with the candidate object as the center and the first radius as the radius, the second circle is determined with the candidate object as the center and the second radius as the radius, and the difference between the first circle and the second circle is calculated to obtain the annular range. The error can be an empirical value, and the error is used to increase the distribution range of the first object and reduce the omission of the first object caused by the error. The annular range is actually the annular range between the first circle obtained by expanding the circle determined with the candidate object as the center and the side length of the square as the radius inward by the length of the error, and the second circle obtained by expanding the circle outward by the length of the error.

[0070] It can be seen that in this embodiment, based on a circle with the candidate object as the center and the side length of the square as the radius, the error length is expanded inward and outward, and the circular ring range between the two circles is calculated as the distribution range of the first object. The first object can be searched within a larger distribution range to avoid missing the first object, thereby improving the detection accuracy of the first object.

[0071] In some embodiments, determining the location information of at least one candidate object in the object detection result of the product image includes:

[0072] For at least one candidate object in the target detection result of the product image, calculating a circumscribed rectangle of the candidate object according to a region of the candidate object in the target detection result;

[0073] The coordinates of the center point of the candidate object are determined in the circumscribed rectangle of the candidate object, and the coordinates of the center point of the candidate object are determined as the positioning information of the candidate object.

[0074] Among them, an image of the product can be captured to obtain a product image. Target detection is performed on the product image, and the target detection result can be a mask map. In the mask map, the pixel value of the area where the candidate object is located is different from the pixel value of the background area. A connected domain segmentation algorithm is used to determine the area of ​​the candidate object, wherein a region is a connected domain. The circumscribed rectangle of the area is calculated as the circumscribed rectangle of the candidate object. The diagonal point of the circumscribed rectangle is used as the center point coordinate of the candidate object. The center point coordinate of the candidate object is used to identify the candidate object and indicate the position of the candidate object.

[0075] It can be seen that in this embodiment, the center point coordinates of the circumscribed rectangle determined by the area of ​​the candidate object in the target detection result are determined as the positioning information of the candidate object, which can convert the search for the candidate object into a point search and improve the search efficiency.

[0076] In some embodiments, the product image includes a battery image with a pole imprint; and the detection result of the background object includes a pole imprint detection result.

[0077] Among them, there is a probe imprint generated during the manufacturing process in the center of the pole of the new energy battery. In the task of surface quality inspection of new energy batteries, it is necessary to inspect the dirt and oxidation of the poles on the top cover of new energy batteries. The inspection results of defects such as dirt, bruises and oxidation marks are mixed with black spot marks formed by the pole probe imprints. These black spots are visually indistinguishable from the aforementioned defects. The pole probe imprints form four imprints arranged in a fixed square. However, the probe imprints cannot be distinguished from dirt in optical imaging, but they are not considered defects, so the probe imprints need to be screened out from a large amount of dirt.

[0078] Among them, the battery image is an image obtained by collecting images of new energy batteries on the production line. In the battery image, there is a pole imprint in the center of the battery pole. The target detection result of the battery image should be the defect detection result. For the defect target, the pole imprint is a non-target background object and needs to be excluded from the target detection result. The pole imprint detection result can refer to the detection result of the probe imprint in the center of the pole. The target shape is four imprints arranged in a square, and each imprint is equivalent to the vertex of the square.

[0079] It can be seen that in this embodiment, during the quality inspection process of new energy batteries, the pole imprint inspection results can be eliminated from the defect inspection results to improve the accuracy of the defect inspection results.

[0080] In some embodiments, the detection results of background objects are removed from the target detection results, and the defects are counted in the remaining detection results to obtain statistical results, such as the number of defects and / or the area ratio of defects. According to the statistical results of the defects, it is determined whether the product has passed.

[0081] In some embodiments, the statistical results of defects include the number of defects. When the number of defects is greater than or equal to a preset number threshold, the product is determined to be intercepted (Not Good, NG); when the number of defects is less than the preset number threshold, the product is determined to be passed. The statistical results of defects include the area ratio of defects. When the area ratio of defects is greater than or equal to a preset ratio, the product is determined to be intercepted (Not Good, NG); when the area ratio of defects is less than the preset ratio, the product is determined to be passed.

[0082] In some embodiments, Figure 3 As shown, the embodiment of the present application also provides a detection result processing method, including:

[0083] S301, performing target detection on the product image, and segmenting a large number of small dirt mixed with probe imprints.

[0084] Using a deep learning algorithm, a large number of small dirt mixed with probe marks are screened out.

[0085] S302: Use a connected domain image segmentation algorithm to obtain the center points of candidate objects and determine them as point set A.

[0086] The target detection result is a mask map. The mask map is segmented into connected domains to obtain multiple connected domains, and a connected domain of dirt mixed with probe imprints is obtained. Usually, the target of the target detection result is dirt, and the non-target is the background. The background area is usually not a connected domain. Therefore, the connected domain obtained by segmentation is the detection result of dirt. A connected domain is determined as a candidate object, and a candidate object is an instance. The center point of each connected domain is obtained, and the center point of the connected domain is determined as the center point of the corresponding candidate object. The point set formed by the center points of all connected domains is determined as point set A.

[0087] S303 . The R-Tree algorithm encodes the center point coordinates of all N candidate objects.

[0088] The total number of candidate objects is N. An R-Tree is constructed for the distribution areas of all candidate objects, and all center point coordinates are divided into various R-Tree nodes according to the corresponding areas of the nodes in the R-Tree and the center point coordinates of all candidate objects. According to the structure of the R-Tree, the RTree algorithm is used to encode the N center point coordinates in the spatial dimension.

[0089] S304. For the i-th point, find a point set B within the range of distance R±r from the R-Tree.

[0090] Traverse the N center point coordinates, take out the i-th center point coordinates, that is, obtain the traversed candidate object. Search for points within the range of the ring with point i as the center and R±r as the radius in the R-Tree, and determine the point set formed by the searched points as point set B, which is equivalent to searching for the candidate object within the range of the ring with the first radius and the second radius with the candidate object as the center, and determining it as the first object. The first radius is smaller than the second radius. The first radius is the difference between the side length of the square and the error, and the second radius is the sum of the side length of the square and the error.

[0091] S305, take the jth point in the point set B, and search for the point set C within the range of R±r from the R-Tree.

[0092] Traverse the center point coordinates in point set B, that is, traverse the first object, take out the jth center point coordinates, that is, obtain the traversed first object. Search for points within the ring range with point j as the center and R±r as the radius in the R-Tree, and determine the point set formed by the searched points as point set C, which is equivalent to searching for candidate objects within the ring range with the first object as the center and the first radius and the second radius, and determining them as the second object.

[0093] S306, determine whether point set C exists; if yes, execute S307; otherwise, execute S308.

[0094] S307, take the kth point in the point set C, and calculate the distance d between point k and point i.

[0095] Traversing the center point coordinates in the point set C, that is, traversing the second object, taking out the kth center point coordinates, that is, obtaining the traversed second object. After obtaining the second object, the second object is verified. The distance d between point k and point i may refer to the distance between the second object and the candidate object.

[0096] S308. Traverse the next point from point set B as point j and execute S309.

[0097] Continue to traverse point set B, that is, continue to traverse the first object, and select the next first object.

[0098] S309, determine whether there is a next point j; if yes, execute S305; otherwise, execute S310.

[0099] When point j exists, it indicates that there may be a point j in the future that makes point i and point j have a square position relationship, and the search can continue for a point that has a square position relationship with both point i and point j.

[0100] When point j does not exist, it indicates that there is no point j such that point i and point j have a square position relationship, that is, the candidate object corresponding to point i is not the probe imprint.

[0101] S310, traverse the next point from point set A as point i, and execute S304.

[0102] When point j does not exist, it indicates that there is no point j that makes point i and point j have a square position relationship. It is necessary to obtain a new point i to re-judge and continue to traverse the point set A, that is, continue to traverse the candidate objects and select the next candidate object.

[0103] S311. Determine whether the distance d is 1.414R±r; if so, execute S312; otherwise, execute S313.

[0104] 1.414R is actually the length of the diagonal of the square. Whether the distance d is 1.414R±r can be used to determine whether the distance between the second object and the candidate object is consistent with the length of the diagonal of the square.

[0105] S312. Obtain the third point k and execute S315.

[0106] When the distance between the second object and the candidate object is consistent with the length of the diagonal of the square, the third point k is obtained, indicating that point k is a point that satisfies the position relationship of the target shape, and the second object is determined as the third object.

[0107] S313. Traverse the next point from the point set C as point k and execute S314.

[0108] When the distance between the second object and the candidate object is inconsistent with the length of the diagonal of the square, it indicates that point k does not satisfy the target shape position relationship, a new second object is obtained for verification, and the point set C is continued to be traversed, that is, the second object is continued to be traversed, and the next second object is selected.

[0109] S314, determine whether there is a next point k; if yes, execute S307; otherwise, execute S308.

[0110] When point k exists, it indicates that point k may exist later so that point k has a square position relationship with point i and point j, and the search for points that have a square position relationship with both point i and point j can be continued.

[0111] When point k does not exist, it indicates that point k does not exist so that point k has a square position relationship with points i and j, that is, the candidate object corresponding to point i is not the probe imprint.

[0112] S315. Calculate the coordinates of the fourth point l through point i, point j and point k.

[0113] In the R-Tree, search for points within the range of a circle with point k as the center and R±r as the radius, and determine the point set formed by the searched point m as the point set D, which is equivalent to searching for alternative objects within the range of a circle with the third object as the center and the first radius and the second radius, and determining them as the fourth object.

[0114] S316. Determine whether point 1 exists; if yes, execute S317; otherwise, execute S313.

[0115] Calculate the distances between point i and point j and point m respectively, and check whether the distance between point i and point m is R±r, and whether the distance between point j and point m is 1.414R±r. When the distance between point i and point m is R±r, and the distance between point j and point m is 1.414R±r, obtain the coordinates of point l, that is, when the distance between the fourth object and the candidate object is consistent with the side length of the square, and the distance between the fourth object and the third object is consistent with the length of the diagonal of the square, determine that the first object, the third object, and the fourth object are other objects of the target shape position relationship of the candidate object.

[0116] Since the side length of the square formed by the probe imprint is roughly fixed, we randomly select one of the points and search for a point set within a certain range of side lengths in RTree. The search range is a ring centered on the point. If there is a point that meets the range, we find the third point in the ring area with the second point as the center and the same inner and outer radius. If the distance between the third point and the first point is the diagonal distance of the square, we directly calculate the position of the fourth point. If we find the point, we find the square. Otherwise, these four points are not probe imprints.

[0117] S317. Output point i, point j, point k and point l.

[0118] The candidate objects and other objects are determined as background objects, and the background objects are output.

[0119] The embodiment of the present application proposes a point set indexing algorithm, which has a linear logarithmic order complexity.

[0120] In order to solve the problem that the pole probe imprints that do not need to be detected are confused with a large number of pole dirt, and to distinguish between pole imprints and dirt defects of new energy batteries, the embodiment of the present application proposes an efficient point set indexing method. The method of traversal after area screening is used to gradually find the four pole imprints arranged in a square dot matrix; the R-Tree data structure is used to compress the insertion and indexing of the point set to logarithmic complexity, and the indexing can be accurately performed through positional relationships. When the number of point sets increases, the time complexity of the index does not increase, which is beneficial to the rapid retrieval of a large number of point sets; compared to the fourth power complexity of brute force search, the embodiment of the present application indexes the required point set within the range of linear logarithmic complexity. In addition, the embodiment of the present application has strong scalability, can be extended to other click indexing problems, and compresses the exponential complexity to linear logarithmic complexity.

[0121] It should be understood that, although the steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indications of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear description in this article, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0122] Based on the same inventive concept, the embodiment of the present application also provides a detection result processing device. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more detection result processing device embodiments provided below can refer to the limitations of the detection result processing method above, and will not be repeated here.

[0123] like Figure 4 As shown, the embodiment of the present application provides a detection result processing device, including:

[0124] A positioning module 401 is used to determine the positioning information of at least one candidate object in the object detection result of the product image;

[0125] A generating module 402, for generating tree structure data based on the location information of each candidate object and the area corresponding to the tree node;

[0126] A search module 403 is used to search for multiple background objects that satisfy the target shape position relationship in the tree structure data;

[0127] The deletion module 404 is used to remove the detection results of each background object from the target detection results.

[0128] In some embodiments, in the aspect of searching for multiple background objects satisfying the target shape position relationship in the tree structure data, the search module 403 is specifically used to:

[0129] Traverse each candidate object;

[0130] For each candidate object traversed, search the tree structure data to see whether there is another object that satisfies the target shape position relationship;

[0131] When there are other objects satisfying the target shape position relationship with the candidate objects, the candidate objects and the other objects satisfying the target shape position relationship are determined as background objects.

[0132] In some embodiments, the target shape position relationship is a vertex position relationship of a square; in terms of searching for other objects that satisfy the target shape position relationship in the tree structure data for each candidate object traversed, the search module 403 is specifically used to:

[0133] For each candidate object traversed, search the tree structure data for the first object within a circle range with the candidate object as the center and determined by the side length of the square;

[0134] When there is at least one first object, traverse each first object;

[0135] For each first object traversed, search the tree structure data for a second object within a circular range that is centered on the first object and determined by the side length of a square;

[0136] When there is at least one second object, detecting whether the distance between each second object and the candidate object is consistent with the length of the diagonal of the square;

[0137] When there is a second object with the same length, determining the second object with the same length as the third object;

[0138] Traverse each third object;

[0139] For each traversed third object, search the tree structure data for a fourth object within a circle range that is centered on the third object and is determined by the side length of a square;

[0140] When the fourth object exists, detecting whether the distance between the fourth object and the candidate object is consistent with the side length of the square, and detecting whether the distance between the fourth object and the first object is consistent with the length of the diagonal of the square;

[0141] When the distance between the fourth object and the candidate object is consistent with the side length of the square, and the distance between the fourth object and the first object is consistent with the length of the diagonal of the square, it is determined that the first object, the third object and the fourth object are other objects that meet the target shape position relationship as candidate objects.

[0142] In some embodiments, when there are other objects satisfying the target shape position relationship among the candidate objects, in terms of determining that the candidate objects and the other objects satisfying the target shape position relationship are background objects, the search module 403 is specifically used to:

[0143] When there is at least one other object that satisfies the target shape position relationship among the candidate objects, calculating the area variance between the candidate object and each other object;

[0144] When the area variance is less than a preset variance threshold, the candidate object and other objects satisfying the target shape position relationship are determined as background objects.

[0145] In some embodiments, the first object within a circular ring range determined by the side length of a square with the alternative object as the center includes an alternative object within a circular ring range determined by a first radius and a second radius with the alternative object as the center; wherein the first radius is smaller than the second radius, the first radius is the difference between the side length of the square and a preset error, and the second radius is the sum of the side length of the square and the error.

[0146] In some embodiments, in determining the location information of at least one candidate object in the object detection result of the product image, the location module 401 is specifically used to:

[0147] For at least one candidate object in the target detection result of the product image, calculating a circumscribed rectangle of the candidate object according to a region of the candidate object in the target detection result;

[0148] The coordinates of the center point of the candidate object are determined in the circumscribed rectangle of the candidate object, and the coordinates of the center point of the candidate object are determined as the positioning information of the candidate object.

[0149] In some embodiments, the product image includes a battery image with a pole imprint; and the detection result of the background object includes a pole imprint detection result.

[0150] Each module in the above detection result processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0151] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data related to the detection result processing. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps in the above-mentioned detection result processing method are implemented.

[0152] In some embodiments, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, the steps in the above-mentioned detection result processing method are implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen; the input device of the computer device can be a touch layer covering the display screen, or a key, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0153] Those skilled in the art will understand that Figure 5 or Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0154] In some embodiments, a computer device is provided. The computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the steps in the above method embodiments are implemented.

[0155] In some embodiments, Figure 7 The figure shows an internal structure diagram of a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0156] In some embodiments, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0157] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data 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.

[0158] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0159] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0160] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for processing detection results, characterized in that: include: Determine location information of at least one candidate object in the object detection result of the product image; Generate tree structure data based on the location information of each candidate object and the area corresponding to the tree node; In the tree structure data, searching for a plurality of background objects that satisfy a target shape position relationship; In the target detection results, the detection results of the background objects are eliminated.

2. The method according to claim 1, characterized in that The step of searching the tree structure data for a plurality of background objects that satisfy the target shape position relationship comprises: Traversing each of the candidate objects; For each candidate object traversed, searching the tree structure data to see whether there is another object that satisfies the target shape position relationship with the candidate object; When there are other objects satisfying the target shape position relationship among the candidate objects, the candidate objects and the other objects satisfying the target shape position relationship are determined as background objects.

3. The method according to claim 2, characterized in that The target shape position relationship is a vertex position relationship of a square; for each candidate object traversed, searching the tree structure data for other objects that satisfy the target shape position relationship, including: For each candidate object traversed, searching the tree structure data for a first object within a circular range with the candidate object as the center and determined by the side length of the square; When there is at least one of the first objects, traverse each of the first objects; For each of the traversed first objects, searching the tree structure data for a second object within a circular range that is centered on the first object and determined by the side length of the square; When there is at least one second object, detecting whether the distance between each second object and the candidate object is consistent with the length of the diagonal of the square; When there is a second object with the same length, determining the second object with the same length as the third object; Traversing each of the third objects; For each of the traversed third objects, searching the tree structure data for a fourth object within a circle range having the third object as the center and determined by the side length of the square; When there is a fourth object, detecting whether the distance between the fourth object and the candidate object is consistent with the side length of the square, and detecting whether the distance between the fourth object and the first object is consistent with the length of the diagonal of the square; When the distance between the fourth object and the candidate object is consistent with the side length of the square, and the distance between the fourth object and the first object is consistent with the length of the diagonal of the square, it is determined that the first object, the third object and the fourth object are other objects that satisfy the target shape position relationship as the candidate objects.

4. The method according to claim 2, characterized in that: When there are other objects satisfying the target shape position relationship among the candidate objects, determining the candidate objects and the other objects satisfying the target shape position relationship as background objects includes: When there is at least one other object satisfying the target shape position relationship among the candidate objects, calculating the area variance between the candidate object and each of the other objects; When the area variance is less than a preset variance threshold, the candidate object and other objects satisfying the target shape position relationship are determined to be background objects.

5. The method according to claim 3, characterized in that: The first object within the circular range determined by the side length of the square with the candidate object as the center includes the candidate objects within the circular range determined by the first radius and the second radius with the candidate object as the center; The first radius is smaller than the second radius, the first radius is the difference between the side length of the square and a preset error, and the second radius is the sum of the side length of the square and the error.

6. The method according to claim 1, characterized in that The step of determining the location information of at least one candidate object in the target detection result of the product image includes: For at least one candidate object in the target detection result of the product image, calculating a circumscribed rectangle of the candidate object according to a region of the candidate object in the target detection result; The coordinates of the center point of the candidate object are determined in the circumscribed rectangle of the candidate object, and the coordinates of the center point of the candidate object are determined as the positioning information of the candidate object.

7. The method according to claim 1, characterized in that The product image includes a battery image with a pole imprint; the detection result of the background object includes a pole imprint detection result.

8. A detection result processing device, characterized in that: include: A positioning module, used to determine positioning information of at least one candidate object in the object detection result of the product image; A generating module, used for generating tree structure data based on the positioning information of each candidate object and the area corresponding to the tree node; A search module, used to search for multiple background objects that satisfy the target shape position relationship in the tree structure data; The deletion module is used to remove the detection results of each background object from the target detection results.

9. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.