Target aggregation detection method and computer readable storage medium
By identifying and merging the historical list of detection frames, the problem of rapid positioning and evaluation of multi-region target aggregations is solved, the rapid detection and evaluation of multi-region target aggregations is achieved, and the analysis efficiency and accuracy in emergency situations are improved.
Patent Information
- Application Number
- CN202111134835.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-27
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-09-27
AI Technical Summary
Existing technology is difficult to quickly locate and assess the gathering of people in multiple areas, especially in emergencies and cannot effectively detect and analyze it.
By identifying pictures containing the target to be tested, a historical list of detection frames is established, and overlapping detection frames are merged when traversing the detection frame collection to form a merged detection frame, and the detection frame collection is updated until the detection frame cannot be merged anymore. are non-overlapping areas, thereby achieving rapid detection of target aggregation in multiple areas.
It achieves rapid detection and evaluation of multi-region target aggregation, improves detection efficiency and accuracy, facilitates rapid location and evaluation of abnormal behaviors, and provides convenience in the post-event evidence collection stage.
Smart Images

Figure CN113887372B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a target aggregation detection method and a computer-readable storage medium. Background Art
[0002] In recent years, with the promotion of security systems, more and more video terminals have entered places such as life and production. However, most video terminals tend to be used for traditional recording purposes, for verification or post-analysis. If these video resources can be better utilized, video content can be analyzed in real time, and a rapid warning of abnormal behavior can be made, then danger can be effectively and timely prevented.
[0003] At present, the crowd density in public places can be combined with computer vision technology to implement alarms for density exceeding the threshold, so as to achieve the purpose of crowd control, peak traffic diversion and stampede prevention. However, this method generally corresponds to the entire monitoring range of a camera. When the monitoring range of a single camera is wide, it is more difficult to handle and analyze emergency situations. At the same time, when collecting evidence afterwards, it is also necessary to manually observe every detail of the monitoring range.
[0004] Therefore, a further intelligent recommendation algorithm is needed to quickly locate the location of the aggregation behavior and evaluate the severity of the aggregation behavior within the monitoring range of a single camera when abnormal target behavior occurs.
[0005] Although there are many crowd gathering detection methods, they are not able to perform well for crowd gathering scenarios in multiple areas and those that require rapid positioning and evaluation, or the detection speed is not suitable for more urgent situations. Therefore, how to quickly locate and evaluate crowd gatherings in multiple areas has become a problem to be solved. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide a target aggregation detection method and a computer-readable storage medium, which can quickly detect target aggregation in multiple areas at the same time.
[0007] In order to solve the above technical problems, the technical solution adopted by the present invention is: a target aggregation detection method, comprising:
[0008] Identify the image containing the target to be detected and obtain the detection frame of each target to be detected;
[0009] Establish a history list corresponding to each detection frame, and add each detection frame to its corresponding history list;
[0010] Add the detection frame of each target to be detected to the detection frame set;
[0011] Traversing the detection frame set, and obtaining a detection frame from the detection frame set in turn as the current detection frame;
[0012] Expanding the boundary of the current detection frame, and obtaining a detection frame that overlaps with the current detection frame after the boundary is expanded, to obtain an overlapping frame;
[0013] Obtaining the circumscribed rectangle of the current detection frame and the overlapping frame to obtain a merged detection frame, and merging the history list of the current detection frame and the overlapping frame to obtain a history list of the merged detection frame;
[0014] Deleting the current detection frame and the overlapping frame from the detection frame set, and adding the merged detection frame to the detection frame set;
[0015] After traversing the detection frame set, the target gathering area and the number of targets are obtained according to each detection frame in the detection frame set and its corresponding history list.
[0016] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the method described above are implemented.
[0017] The beneficial effects of the present invention are as follows: by adding all the recognized detection frames to the detection frame set, in the process of traversing the detection frame set, the overlapping or adjacent detection frames are merged, and the detection frame set is updated accordingly. After traversing the detection frame set, the remaining detection frames are detection frames that can no longer be merged, that is, detection frames that do not overlap each other and have a certain distance, that is, different areas where objects are clustered in the picture, thereby realizing simultaneous detection of multi-area object clusters; by merging the history list of the merged detection frames, it is ensured that only the initially recognized detection frames exist in the history list, and the merged detection frames are not included, so that the number of sub-items in the history list is the number of objects contained in the detection frame, which is conducive to the subsequent rapid acquisition of the number of objects existing in the clustered area. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A flow chart of a target aggregation detection method of the present invention;
[0019] Figure 2 This is a flow chart of a method according to Embodiment 1 of the present invention;
[0020] Figure 3 Schematic diagram of a detection frame according to Embodiment 1 of the present invention;
[0021] Figure 4 This is a schematic diagram of the aggregation detection results of Example 1 of the present invention. DETAILED DESCRIPTION
[0022] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is a detailed description in conjunction with the implementation methods and the accompanying drawings.
[0023] See also Figure 1 , a target aggregation detection method, comprising:
[0024] Identify the image containing the target to be detected and obtain the detection frame of each target to be detected;
[0025] Establish a history list corresponding to each detection frame, and add each detection frame to its corresponding history list;
[0026] Add the detection frame of each target to be detected to the detection frame set;
[0027] Traversing the detection frame set, and obtaining a detection frame from the detection frame set in turn as the current detection frame;
[0028] Expanding the boundary of the current detection frame, and obtaining a detection frame that overlaps with the current detection frame after the boundary is expanded, to obtain an overlapping frame;
[0029] Obtaining the circumscribed rectangle of the current detection frame and the overlapping frame to obtain a merged detection frame, and merging the history list of the current detection frame and the overlapping frame to obtain a history list of the merged detection frame;
[0030] Deleting the current detection frame and the overlapping frame from the detection frame set, and adding the merged detection frame to the detection frame set;
[0031] After traversing the detection frame set, the target gathering area and the number of targets are obtained according to each detection frame in the detection frame set and its corresponding history list.
[0032] From the above description, it can be seen that the beneficial effects of the present invention are that: target aggregation in multiple areas can be quickly detected simultaneously, and the number of targets in each target aggregation area can be quickly obtained.
[0033] Furthermore, the image containing the target to be detected is identified to obtain the detection frame of each target to be detected:
[0034] Identify the images containing the target to be tested, and obtain the detection frame and classification confidence of each target to be tested;
[0035] The detection frame is filtered according to a preset confidence threshold.
[0036] From the above description, it can be seen that by filtering the detection frame, the efficiency and accuracy of subsequent target cluster detection can be improved.
[0037] Furthermore, the boundary of the current detection frame is expanded as follows:
[0038] The boundaries of the current detection frame are expanded outward according to the preset expansion boundary value.
[0039] From the above description, we can see that the fixed value expansion boundary is suitable for scenes with similar aspect ratios between target classes and low depth of field.
[0040] Furthermore, the boundary of the current detection frame is expanded as follows:
[0041] Obtain a detection frame with the smallest area or the median area in the history list corresponding to the current detection frame, and obtain the width and height of the detection frame with the smallest area or the median area;
[0042] Calculate the expanded width value and the expanded height value according to the acquired width and height and the preset ratio;
[0043] According to the expanded width value and the expanded height value, the width boundary and the height boundary of the current detection frame are expanded outwards respectively.
[0044] From the above description, it can be seen that the adaptive expansion boundary is suitable for scenes where the aspect ratio of the target class and the sizes of the near and far scenes are different.
[0045] Furthermore, the detection frame overlapping with the current detection frame after the boundary expansion is obtained to obtain the overlapping frame specifically as follows:
[0046] According to a preset non-overlapping condition, a detection frame that does not overlap with the current detection frame after the boundary is expanded is obtained from the detection frame set, wherein the non-overlapping condition includes that the x value of the coordinates of the upper left corner vertex is greater than or equal to the x value of the coordinates of the lower right corner vertex of the current detection frame after the boundary is expanded, the y value of the coordinates of the upper left corner vertex is greater than or equal to the y value of the coordinates of the lower right corner vertex of the current detection frame after the boundary is expanded, the x value of the coordinates of the lower right corner vertex is less than or equal to the x value of the coordinates of the upper left corner vertex of the current detection frame after the boundary is expanded, and the y value of the coordinates of the lower right corner vertex is less than or equal to the y value of the coordinates of the upper left corner vertex of the current detection frame after the boundary is expanded;
[0047] Detection frames other than the current detection frame and the detection frame that does not overlap with the current detection frame after the boundary expansion are obtained from the detection frame set to obtain an overlapping frame corresponding to the current detection frame.
[0048] From the above description, it can be seen that the detection frame overlapping with the current detection frame after the boundary is expanded is obtained by the non-overlapping filtering method.
[0049] Furthermore, the obtaining of the bounding rectangle of the current detection frame and the overlapping frame to obtain the merged detection frame, and merging the history list of the current detection frame and the overlapping frame to obtain the history list of the merged detection frame further includes:
[0050] According to the overlap degree between the current detection frame and each overlapping frame, the overlapping frames are filtered to obtain the detection frame to be merged.
[0051] Furthermore, filtering the overlapping frames according to the overlap degree between the current detection frame and each overlapping frame is specifically as follows:
[0052] Calculating the area of the union of the current detection frame and the overlapping frame according to the area of the current detection frame, the area of an overlapping frame, and the area of the intersection of the current detection frame and the overlapping frame to obtain a first area;
[0053] Calculating the area of the circumscribed rectangle of the current detection frame and the overlapping frame to obtain a second area;
[0054] Dividing the first area by the second area to obtain an overlap score between the current detection frame and the overlapping frame;
[0055] If the overlap score is greater than or equal to a preset score threshold, the overlapping frame is used as a detection frame to be merged, otherwise the overlapping frame is filtered.
[0056] From the above description, it can be seen that by filtering the overlapping frames, it is prevented that after the current detection frame is merged with some overlapping frames, the intersection of the merged frame and the frame before the merge is too small, resulting in most areas being sparse and not meeting the concept of aggregation.
[0057] Further, the obtaining of the circumscribed rectangle of the current detection frame and the overlapping frame to obtain a merged detection frame, and merging the history list of the current detection frame and the overlapping frame to obtain the history list of the merged detection frame; and deleting the current detection frame and the overlapping frame from the detection frame set and adding the merged detection frame to the detection frame set specifically comprises:
[0058] Obtaining the circumscribed rectangle of the current detection frame and the detection frame to be merged to obtain a merged detection frame, and merging the history list of the current detection frame and the detection frame to be merged to obtain a history list of the merged detection frame;
[0059] The current detection frame and the detection frame to be merged are deleted from the detection frame set, and the merged detection frame is added to the detection frame set.
[0060] From the above description, it can be seen that the current detection frame is merged with the filtered overlapping frame to prevent most of the area in the merged detection frame from being sparse.
[0061] Furthermore, the target gathering area and the number of targets are obtained according to each detection frame in the detection frame set and its corresponding history list as follows:
[0062] Obtaining target gathering areas according to each detection frame in the detection frame set;
[0063] The number of targets in each target aggregation area is determined according to the number of detection frames in the history list corresponding to each detection frame.
[0064] From the above description, it can be seen that since the history list always contains the detection frames that were initially recognized, the number of detection frames in the history list can be directly used as the number of targets in the target aggregation area.
[0065] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the method described above are implemented.
[0066] Embodiment 1
[0067] Please refer to Figure 2-4 , Embodiment 1 of the present invention is: a target gathering detection method, which can be applied to scenes such as crowd gathering detection and vehicle gathering detection. This embodiment is described by taking crowd gathering detection as an example.
[0068] like Figure 2 As shown, the following steps are included:
[0069] S1: Identify the image containing the target to be detected and obtain the detection frame of each target to be detected.
[0070] Specifically, the detection frame of the target to be detected can be obtained by using traditional image recognition methods or by using a neural network model for recognition, such as Figure 3 shown.
[0071] Furthermore, in addition to identifying the detection frame, the category and classification confidence of the target to be detected can also be obtained, and the detection frames whose classification confidence is less than a preset confidence threshold are filtered out, and then the detection frames of the same category are merged subsequently.
[0072] S2: Establish a history list corresponding to each detection frame one by one, and add each detection frame to its corresponding history list; further, initialize a count value for each detection frame to indicate the number of detection frames in the history list corresponding to each detection frame, and the initial value of the count value is 1.
[0073] S3: adding the detection frame of each target to be detected to the detection frame set; that is, adding the filtered detection frame to the detection frame set.
[0074] S4: traverse the detection frame set, and obtain a detection frame from the detection frame set in turn as the current detection frame.
[0075] S5: Expanding the boundary of the current detection frame; that is, increasing the perception domain of the current detection frame.
[0076] There are two main implementation methods for this step. One is to expand the boundary with a fixed value, which is suitable for scenes with similar aspect ratios between target classes and low depth of field. The other is to adaptively expand the boundary based on the history list of the current detection frame, which is suitable for scenes with different aspect ratios of target classes and different sizes of near and far scenes.
[0077] For the fixed value expansion boundary, specifically, according to the preset expansion boundary value, each boundary of the current detection frame is expanded outward, that is, the four edges of the current detection frame are expanded outward by the preset expansion boundary value, so that its sensing range is slightly larger than itself. For example, assuming that the width and height of the current detection frame are w and h respectively, and the preset expansion boundary value is a, the width and height of the detection frame after the expansion boundary are w+2a and h+2a respectively.
[0078] For adaptive expansion boundaries, specifically, first, when the target is relatively dense, the detection frame with the smallest area in the history list corresponding to the current detection frame is obtained, and the width and height of the detection frame with the smallest area are obtained; when the target is not very dense, the detection frame with the median area in the history list corresponding to the current detection frame is obtained, and the width and height of the median detection frame are obtained.
[0079] Then, the expanded width value and the expanded height value are calculated according to the obtained width and height and the preset ratio; for example, the obtained width and height are w' and h' respectively, and the preset ratio is scaler (preferably 0.5), then the expanded width value and the expanded height value are w'×scaler and h'×scaler respectively.
[0080] Finally, the width boundary and height boundary of the current detection frame are expanded outwards according to the expanded width value and the expanded height value. For example, assuming that the width and height of the current detection frame are w and h respectively, the width and height of the detection frame after the expanded boundary are w+2(w'×scaler) and h+2(h'×scaler) respectively.
[0081] S6: Obtain a detection frame that overlaps with the current detection frame after the boundary is expanded, and obtain an overlapping frame corresponding to the current detection frame.
[0082] In this embodiment, this step adopts a non-overlapping filtering method to obtain overlapping frames. Specifically, according to a preset non-overlapping condition, a detection frame that does not overlap with the current detection frame after the boundary is expanded is obtained from the detection frame set, and the non-overlapping condition includes that the x value of the upper left corner vertex coordinate is greater than or equal to the x value of the lower right corner vertex coordinate of the current detection frame after the boundary is expanded, the y value of the upper left corner vertex coordinate is greater than or equal to the y value of the lower right corner vertex coordinate of the current detection frame after the boundary is expanded, the x value of the lower right corner vertex coordinate is less than or equal to the x value of the upper left corner vertex coordinate of the current detection frame after the boundary is expanded, and the y value of the lower right corner vertex coordinate is less than or equal to the y value of the upper left corner vertex coordinate of the current detection frame after the boundary is expanded; wherein, the upper left corner of the image is taken as the coordinate origin, the right direction is the positive direction of the X axis, and the downward direction is the positive direction of the Y axis.
[0083] That is, if another detection frame satisfies any of the above non-overlapping conditions, it is considered that the detection frame does not overlap with the current detection frame after the boundary is expanded.
[0084] Then, the detection frames other than the current detection frame and the detection frames that do not overlap with the current detection frame after the boundary expansion are obtained from the detection frame set to obtain the overlapping frames corresponding to the current detection frame. That is, after removing the current detection frame and the non-overlapping detection frame, the remaining detection frame is the detection frame that overlaps with the current detection frame after the boundary expansion.
[0085] S7: filtering the overlapping frames according to the overlap degree between the current detection frame and each overlapping frame, to obtain the detection frame to be merged corresponding to the current detection frame.
[0086] This step is to perform anti-sparse merge filtering. Specifically, for each overlapping frame, the following steps are performed with the current detection frame:
[0087] S701: Calculate the area of the union of the current detection frame and the overlapping frame according to the area of the current detection frame, the area of an overlapping frame, and the area of the intersection of the current detection frame and the overlapping frame to obtain a first area. For example, assuming that the area of the current detection frame is A1, the area of the overlapping frame is A2, and the area of the intersection of the two is A3, then the area of the union of the two is A1+A2-A3.
[0088] S702: Calculate the area of the circumscribed rectangle of the current detection frame and the overlapping frame to obtain a second area; that is, calculate the area of the detection frame obtained after the current detection frame and the overlapping frame are merged.
[0089] S703: Divide the first area by the second area to obtain an overlap score between the current detection frame and the overlapping frame.
[0090] For example, assuming that the second area is A4, the overlap score Score=(A1+A2-A3) / A4.
[0091] S704: Determine whether the overlap score is greater than or equal to a preset score threshold, if so, execute step S705, if not, execute step S706.
[0092] S705: taking the overlapping frame as the detection frame to be merged.
[0093] S706: Filter the overlapping frame.
[0094] By filtering the overlapping frames, we can prevent the current detection frame from being merged with some overlapping frames. The intersection of the merged frame and the frame before the merge is too small, which will cause most areas to be sparse and not meet the concept of clustering.
[0095] S8: Obtain the circumscribed rectangle of the current detection frame and its corresponding detection frame to be merged to obtain a merged detection frame, and merge the history list of the current detection frame and its corresponding history list of the detection frame to be merged to obtain a history list of the merged detection frame.
[0096] Furthermore, the count value corresponding to the merged detection frame is the sum of the count value corresponding to the current detection frame and the count values corresponding to each detection frame to be merged.
[0097] By merging the history list, only the initially recognized detection frame exists in the history list, and the merged detection frame is not included, so that the number of sub-items in the history list is the number of targets contained in the detection frame.
[0098] S9: Deleting the current detection frame and the detection frame to be merged from the detection frame set, and adding the merged detection frame to the detection frame set.
[0099] S10: Determine whether the detection frame set has been traversed. If so, execute step S11. If not, continue to traverse the detection frame set, that is, return to execute step S4.
[0100] After the above traversal process, adjacent detection frames will be merged one after another until they cannot be merged.
[0101] S11: Obtaining a target aggregation area and the number of targets according to each detection frame in the detection frame set and its corresponding history list.
[0102] Specifically, each target aggregation region is obtained according to each detection frame in the detection frame set; and the aggregation number of each target aggregation region is determined according to the number of detection frames in the history list corresponding to each detection frame.
[0103] After the traversal is completed, the detection frames in the detection frame set are all non-overlapping (and have a certain distance) detection frames. At this time, each detection frame is regarded as a target aggregation area, and the aggregation number of each target aggregation area is the number of detection frames in the history list corresponding to the detection frame.
[0104] The final test results are as follows Figure 4 As shown. Subsequently, the threshold set in advance can be used to assess whether an abnormal gathering of people has occurred, which facilitates the rapid location and assessment of the problem by relevant personnel after the alarm. In addition, in the post-event evidence collection stage, the report diagram when a gathering of people occurs also facilitates the analysis of relevant personnel.
[0105] This embodiment can quickly detect target clusters in multiple areas in a picture at the same time, and can quickly obtain the number of targets in each target cluster area.
[0106] Embodiment 2
[0107] This embodiment is a computer-readable storage medium corresponding to the above-mentioned embodiment, on which a computer program is stored. When the computer program is executed by the processor, the various processes in the target aggregation detection method embodiment described above are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0108] In summary, the present invention provides a method for detecting target clusters and a computer-readable storage medium. By filtering the identified detection frames, the efficiency and accuracy of subsequent target cluster detection can be improved. By adding all the filtered detection frames to the detection frame set, the overlapping or adjacent detection frames are merged in the process of traversing the detection frame set, and the detection frame set is updated accordingly. After traversing the detection frame set, the remaining detection frames are detection frames that can no longer be merged, that is, detection frames that do not overlap each other and have a certain distance, that is, different areas where targets are clustered in the picture, thereby realizing simultaneous detection of multi-region target clusters. By merging the history list of the merged detection frames, it is ensured that only the initially identified detection frames exist in the history list, and the merged detection frames are not included, so that the number of sub-items in the history list is the number of targets contained in the detection frame, which is conducive to the subsequent rapid acquisition of the number of targets existing in the clustered area. By filtering the overlapping frames, it is prevented that after the current detection frame is merged with some overlapping frames, the intersection of the merged frame and the frame before the merge is too small, resulting in sparseness in most areas, thereby ensuring that the merged detection frame meets the concept of clustering.
[0109] The present invention can quickly detect target clusters in multiple areas in a picture at the same time, and can quickly obtain the number of targets in each target cluster area, making it convenient for relevant personnel to quickly locate and evaluate and analyze.
[0110] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A target aggregation detection method, characterized in that: include: Identify the image containing the target to be detected and obtain the detection frame of each target to be detected; Establish a history list corresponding to each detection frame, and add each detection frame to its corresponding history list; Add the detection frame of each target to be detected to the detection frame set; Traversing the detection frame set, and obtaining a detection frame from the detection frame set in turn as the current detection frame; Expanding the boundary of the current detection frame, and acquiring other detection frames overlapping with the current detection frame after the boundary expansion from the detection frame set, to obtain overlapping frames; Obtaining the circumscribed rectangle of the current detection frame and the overlapping frame to obtain a merged detection frame, and merging the history list of the current detection frame and the overlapping frame to obtain a history list of the merged detection frame; Deleting the current detection frame and the overlapping frame from the detection frame set, and adding the merged detection frame to the detection frame set; After traversing the detection frame set, obtaining the target gathering area and the number of targets according to each detection frame in the detection frame set and its corresponding history list; The target gathering area and the number of targets obtained according to each detection frame in the detection frame set and its corresponding history list are specifically: Obtaining target gathering areas according to each detection frame in the detection frame set; The number of targets in each target aggregation area is determined according to the number of detection frames in the history list corresponding to each detection frame.
2. The target aggregation detection method according to claim 1, characterized in that: The image containing the target to be detected is identified to obtain the detection frame of each target to be detected: Identify the images containing the target to be tested, and obtain the detection frame and classification confidence of each target to be tested; The detection frame is filtered according to a preset confidence threshold.
3. The target aggregation detection method according to claim 1, characterized in that: The boundary of the expanded current detection frame is specifically: The boundaries of the current detection frame are expanded outward according to the preset expansion boundary value.
4. The target aggregation detection method according to claim 1, characterized in that: The boundary of the expanded current detection frame is specifically: Obtain a detection frame with the smallest area or the median area in the history list corresponding to the current detection frame, and obtain the width and height of the detection frame with the smallest area or the median area; Calculate the expanded width value and the expanded height value according to the acquired width and height and the preset ratio; According to the expanded width value and the expanded height value, the width boundary and the height boundary of the current detection frame are expanded outwards respectively.
5. The target aggregation detection method according to claim 1, characterized in that: The method of obtaining other detection frames overlapping with the current detection frame after the boundary expansion from the detection frame set to obtain the overlapping frames is specifically: According to a preset non-overlapping condition, a detection frame that does not overlap with the current detection frame after the boundary is expanded is obtained from the detection frame set, wherein the non-overlapping condition includes that the x value of the coordinates of the upper left corner vertex is greater than or equal to the x value of the coordinates of the lower right corner vertex of the current detection frame after the boundary is expanded, the y value of the coordinates of the upper left corner vertex is greater than or equal to the y value of the coordinates of the lower right corner vertex of the current detection frame after the boundary is expanded, the x value of the coordinates of the lower right corner vertex is less than or equal to the x value of the coordinates of the upper left corner vertex of the current detection frame after the boundary is expanded, and the y value of the coordinates of the lower right corner vertex is less than or equal to the y value of the coordinates of the upper left corner vertex of the current detection frame after the boundary is expanded; wherein, the upper left corner of the image is taken as the coordinate origin, the right direction is the positive direction of the X axis, and the downward direction is the positive direction of the Y axis; Detection frames other than the current detection frame and the detection frame that does not overlap with the current detection frame after the boundary is expanded are obtained from the detection frame set to obtain an overlapping frame corresponding to the current detection frame.
6. The target aggregation detection method according to claim 1, characterized in that: The step of obtaining the bounding rectangle of the current detection frame and the overlapping frame to obtain a merged detection frame, and merging the history list of the current detection frame and the overlapping frame to obtain the history list of the merged detection frame further includes: According to the overlap degree between the current detection frame and each overlapping frame, the overlapping frames are filtered to obtain the detection frame to be merged.
7. The target aggregation detection method according to claim 6, characterized in that: The filtering of the overlapping frames according to the overlap degree between the current detection frame and each overlapping frame is specifically as follows: Calculating the area of the union of the current detection frame and the overlapping frame according to the area of the current detection frame, the area of an overlapping frame, and the area of the intersection of the current detection frame and the overlapping frame to obtain a first area; Calculating the area of the circumscribed rectangle of the current detection frame and the overlapping frame to obtain a second area; Dividing the first area by the second area to obtain an overlap score between the current detection frame and the overlapping frame; If the overlap score is greater than or equal to a preset score threshold, the overlapping frame is used as a detection frame to be merged, otherwise the overlapping frame is filtered.
8. The target aggregation detection method according to claim 6 or 7, characterized in that: The obtaining of the circumscribed rectangle of the current detection frame and the overlapping frame to obtain a merged detection frame, and merging the history list of the current detection frame and the overlapping frame to obtain the history list of the merged detection frame; and deleting the current detection frame and the overlapping frame from the detection frame set and adding the merged detection frame to the detection frame set are specifically as follows: Obtaining the circumscribed rectangle of the current detection frame and the detection frame to be merged to obtain a merged detection frame, and merging the history list of the current detection frame and the detection frame to be merged to obtain a history list of the merged detection frame; The current detection frame and the detection frame to be merged are deleted from the detection frame set, and the merged detection frame is added to the detection frame set.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
