Multi-target overlapping occlusion relation judgment method and system
By extracting the edge map of overlapping regions in multi-objective overlap scenes and analyzing their pixel point distribution, the problems of high occlusion relationship judgment cost and high computing power requirements in the prior art are solved, and low-cost and high-root occlusion relationship judgment is achieved.
Patent Information
- Application Number
- CN202411980926.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-16
AI Technical Summary
The existing occlusion relationship judgment method based on deep learning is high in cost and has high computing power demand, making it difficult to achieve occlusion relationship judgment in multi-objective overlapping scenarios with low cost and high robustness.
By obtaining the detection result of the target, it is determined whether the rectangular border overlaps. If it is overlapped, the edge map of the overlapping region is extracted, and the occlusion relationship is judged based on the positional relationship of the target and the pixel point distribution of the edge map.
The occlusion relationship judgment of multi-objective overlapping scenarios under low-cost and high-rootability conditions is achieved, and the computing power requirement is reduced.
Smart Images

Figure CN120014260A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of logistics, and in particular to a method and system for determining occlusion relationships of multiple overlapping targets. Background Art
[0002] In the field of image recognition, some applications need to obtain the complete outline of the scene target, and then connect the target with the complete outline to the downstream task. For example, in metric recognition, a target with a complete outline helps to extract typical feature vectors that are comparable to the underlying library to improve the accuracy of metric recognition applications.
[0003] With the extensive research of deep learning technology, a series of deep learning-based occlusion relationship judgment methods have been proposed and achieved good results. However, this series of algorithms requires a large amount of training data and has high computing power requirements when deployed, resulting in a high cost for the entire algorithm. Summary of the invention
[0004] The main purpose of the present invention is to provide a low-cost and highly robust method for determining the occlusion relationship of a multi-target overlapping scene. A method for determining the occlusion relationship of a multi-target overlapping scene comprises the following steps: Acquire a detection result of the target, wherein the detection result includes a rectangular frame surrounding the target; Determine whether the rectangular borders of multiple targets overlap; If the rectangular frames of two objects overlap, the edges of the overlapping areas of the two objects with overlapping relationship are extracted to obtain an overlapping area edge map; The occlusion relationship between the two objects having the overlapping relationship is determined according to the positional relationship between the two objects having the overlapping relationship and the edge distribution of the pixel points in the edge map of the overlapping area.
[0005] As a preferred technical solution, the obtaining of the detection result of the target, wherein the detection result includes a rectangular frame surrounding the target, includes: Reading an image containing the target, and preprocessing the image, wherein the preprocessing steps include denoising, grayscale, binarization, and edge detection; Using an object detection algorithm to identify an object in the image, and outputting the category of the object and the coordinates of a rectangular frame surrounding the object; Post-processing the rectangular frame, wherein the post-processing includes performing non-maximum suppression to eliminate overlapping frames, or performing smoothing on the frame to improve accuracy; Draw the rectangular border obtained by post-processing on the original image.
[0006] As a preferred technical solution, the step of determining whether the rectangular frames of multiple targets overlap includes: Calculate the pairwise intersection and union ratio of the rectangular bounding boxes of all objects in the image; When the IoU ratio is greater than a preset IoU ratio threshold, it indicates that the corresponding two targets overlap.
[0007] As a preferred technical solution, the step of extracting the edges of the overlapping areas of two objects having an overlapping relationship to obtain an overlapping area edge map includes: Load the image of the overlapping area of two objects with overlapping relationship; Converting the image of the overlapping area into a grayscale image and performing smoothing processing; Apply edge detection operator to extract the edge map of overlapping area.
[0008] As a preferred technical solution, judging the occlusion relationship between the two overlapping targets according to the positional relationship between the two overlapping targets and the edge distribution of the pixel points of the edge map of the overlapping area includes: Calculate the minimum distance from the coordinate point of each pixel in the upper, lower, left, and right parts of the edge map of the overlapping area to the edge point, and get the minimum distance list , minimum distance list , minimum distance list , minimum distance list ; The width of the border of the overlapping area edge map is w, and the height is h. For the The minimum distance from a coordinate point to all edge points in the overlapping area; For the The minimum distance from a coordinate point to all edge points in the overlapping area; Calculate the minimum distance list , minimum distance list , minimum distance list , minimum distance list The average value of: Get the x-coordinate and y-coordinate of the center point of target box1 and target box2, where target box1 and target box2 are two overlapping targets; The following logic is used for calculation : If the x-coordinate of target box1 is to the left of the x-coordinate of target box2: , ;on the contrary, , ; If the y coordinate of target box1 is above the y coordinate of target box2: , ;on the contrary, , ; if , target box1 is the occluded target, and target box2 is the occluded target; if , target box1 is the occluding target, and target box2 is the occluded target.
[0009] As a preferred technical solution, the occlusion relationship judgment method further includes the step of calculating the occlusion relationship credibility: The credibility value is calculated using the following formula : if ,but: if ,but: If the credibility value If it is greater than the preset trust threshold, the occlusion relationship result is established, otherwise it is not established.
[0010] As a preferred technical solution, the occlusion relationship determination method further includes: If the credibility value If the value is less than the preset trust threshold, the following steps are performed: According to the overlapping rectangular frames of target box 1 and target box 2, the images of target box 1 and target box 2 are divided into 4 rectangular regions respectively, so as to obtain 6 non-overlapping rectangular regions and 1 overlapping rectangular region; Extract the features of 6 non-overlapping rectangular areas and 1 overlapping rectangular area to obtain image block features; Compare the features of the non-overlapping rectangular area and the overlapping rectangular area to obtain the similarity; Calculate the average similarity between the features of the three non-overlapping rectangular areas of the target box1 and the features of the overlapping rectangular area to obtain the average similarity of box1; Calculate the average similarity between the features of the three non-overlapping rectangular areas of the target box2 and the features of the overlapping rectangular area to obtain the average similarity of box2; If the average similarity of box1 is greater than the average similarity of box2, the target box1 is the occluding target and the target box2 is the occluded target; otherwise, the target box2 is the occluding target and the target box1 is the occluded target.
[0011] A second aspect of the present invention provides a device for determining an occlusion relationship of multiple overlapping targets, comprising: An acquisition unit, the acquisition unit is used to acquire a detection result of the target, the detection result including a rectangular frame surrounding the target; An overlap judgment unit, the overlap judgment unit is used to judge whether the rectangular frames of multiple targets overlap; An edge extraction unit, if there is an overlap of the rectangular frames of two objects, the edge extraction unit extracts the edge of the overlapping area of the two objects having the overlapping relationship to obtain an overlapping area edge map; The occlusion judgment unit judges the occlusion relationship between the two overlapping objects according to the position relationship between the two overlapping objects and the edge distribution of the pixel points in the overlapping area edge map.
[0012] The third aspect of the present invention provides an electronic device, comprising: a memory and at least one processor, wherein instructions are stored in the memory, and the memory and the at least one processor are interconnected via lines; the at least one processor calls the instructions in the memory so that the electronic device executes the above-mentioned method for determining the occlusion relationship of multiple overlapping targets.
[0013] A fourth aspect of the present invention provides a computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes the above-mentioned method for determining the occlusion relationship of multiple overlapping targets.
[0014] The present invention has the following beneficial effects: This patent is based on the positional relationship between two overlapping targets and the edge distribution of pixel points in the edge map of the overlapping area. The occlusion relationship judgment method for multi-target overlapping scenes provided by the invention has low cost and high robustness. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A flowchart of a method for determining occlusion relationships of multiple overlapping targets provided by an embodiment of the present invention; Figure 2 is an original photo of the image to be detected in the embodiment of the present invention; Figure 3 is an original photo with a rectangular frame surrounding the object in an embodiment of the present invention; Figure 4 is an image after edge extraction in an embodiment of the present invention, wherein the image includes two targets having an occlusion relationship; Figure 5 is a segmented image in an embodiment of the present invention, wherein the image includes two targets having an occlusion relationship; Figure 6 A schematic diagram of an occlusion relationship determination device for multiple overlapping targets provided by an embodiment of the present invention; Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0016] The embodiment of the present invention provides a method and system for determining the occlusion relationship of multiple overlapping targets. The method includes: obtaining the detection result of the target, the detection result includes a rectangular frame surrounding the target; determining whether the rectangular frames of multiple targets overlap; if the rectangular frames of two targets overlap, extracting the edge of the overlapping area of the two targets with overlapping relationship to obtain an overlapping area edge map; determining the occlusion relationship of the two targets with overlapping relationship according to the positional relationship of the two targets with overlapping relationship and the edge distribution of the pixel points of the overlapping area edge map. This patent proposes a low-cost, high-robust method for determining the occlusion relationship of multiple overlapping target scenes.
[0017] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0018] Intersection over Union (IoU) Intersection over Union (IoU) is the most commonly used evaluation metric in tasks such as object detection, semantic segmentation, and tracking. It is used to measure the degree of overlap between the predicted bounding box and the real bounding box. IoU calculates the ratio of the intersection and union of two bounding boxes. The formula is IoU(A,B)=|A∩B| / |A∪B|, where |A∩B| represents the size of the intersection of sets A and B, and |A∪B| represents the size of the union of sets A and B. When the two bounding boxes overlap completely, the IoU value is 1, indicating that the prediction result is very accurate; when the two bounding boxes do not overlap at all, the IoU value is 0, indicating that the prediction result is very inaccurate.
[0019] In object detection tasks, IoU is usually used to determine whether the predicted box is correct. If the IoU value between the predicted box and the true box is greater than a certain threshold (such as 0.5), the predicted box is considered correct. In addition to object detection, IoU can also be used for tasks such as image segmentation, feature selection, and model optimization.
[0020] In order to improve the accuracy of target detection, some optimization methods can be used, such as matching algorithms and loss functions. Matching algorithms such as the Hungarian algorithm and the Kuhn-Munkres algorithm can be used to match the target box with the real box. Loss functions such as the cross entropy loss function and the mean absolute error loss function can be used to optimize the model.
[0021] Edge Detection Operator Edge detection operators are algorithms or filters used to detect edges in an image. Edges are places in an image where there are dramatic changes in pixel intensity or color. These changes usually correspond to the boundaries of objects, scenes, or regions in the image. Edge detection operators identify edges by calculating the gradient or derivative of each pixel in the image.
[0022] Edge detection operators can be divided into two categories: edge detection operators based on first-order derivatives and edge detection operators based on second-order derivatives.
[0023] First-order derivative-based edge detection operators: This type of operator mainly uses the first-order derivatives of the image (such as gradients) to detect edges. Common first-order derivative edge detection operators include the Sobel operator, Prewitt operator, Roberts operator, and Canny operator. These operators usually use convolution kernels to filter the image to calculate the gradient strength and direction of each pixel. Then, by setting an appropriate threshold, the pixels with a gradient strength greater than the threshold are marked as edge points.
[0024] Second-order derivative-based edge detection operators: This type of operator mainly uses the second-order derivative of the image (such as the Laplace operator) to detect edges. Second-order derivative edge detection operators usually perform second-order differentiation on the image and then find the zero-crossing point of the second-order differential as the edge point. Common second-order derivative edge detection operators include the Laplacian operator and the Scharr filter. Since the second-order derivative is very sensitive to noise, it is usually necessary to smooth the image first when using this type of operator for edge detection.
[0025] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 The first embodiment of the method for determining the occlusion relationship of multiple overlapping targets in the embodiment of the present invention includes: 101. Obtain a detection result of the target, where the detection result includes a rectangular frame surrounding the target; This step is to obtain the detection results of the target from an object detection algorithm or system. The detection results are usually presented in the form of rectangular bounding boxes that surround the detected targets.
[0026] Specifically, it includes: Read an image containing the target (as an example, Figure 2 ), preprocessing the image, the preprocessing steps including denoising, graying, binarization, and edge detection; using a target detection algorithm to identify the target in the image, outputting the target category and the coordinates of the rectangular frame surrounding the target; post-processing the rectangular frame, the post-processing including non-maximum suppression to eliminate overlapping frames, or smoothing the frame to improve accuracy; drawing the rectangular frame obtained by post-processing on the original image (such as Figure 3 ).
[0027] Reading the image: First, you need to read the image file containing the target.
[0028] Preprocessing: In order to improve the accuracy and robustness of subsequent object detection algorithms, images usually need to be preprocessed. Preprocessing steps may include: Denoising: Reduce the noise in the image, for example using Gaussian filtering, median filtering, etc.
[0029] Grayscale: Convert a color image to a grayscale image to reduce the amount of calculation and simplify processing.
[0030] Binarization: Convert a grayscale image into a binary image to make the target and background clearer.
[0031] Edge detection: Use algorithms such as Canny edge detection to detect edges in the image to help with subsequent object detection.
[0032] Object detection algorithm: Apply object detection algorithms such as Faster R-CNN, YOLO, SSD, etc. on the preprocessed images.
[0033] Output target category: After the algorithm identifies the target, it will output the category information of each target.
[0034] Coordinates of bounding rectangles surrounding the object: The algorithm also outputs the coordinates of one or more bounding rectangles surrounding each detected object.
[0035] The post-processing step is used to optimize the detected rectangular bounding boxes and improve the accuracy of detection.
[0036] Non-Maximum Suppression (NMS): If multiple bounding boxes overlap and detect the same object, NMS eliminates those bounding boxes that overlap with the highest confidence bounding box by more than a certain threshold.
[0037] Smoothing: To improve the accuracy of the border, the coordinates of the border can be smoothed, for example, using techniques such as Bounding Box Regression.
[0038] The final step is to draw the post-processed bounding rectangles back onto the original image in order to visualize the detection results. This typically involves drawing rectangular boxes on the original image, and possibly marking different object categories with different colors or labels.
[0039] 102. Determine whether the rectangular borders of multiple targets overlap; Calculate the image (such as Figure 3 ) The intersection-and-union ratio of the rectangular frames of all targets is calculated; when the intersection-and-union ratio is greater than a preset intersection-and-union ratio threshold, it indicates that the corresponding two targets overlap.
[0040] For example, specifically: Calculate the intersection area: For any two rectangular boxes A and B, first find the coordinates of their intersection. The intersection is the area covered by the two rectangular boxes.
[0041] Calculate the area of the intersection and record it as Intersection.
[0042] Compute the area of the union: Calculate the area of rectangular box A, recorded as Area_A.
[0043] Calculate the area of rectangular box B, recorded as Area_B.
[0044] Calculate the total area of the two rectangular boxes (that is, the union area), which is Area_A + Area_B - Intersection.
[0045] Calculate the intersection-over-union ratio: The calculation formula for intersection over union (IoU) is: IoU = (Intersection) / (Area_A + Area_B -Intersection).
[0046] Determine overlap: Set an IoU threshold (e.g., 0.5).
[0047] If the calculated IoU value is greater than this threshold, it is considered that the two corresponding targets overlap.
[0048] 103. If the rectangular frames of two objects overlap, extract the edges of the overlapping areas of the two objects having the overlapping relationship to obtain an overlapping area edge map; Loading the image of the overlapping area of two objects having an overlapping relationship; converting the image of the overlapping area into a grayscale image and performing smoothing; applying an edge detection operator, such as Figure 4 , extract the edge map of the overlapping area.
[0049] Specifically: It is necessary to extract the overlapping part of the two targets from the original image. This usually involves cropping the part of the image corresponding to the rectangular frame surrounding the overlapping area of the two targets. Make sure that the extracted image area only contains the overlapping part of the two targets so that you can focus on analyzing this specific area. Convert the image of the overlapping area to a grayscale image and smooth it: Convert the extracted overlapping area image to a grayscale image because the grayscale image can simplify the processing process and reduce the amount of calculation. Smooth the grayscale image to reduce noise and details and highlight the edge information. Common smoothing methods include Gaussian filtering, median filtering, etc. Smoothing can help reduce random noise in the image and improve the effect of edge detection.
[0050] Apply edge detection operators such as Canny edge detection, Sobel edge detection, or Laplacian edge detection to the smoothed grayscale image. These operators detect edges in the image, that is, areas where the grayscale value changes dramatically. They identify edges by calculating the image gradient or second-order derivative. After applying the edge detection operator, a binary edge image is obtained, which only contains edge information in the overlapping areas.
[0051] 104. Determine an occlusion relationship between the two objects having an overlapping relationship according to a positional relationship between the two objects having an overlapping relationship and edge distribution of pixel points in the overlapping region edge map.
[0052] Since the obtained overlapping area edge map must have a large number of pixels near the overlapping position of the two targets, while there are fewer pixels in other positions, the position relationship of the two overlapping targets and the edge distribution of the pixel points of the overlapping area edge map are used to see Figure 4 , the occlusion relationship between two overlapping targets can be determined.
[0053] As a preferred implementation, judging the occlusion relationship between the two overlapping targets according to the positional relationship between the two overlapping targets and the edge distribution of the pixel points of the edge map of the overlapping area includes: Calculate the minimum distance from the coordinate point of each pixel in the upper, lower, left, and right parts of the edge map of the overlapping area to the edge point, and get the minimum distance list , minimum distance list , minimum distance list , minimum distance list ; The width of the border of the overlapping area edge map is w, and the height is h. For the The minimum distance from a coordinate point to all edge points in the overlapping area; For the The minimum distance from a coordinate point to all edge points in the overlapping area; Calculate the minimum distance list , minimum distance list , minimum distance list , minimum distance list The average value of: Get the x-coordinate and y-coordinate of the center point of target box1 and target box2, where target box1 and target box2 are two overlapping targets; The following logic is used for calculation : If the x-coordinate of target box1 is to the left of the x-coordinate of target box2: , ;on the contrary, , ; If the y coordinate of target box1 is above the y coordinate of target box2: , ;on the contrary, , ; if , target box1 is the occluded target, and target box2 is the occluded target; if , target box1 is the occluding target, and target box2 is the occluded target.
[0054] As a preferred technical solution, in order to solve the problem that there are a large number of pixels in the middle part of the edge map of the overlapping area, the above calculation method causes The values are too close, so we can also judge the credibility of the occlusion relationship to solve the problem of misjudgment. The specific steps are as follows: The credibility value is calculated using the following formula : if ,but: if ,but: If the credibility value If it is greater than the preset trust threshold, the occlusion relationship result is established, otherwise it is not established.
[0055] As a preferred technical solution, if it is not possible To determine the position relationship, the occlusion relationship determination method of the present invention further includes: If the credibility value If the value is less than the preset trust threshold, the following steps are performed: According to the overlapping rectangular borders of target box1 and target box2, the images of target box1 and target box2 are divided into 4 rectangular regions respectively, and 6 non-overlapping rectangular regions are obtained (see Figure 5 1-3, 4-6) and an overlapping rectangular area (see Figure 5 (marked in 7); Extract the features of 6 non-overlapping rectangular areas and 1 overlapping rectangular area to obtain image block features; The image feature extraction method may be a traditional image feature extraction algorithm, such as various hash features, color features, texture features, etc.; it may also be features extracted by deep learning models such as convolutional neural networks and transformer architectures.
[0056] Compare the features of the non-overlapping rectangular area and the overlapping rectangular area to obtain the similarity; Calculate the average similarity between the features of the three non-overlapping rectangular areas of the target box1 and the features of the overlapping rectangular area to obtain the average similarity of box1; Calculate the average similarity between the features of the three non-overlapping rectangular areas of the target box2 and the features of the overlapping rectangular area to obtain the average similarity of box2; If the average similarity of box1 is greater than the average similarity of box2, then the target box1 is the occluding target and the target box2 is the occluded target; otherwise, the target box2 is the occluding target and the target box1 is the occluded target.
[0057] If the average similarity between features numbered 1, 2, and 3 and feature numbered 7 is greater than the average similarity between features numbered 4, 5, and 6 and feature numbered 7, the target in the upper left corner is the occluded target and the target in the lower right corner is the occluded target; otherwise, the target in the upper left corner is the occluded target and the target in the lower right corner is the occluded target.
[0058] The above describes the method for determining the occlusion relationship of multiple overlapping targets in the embodiment of the present invention. The following describes the device for determining the occlusion relationship of multiple overlapping targets in the embodiment of the present invention. Figure 6 The first embodiment of the device for determining the occlusion relationship of multiple overlapping targets in the embodiment of the present invention includes: An acquisition unit, the acquisition unit is used to acquire a detection result of the target, the detection result including a rectangular frame surrounding the target; An overlap judgment unit, the overlap judgment unit is used to judge whether the rectangular frames of multiple targets overlap; An edge extraction unit, if there is an overlap of the rectangular frames of two objects, the edge extraction unit extracts the edge of the overlapping area of the two objects having the overlapping relationship to obtain an overlapping area edge map; The occlusion judgment unit judges the occlusion relationship between the two overlapping objects according to the position relationship between the two overlapping objects and the edge distribution of the pixel points in the overlapping area edge map.
[0059] Figure 77 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. The electronic device 700 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 710 (for example, one or more processors) and a memory 720, and one or more storage media 730 (for example, one or more mass storage devices) storing application programs 733 or data 732. Among them, the memory 720 and the storage medium 730 can be temporary storage or permanent storage. The program stored in the storage medium 730 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the electronic device 700. Furthermore, the processor 710 may be configured to communicate with the storage medium 730 to execute a series of instruction operations in the storage medium 730 on the electronic device 700.
[0060] The electronic device 700 may also include one or more power supplies 740, one or more wired or wireless network interfaces 750, one or more input and output interfaces 750, and / or one or more operating systems 731, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc. It will be appreciated by those skilled in the art that Figure 7 The structure of the electronic device shown does not constitute a limitation on the electronic device, and may include more or less components than shown in the figure, or combine some components, or arrange the components differently.
[0061] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of a method for determining occlusion relationships of multiple overlapping targets.
[0062] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device, or unit can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0063] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention 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 software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0064] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for determining occlusion relationships of multiple overlapping targets, characterized in that: The occlusion relationship determination method comprises the following steps: Acquire a detection result of the target, wherein the detection result includes a rectangular frame surrounding the target; Determine whether the rectangular borders of multiple targets overlap; If the rectangular frames of two objects overlap, the edges of the overlapping areas of the two objects with overlapping relationship are extracted to obtain an overlapping area edge map; The occlusion relationship between the two objects having the overlapping relationship is determined according to the positional relationship between the two objects having the overlapping relationship and the edge distribution of the pixel points in the edge map of the overlapping area.
2. The method for determining occlusion relationships of multiple overlapping targets according to claim 1, characterized in that: The acquiring of the detection result of the target, wherein the detection result includes a rectangular frame surrounding the target, includes: Reading an image containing the target, and preprocessing the image, wherein the preprocessing steps include denoising, grayscale, binarization, and edge detection; Using an object detection algorithm to identify an object in the image, and outputting the category of the object and the coordinates of a rectangular frame surrounding the object; Post-processing the rectangular frame, wherein the post-processing includes performing non-maximum suppression to eliminate overlapping frames, or performing smoothing on the frame to improve accuracy; Draw the rectangular border obtained by post-processing on the original image.
3. The method for determining occlusion relationships of multiple overlapping targets according to claim 1, characterized in that: The determining whether the rectangular frames of the multiple targets overlap includes: Calculate the pairwise intersection and union ratio of the rectangular bounding boxes of all objects in the image; When the IoU ratio is greater than a preset IoU ratio threshold, it indicates that the corresponding two targets overlap.
4. The method for determining occlusion relationships of multiple overlapping targets according to claim 1, characterized in that: The step of extracting the edges of the overlapping areas of two objects having an overlapping relationship to obtain an overlapping area edge map includes: Load the image of the overlapping area of two objects with overlapping relationship; Converting the image of the overlapping area into a grayscale image and performing smoothing processing; Apply edge detection operator to extract the edge map of overlapping area.
5. The method for determining occlusion relationships of multiple overlapping targets according to claim 1, characterized in that: The determining the occlusion relationship between the two overlapping objects according to the distribution of the pixel points of the edge map of the overlapping area includes: Calculate the minimum distance from the coordinate point of each pixel in the upper, lower, left, and right parts of the edge map of the overlapping area to the edge point, and get the minimum distance list , minimum distance list , minimum distance list , minimum distance list ; The width of the border of the overlapping area edge map is w, and the height is h. For the The minimum distance from a coordinate point to all edge points in the overlapping area; For the The minimum distance from a coordinate point to all edge points in the overlapping area; Calculate the minimum distance list , minimum distance list , minimum distance list , minimum distance list The average value of: Get the x-coordinate and y-coordinate of the center point of target box1 and target box2, where target box1 and target box2 are two overlapping targets; The following logic is used for calculation : If the x-coordinate of target box1 is to the left of the x-coordinate of target box2: , ;on the contrary, , ; If the y coordinate of target box1 is above the y coordinate of target box2: , ;on the contrary, , ; if , target box1 is the occluded target, and target box2 is the occluded target; if , target box1 is the occluding target, and target box2 is the occluded target.
6. The method for determining occlusion relationships of multiple overlapping targets according to claim 5, characterized in that: The occlusion relationship judgment method further includes the step of calculating the occlusion relationship credibility: The credibility value is calculated using the following formula : if ,but: if ,but: If the credibility value If it is greater than the preset trust threshold, the occlusion relationship result is established, otherwise it is not established.
7. The method for determining occlusion relationships of multiple overlapping targets according to claim 6, characterized in that: The occlusion relationship determination method further includes: If the credibility value If the value is less than the preset trust threshold, the following steps are performed: According to the overlapping rectangular frames of target box 1 and target box 2, the images of target box 1 and target box 2 are divided into 4 rectangular regions respectively, so as to obtain 6 non-overlapping rectangular regions and 1 overlapping rectangular region; Extract the features of 6 non-overlapping rectangular areas and 1 overlapping rectangular area to obtain image block features; Compare the features of the non-overlapping rectangular area and the overlapping rectangular area to obtain the similarity; Calculate the average similarity between the features of the three non-overlapping rectangular areas of the target box1 and the features of the overlapping rectangular area to obtain the average similarity of box1; Calculate the average similarity between the features of the three non-overlapping rectangular areas of the target box2 and the features of the overlapping rectangular area to obtain the average similarity of box2; If the average similarity of box1 is greater than the average similarity of box2, then the target box1 is the occluding target and the target box2 is the occluded target; otherwise, the target box2 is the occluding target and the target box1 is the occluded target.
8. A multi-target overlapping occlusion relationship judgment system, characterized in that: The computer bypass monitoring system comprises: An acquisition unit, the acquisition unit is used to acquire a detection result of the target, the detection result including a rectangular frame surrounding the target; An overlap judgment unit, the overlap judgment unit is used to judge whether the rectangular frames of multiple targets overlap; An edge extraction unit, if there is an overlap of the rectangular frames of two objects, the edge extraction unit extracts the edge of the overlapping area of the two objects having the overlapping relationship to obtain an overlapping area edge map; The occlusion judgment unit judges the occlusion relationship between the two overlapping objects according to the position relationship between the two overlapping objects and the edge distribution of the pixel points in the overlapping area edge map.
9. An electronic device, comprising a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instructions in the memory so that the electronic device executes each step of the method for determining the occlusion relationship of multiple overlapping targets as described in any one of claims 1-7.
10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instruction is executed by the processor, each step of the method for determining the occlusion relationship of multiple overlapping targets as described in any one of claims 1 to 7 is implemented.