A method for fast fixing a target detection frame

By combining distance tracking, cross-union ratio, and Kalman filtering, and selecting a tracking strategy based on the number and speed of targets, the problems of computational complexity and unstable detection box size in existing technologies are solved, achieving efficient target tracking and stable detection boxes, and improving real-time performance and observation results.

CN116664626BActive Publication Date: 2026-07-21ZHEJIANG DALI TECH
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG DALI TECH
Filing Date
2023-06-02
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing target tracking methods are computationally complex, have poor real-time performance, and the target detection box size changes frequently, which is not conducive to observation and subsequent processing.

Method used

A method combining distance tracking, cross-union ratio, and Kalman filtering is adopted. Different tracking strategies are selected based on the number and speed of targets. The target detection box size is corrected by weighted averaging, which reduces computational complexity and stabilizes the detection box size.

Benefits of technology

It improves the real-time performance of target tracking, reduces computational load, stabilizes the size of the target detection box, and enhances the efficiency of observation and subsequent processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116664626B_ABST
    Figure CN116664626B_ABST
Patent Text Reader

Abstract

The application relates to a method for quickly fixing a target detection frame, which comprises the following steps: performing target detection on an image in a current frame image to obtain target detection frames of all targets; for the case that the number of target detection frames is less than a target threshold, adopting a distance tracking method to track the target detection frames; for the case that the number of target detection frames is greater than the target threshold and the moving speed of the target is less than a speed threshold, adopting an intersection-over-union method to track the target detection frames; for the case that the number of target detection frames is greater than the target threshold and the moving speed of the target is greater than the speed threshold, first adopting a Kalman filter, and then adopting the intersection-over-union method to track the target detection frames; and correcting the size of the target detection frames in the current frame and subsequent frame images. The application can quickly fix the target detection frame according to the number of targets and the moving speed of the target by adopting corresponding methods, and can prevent the size of the same target detection frame from frequently changing, so that the target detection frame is more stable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of target detection and target tracking technology, and in particular to a method for rapidly fixing a target detection box. Background Technology

[0002] In recent years, technologies in the fields of target detection and tracking have continued to develop. To meet the needs of video surveillance, multi-target detection and tracking has become a research hotspot in these fields and is currently being applied in various areas such as military reconnaissance and intelligent transportation. Therefore, methods for rapidly tracking stationary targets are of great significance.

[0003] Current target tracking methods mainly employ algorithms such as probabilistic data association filtering, DeepSort, and camshift tracking. These algorithms are computationally complex, consume significant CPU resources, and suffer from real-time performance limitations. Current target detection methods primarily use rectangular boxes to enclose the target, but in high-resolution and high-frame-rate real-time target tracking, the size of the detection box changes frequently, which is detrimental to both observation and subsequent processing.

[0004] The existing technology has the following main drawbacks: First, the existing tracking algorithms are computationally complex and difficult to meet the real-time requirements of multi-target tracking; second, in the existing target tracking methods, the size of the target detection box changes frequently, which is not conducive to observation or subsequent processing. Summary of the Invention

[0005] Based on the above analysis, the present invention aims to provide a method for rapidly fixing target detection boxes, in order to solve the problems of existing target tracking methods being computationally complex, having poor real-time performance, and having frequent changes in the size of target detection boxes when the target tracking does not require high precision at high resolution and high frame rate.

[0006] This invention provides a method for rapidly fixing target detection boxes, the method comprising the following steps:

[0007] Perform object detection on the image in the current frame and obtain the object detection boxes for all objects;

[0008] Perform object detection on the image in the current frame and obtain the object detection boxes for all objects;

[0009] If the number of target detection boxes is less than the target threshold, the target detection boxes are tracked using distance tracking in subsequent frame images;

[0010] If the number of target detection boxes is greater than the target threshold, the magnitude of the target's movement speed is first determined in subsequent frame images, and then different target tracking methods are selected based on the magnitude of the target's movement speed.

[0011] If the target's moving speed is less than the speed threshold, the cross-union method is used to track the target detection box in subsequent frame images;

[0012] If the target's moving speed is greater than the speed threshold, Kalman filtering is first applied in subsequent frame images, and then the cross-union method is used to track the target detection box.

[0013] Furthermore, for cases where the number of target detection boxes is less than the target threshold, tracking the target detection boxes using the distance tracking method includes:

[0014] For each target detection box in the current frame image, the distance tracking method is used to determine whether there is a target detection box in the next frame image that matches the target detection box in the current frame image; if there is, the coordinates of the center point of the target detection box are updated, the direction information of the center points of the two target detection boxes are saved, and the ID value of the target detection box remains unchanged.

[0015] Furthermore, the step of determining whether a target detection box matching the target detection box in the current frame exists in the next frame image based on the distance tracking method includes:

[0016] Determine if a target detection box exists within a set distance from the center point of the target detection box; if it exists, determine that the target detection box matches the target detection box in the current frame image; otherwise, determine that there is no target detection box in the next frame image that matches the target detection box in the current frame image; if there is a target detection box in the next frame image that cannot match the target detection box in the current frame image, determine that a new target detection box has appeared and assign a new ID value to the target detection box.

[0017] Furthermore, for cases where the number of target detection boxes is greater than a target threshold and the target movement speed is less than a speed threshold, tracking the target detection boxes using the intersection-union ratio method includes:

[0018] For each target detection box in the current frame image, the method based on intersection-union ratio (IU) determines in the next frame image whether there is a target detection box that matches the target detection box in the current frame image; if there is, the coordinates of the center point of the target detection box are updated, and the ID value of the target detection box remains unchanged.

[0019] Furthermore, the method based on intersection-union ratio (IoU) determines in the next frame whether there exists a target detection box that matches the target detection box in the current frame, including:

[0020] Obtain the intersection-union ratio (IUGR) of the target detection boxes in the current frame image and each target detection box in the next frame image; select the largest IUGR value. If the IUGR value is greater than the set IUGR threshold, it is determined that the target detection box corresponding to the largest IUGR in the next frame image matches the target detection box in the current frame image; otherwise, it is determined that there is no target detection box in the next frame image that matches the target detection box in the current frame image; when there is a target detection box in the next frame image that cannot match the target detection box in the current frame image, it is determined that a new target detection box has appeared, and a new ID value is assigned to the target detection box.

[0021] Furthermore, for cases where the number of target detection boxes is greater than the target threshold and the target's movement speed is greater than the speed threshold, Kalman filtering is first applied, and then the target detection boxes are tracked using the cross-union ratio method, including:

[0022] For each target detection box in the current frame image, a method based on Kalman filtering and cross-union ratio is used to determine whether there is a target detection box in the next frame image that matches the target detection box in the current frame image; if there is, the coordinates of the center point of the target detection box are updated, and the ID value of the target detection box remains unchanged.

[0023] Furthermore, the method based on Kalman filtering and intersection-union ratio (IUU) determines in the next frame whether there exists a target detection box that matches the target detection box in the current frame, including:

[0024] Kalman filtering is used to predict each target detection box in the current frame image; the intersection-over-union ratio (IoU) of the predicted target detection box and each target detection box in the next frame image is obtained; the largest IoU value is selected, and if the IoU value is greater than the set IoU threshold, the target detection box corresponding to the maximum IoU value in the next frame image is determined to match the target detection box in the current frame image; otherwise, it is determined that there is no target detection box in the next frame image that matches the target detection box in the current frame image; when there is a target detection box in the next frame image that cannot match the target detection box in the current frame image, it is determined that a new target detection box has appeared, and a new ID value is assigned to the target detection box.

[0025] Furthermore, the method also includes:

[0026] The size of the target detection box in the current frame and subsequent frames is corrected to make the size of the target detection box more stable, including:

[0027] Obtain the coordinates of the center point of the target detection box, as well as the height and width of the target detection box, in the two consecutive frames preceding the current frame;

[0028] Obtain the coordinates, height, and width of the center point of the target detection box in the current frame image;

[0029] The corrected height and width of the target detection box are obtained by taking a weighted average of the height and width of the target detection box in the current frame image and the height and width of the target detection box in the previous two frames using the following formula:

[0030]

[0031]

[0032] a + b + c = 1

[0033] Where H1 is the height of the target detection box in the two preceding frames of the current frame, and W1 is the width of the target detection box in the two preceding frames of the current frame; H2 is the height of the target detection box in the previous frame of the current frame, and W2 is the width of the target detection box in the previous frame of the current frame; H3 is the height of the target detection box in the current frame, and W3 is the width of the target detection box in the current frame; H3' is the height of the target detection box after correction in the current frame, and W3' is the width of the target detection box after correction in the current frame.

[0034] Furthermore, the magnitude of the target's moving speed is determined through the following steps:

[0035] Select the target detection boxes closest to the four corners in the current frame image. Based on the distance tracking method, determine whether there are target detection boxes in the next frame image that match the four target detection boxes respectively. If they exist, obtain the intersection-union ratio (IUR) of the target detection boxes in the current frame image and the target detection boxes in the next frame image. If they do not exist, set the IUR to 0. If the IUR of three or more target detection boxes is 0, determine that the target moving speed is greater than the speed threshold. Otherwise, determine that the target moving speed is less than the speed threshold.

[0036] Furthermore, if no target detection box in the next frame matches the target detection box in the current frame, the target detection box is determined to have disappeared, and the system retains the ID value of the target detection box. If the target detection box does not appear within the next 7 consecutive frames, the system reclaims the ID value of the target detection box so that it can be assigned to a new target detection box.

[0037] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:

[0038] 1. This invention flexibly adopts corresponding methods to track the target detection box according to different target quantities and target speeds, which greatly reduces the amount of computation and thus improves the real-time performance of target tracking;

[0039] 2. This invention does not rely on complex target tracking algorithms or perform model processing, thus reducing the computational complexity during target tracking and improving the real-time performance of target tracking;

[0040] 3. This invention corrects the size of the target detection box by weighted averaging, avoiding frequent changes in the target detection box and making its size more stable, which is beneficial for observation and subsequent processing.

[0041] In this invention, the above-described technical solutions can be combined with each other to achieve more preferred combinations. Other features and advantages of this invention will be set forth in the following description, and some advantages may become apparent from the description or be learned by practicing the invention. The objects and other advantages of this invention can be realized and obtained from what is particularly pointed out in the description and drawings. Attached Figure Description

[0042] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts.

[0043] Figure 1 This is a flowchart of a method for rapidly fixing a target detection box according to an embodiment of the present invention;

[0044] Figure 2 This is a schematic diagram of the distance tracking method according to an embodiment of the present invention;

[0045] Figure 3 This is a schematic diagram of the intersection-union comparison method according to an embodiment of the present invention;

[0046] Figure 4 This is a schematic diagram illustrating the application of Kalman filtering followed by the cross-union ratio method in an embodiment of the present invention.

[0047] Figure 5 This is a flowchart illustrating how the size of the target detection box is corrected in the current frame and subsequent frames according to an embodiment of the present invention. Detailed Implementation

[0048] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.

[0049] One specific embodiment of the present invention discloses a method for rapidly fixing target detection boxes. For example... Figure 1 As shown, the method includes the following steps:

[0050] Step S101: Perform target detection on the image in the current frame and obtain the target detection boxes of all targets;

[0051] Step S103: If the number of target detection boxes is less than the target threshold, the target detection boxes are tracked using distance tracking in subsequent frame images.

[0052] Step S104: If the number of target detection boxes is greater than the target threshold, first determine the magnitude of the target's moving speed in subsequent frame images, and then select different target tracking methods based on the magnitude of the target's moving speed.

[0053] Step S105: For cases where the target's moving speed is less than the speed threshold, the target detection box is tracked in subsequent frame images using the cross-union method.

[0054] Step S106: For cases where the target's moving speed is greater than the speed threshold, Kalman filtering is first applied in subsequent frame images, and then the cross-union method is used to track the target detection box.

[0055] Understandably, steps S103 and S104 are not executed in a strict order, but rather the order in which step is executed is determined by the number of target detection boxes; similarly, steps S105 and S106 are not executed in a strict order, but rather the order in which step is executed is determined by the magnitude of the target's movement speed.

[0056] Specifically, in step S101, after object detection is performed on the first frame image, an ID value is assigned to each acquired object detection box, and the coordinates of the center point of the object detection box, as well as its height and width, are recorded. It can be understood that the maximum ID value is a fixed value, and when the number of object detection boxes reaches the maximum ID value, the system will no longer assign a new ID value. Preferably, the maximum ID value is 100.

[0057] Specifically, in step S102, the system sets a target threshold. When the number of target detection boxes is less than the threshold, it is considered that there are few targets; otherwise, it is considered that there are many targets.

[0058] Specifically, the target threshold can be set according to actual conditions such as resolution and frame rate.

[0059] Specifically, such as Figure 2 As shown, the distance tracking method includes:

[0060] For each target detection box in the current frame image, based on the distance tracking method, it is determined whether there is a target detection box in the next frame image that matches the target detection box in the current frame image. If there is, the target detection box that matches the target detection box in the current frame image and is closest to it is found, and the coordinates of its center point are marked as (x1, y1). The coordinates of the center point of the target detection box in the current frame image are updated from (x, y) to (x1, y1). The direction information of the center points of the two target detection boxes are saved, and the ID value of the target detection box remains unchanged.

[0061] The method of determining whether there is a target detection box in the next frame that matches the target detection box in the current frame image based on distance tracking includes:

[0062] Determine whether a target detection box exists within a set distance r from the center point (x, y) of the target detection box; that is, determine whether a target detection box exists in the next frame that satisfies (x1-x). 2 +(y1-y) 2 <r 2 If a target detection box exists, the target detection box that is closest to the target detection box in the current frame image is found as the target detection box that matches the target detection box in the current frame image; otherwise, it is determined that there is no target detection box in the next frame image that matches the target detection box in the current frame image; when there is a target detection box in the next frame image that cannot match the target detection box in the current frame image, it is determined that a new target detection box has appeared, and a new ID value is assigned to the target detection box; preferably, the set distance is 1.5 times the width of the target detection box.

[0063] Furthermore, if there is only one target detection box within a set distance r from the coordinates (x, y) of the center point of the target detection box, then that target detection box is taken as the target detection box that matches the target detection box in the current frame image; if there is more than one target detection box within a set distance r from the coordinates (x, y) of the center point of the target detection box, then the target detection box that is closest to the target detection box in the current frame image is taken as the target detection box that matches the target detection box in the current frame image.

[0064] Understandably, at high frame rates, when the number of targets is small, if there is a target detection box in the next frame that is very close to the target detection box in the current frame, then the target detection box is considered to be the same target detection box as the target detection box in the current frame, i.e., a match.

[0065] Therefore, the distance tracking method can be used, which greatly reduces the amount of computation and thus quickly fixes the target detection box.

[0066] Specifically, in step S104, the magnitude of the target's moving speed is determined through the following steps:

[0067] Select the target detection boxes closest to the four corners in the current frame image. Based on the distance tracking method, determine whether there are target detection boxes in the next frame image that match the four target detection boxes respectively. If they exist, obtain the intersection-union ratio (IUR) of the target detection boxes in the current frame image and the target detection boxes in the next frame image. If they do not exist, set the IUR to 0. If the IUR of three or more target detection boxes is 0, determine that the target moving speed is greater than the speed threshold. Otherwise, determine that the target moving speed is less than the speed threshold.

[0068] When the target's moving speed is less than the threshold, the cross-comparison ratio (CCR) method is used for tracking; otherwise, Kalman filtering is used first, followed by the CCR method for tracking.

[0069] Understandably, when the target moves at a high speed, it is difficult for the target detection box in the current frame to intersect with the target detection box in the next frame, and the crossover union ratio is usually 0. Therefore, it is necessary to first use Kalman filtering to predict the target detection box in the current frame, and then use the predicted target detection box to perform the crossover union ratio with the target detection box in the next frame to find the same target detection box, that is, to match.

[0070] The cross-union method is used for tracking, which does not rely on complex target tracking algorithms or model processing, thus reducing the computational complexity during target tracking and improving the real-time performance of target tracking.

[0071] Specifically, in step S105, the method for crossover and union ratio includes:

[0072] For each target detection box in the current frame image, the method based on intersection-union ratio (IU) determines in the next frame image whether there is a target detection box that matches the target detection box in the current frame image; if there is, the coordinates of the center point of the target detection box are updated, and the ID value of the target detection box remains unchanged.

[0073] The method based on intersection-over-union (IoU) determines in the next frame whether there is a target detection box that matches the target detection box in the current frame, including:

[0074] Obtain the intersection-union ratio (IUGR) of the target detection boxes in the current frame image and each target detection box in the next frame image; select the largest IUGR value. If the IUGR value is greater than the set IUGR threshold, it is determined that the target detection box corresponding to the largest IUGR in the next frame image matches the target detection box in the current frame image; otherwise, it is determined that there is no target detection box in the next frame image that matches the target detection box in the current frame image; when there is a target detection box in the next frame image that cannot match the target detection box in the current frame image, it is determined that a new target detection box has appeared, and a new ID value is assigned to the target detection box.

[0075] Specifically, such as Figure 3 As shown, the crossover-union method includes:

[0076] Step S201: Obtain any target detection box in the current frame image as detection box A.

[0077] Step S202: Obtain any target detection box in the next frame image as detection box B.

[0078] Step S203: Obtain the intersection-union ratio of A and B using the following formula:

[0079]

[0080] Where IOU(A,B) is the intersection-union ratio of A and B, Area(A)∩Area(B) is the region where A intersects B, and Area(A)∪Area(B) is the region where A merges with B.

[0081] Step S204: Select any one of the remaining target detection boxes in the next frame image as detection box B, and return to step S203 until all target detection boxes in the next frame image have been traversed.

[0082] Step S205: Select the largest crossover-union ratio (CUI). If the CUI is greater than the set CUI threshold, it means that there is a target detection box in the next frame that matches the target detection box A in the current frame. Then update the coordinates of the center point of the target detection box A from (x, y) to (x1, y1) and keep the ID value of the box unchanged. Preferably, the CUI threshold is set to 0.2.

[0083] Step S206: Select any one of the remaining target detection boxes in the current frame image as detection box A; return to step S202, and continue until all target detection boxes in the current frame image have been traversed.

[0084] If a new target detection box appears in the next frame that cannot match the target detection box in the current frame, it is determined that a new target detection box has appeared, and a new ID value is assigned to the target detection box.

[0085] After traversing all the target detection boxes in the next frame, if a target detection box matches a target detection box in the current frame, the ID of the target detection box in the next frame is the same as the ID of the corresponding target detection box in the current frame. That is, all target detection boxes in the next frame that match the target detection boxes in the current frame will have an ID. The remaining target detection boxes that cannot match any target detection box in the current frame are judged as newly appearing target detection boxes.

[0086] Specifically, in step S106, the method of first employing Kalman filtering and then using cross-union ratio includes:

[0087] For each target detection box in the current frame image, a method based on Kalman filtering and cross-union ratio is used to determine whether there is a target detection box in the next frame image that matches the target detection box in the current frame image; if there is, the coordinates of the center point of the target detection box are updated, and the ID value of the target detection box remains unchanged.

[0088] The method based on Kalman filtering and cross-union ratio determines whether there is a target detection box in the next frame that matches the target detection box in the current frame, including:

[0089] Kalman filtering is used to predict each target detection box in the current frame image; the intersection-over-union ratio (IoU) of the predicted target detection box and each target detection box in the next frame image is obtained; the largest IoU value is selected, and if the IoU value is greater than the set IoU threshold, the target detection box corresponding to the maximum IoU value in the next frame image is determined to match the target detection box in the current frame image; otherwise, it is determined that there is no target detection box in the next frame image that matches the target detection box in the current frame image; when there is a target detection box in the next frame image that cannot match the target detection box in the current frame image, it is determined that a new target detection box has appeared, and a new ID value is assigned to the target detection box.

[0090] Specifically, such as Figure 4 As shown, the method of first using Kalman filtering and then using cross-union ratio includes:

[0091] Step S301: Obtain any target detection box in the current frame image as detection box A.

[0092] Step S302: Use Kalman filtering to predict the target detection box and obtain its predicted target detection box in the next frame image as the detection box C.

[0093] Step S303: Obtain any target detection box in the next frame image as detection box B.

[0094] Step S304: Obtain the crossover-union ratio of C and B.

[0095] Step S305: Select any target detection box from the remaining target detection boxes in the next frame image as detection box B, and return to step S304 until all target detection boxes in the next frame image have been traversed.

[0096] Step S306: Select the largest crossover-union ratio (CUI). If the CUI is greater than the set CUI threshold, it means that there is a target detection box in the next frame that matches the target detection box A in the current frame. Then update the coordinates of the center point of the target detection box A from (x, y) to (x1, y1) and keep the ID value of the box unchanged. Preferably, the CUI threshold is set to 0.2.

[0097] Step S307: Select any one of the remaining target detection boxes in the current frame image as detection box A; return to step S302, until all target detection boxes in the current frame image have been traversed.

[0098] If a new target detection box appears in the next frame that cannot match the target detection box in the current frame, it is determined that a new target detection box has appeared, and a new ID value is assigned to the target detection box.

[0099] Specifically, to facilitate the observation of the target detection box, the tracking method preferably further includes: correcting the size of the target detection box in the current frame and subsequent frame images.

[0100] Specifically, such as Figure 5 As shown, the size of the target detection box in the current frame and subsequent frames is corrected to make the size of the target detection box more stable, including:

[0101] Step S401: Obtain the coordinates of the center point of the target detection box in the two consecutive frames before the current frame, as well as the height and width of the target detection box.

[0102] Step S402: Obtain the coordinates, height, and width of the center point of the target detection box in the current frame image.

[0103] Step S403: Calculate the corrected height and width of the target detection box by taking a weighted average of the height and width of the target detection box in the current frame image and the height and width of the target detection box in the previous two frames using the following formula:

[0104]

[0105]

[0106] a + b + c = 1

[0107] Where H1 is the height of the target detection box in the two preceding frames of the current frame, and W1 is the width of the target detection box in the two preceding frames of the current frame; H2 is the height of the target detection box in the previous frame of the current frame, and W2 is the width of the target detection box in the previous frame of the current frame; H3 is the height of the target detection box in the current frame, and W3 is the width of the target detection box in the current frame; H3' is the height of the target detection box after correction in the current frame, and W3' is the width of the target detection box after correction in the current frame.

[0108] Specifically, if no target detection box in the next frame matches the target detection box in the current frame, the target detection box is considered to have disappeared, and the system retains the ID value of the target detection box. If the target detection box does not appear in the subsequent 7 consecutive frames, the system reclaims the ID value of the target detection box so that it can be assigned to a new target detection box.

[0109] In summary, the fast target detection box fixing method of this invention employs distance tracking when the number of target detection boxes is less than a target threshold; it employs intersection-over-union (IoU) when the number of target detection boxes is greater than the target threshold and the target's movement speed is less than a speed threshold; and it first employs Kalman filtering and then IoU to track the target detection boxes when the number of target detection boxes is greater than the target threshold and the target's movement speed is greater than the speed threshold. By flexibly employing appropriate methods to track target detection boxes based on the different numbers and speeds of targets, this method does not rely on complex target tracking algorithms or perform model processing, thus reducing the computational complexity during target tracking and significantly decreasing the computational load, thereby improving the real-time performance of target tracking.

[0110] Furthermore, in this invention, the size of the target detection box in the current frame and subsequent frames is corrected by weighted averaging to prevent the size of the same target detection box from changing frequently, making its size more stable, which is beneficial for observation and subsequent processing.

[0111] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.

[0112] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for rapidly fixing a target detection box, characterized in that, The method includes the following steps: In the current frame image, target detection is performed on the image to obtain the target detection boxes of all targets; wherein, after target detection is performed on the first frame image, each obtained target detection box is assigned an ID value, and when the number of target detection boxes reaches the maximum ID value, the system will not assign new ID values; If the number of target detection boxes is less than the target threshold, the target detection boxes are tracked using distance tracking in subsequent frame images; If the number of target detection boxes is greater than the target threshold, the magnitude of the target's movement speed is first determined in subsequent frame images, and then different target tracking methods are selected based on the magnitude of the target's movement speed. If the target's moving speed is less than the speed threshold, the cross-union method is used to track the target detection box in subsequent frame images; If the target's moving speed is greater than the speed threshold, Kalman filtering is first used in subsequent frame images, and then the cross-union method is used to track the target detection box. Determine the magnitude of the target's moving speed using the following steps: Select the target detection boxes closest to the four corners in the current frame image. Based on the distance tracking method, determine whether there are target detection boxes in the next frame image that match the four target detection boxes respectively. If they exist, obtain the intersection-union ratio (IUR) between the target detection boxes in the current frame image and the target detection boxes in the next frame image. If they do not exist, set the IUR to 0. If the IUR of three or more target detection boxes is 0, determine that the target moving speed is greater than the speed threshold. Otherwise, determine that the target moving speed is less than the speed threshold. If no target detection box in the next frame matches the target detection box in the current frame, the target detection box is considered to have disappeared, and the system retains the ID value of the target detection box. If the target detection box does not appear in the next 7 consecutive frames, the system reclaims the ID value of the target detection box so that it can be assigned to a new target detection box. The size of the target detection box in the current frame and subsequent frames is corrected to make the size of the target detection box more stable, including: Obtain the coordinates of the center point of the target detection box, as well as the height and width of the target detection box, in the two consecutive frames preceding the current frame; Obtain the coordinates, height, and width of the center point of the target detection box in the current frame image; The corrected height and width of the target detection box are obtained by taking a weighted average of the height and width of the target detection box in the current frame image and the height and width of the target detection box in the previous two frames using the following formula: ; ; ; in The height of the target detection bounding box in the previous two frames of the current frame. The width of the target detection bounding box in the previous two frames of the current frame; The height of the target detection box in the previous frame of the current frame. The width of the target detection box in the previous frame of the current frame; The height of the target detection box in the current frame image. The width of the target detection box in the current frame image; The height of the target detection box after correction in the current frame. This is the width of the target detection box after correction in the current frame.

2. The method for rapidly fixing a target detection box according to claim 1, characterized in that, When the number of target detection boxes is less than the target threshold, the distance tracking method for tracking the target detection boxes includes: For each target detection box in the current frame image, the distance tracking method is used to determine whether there is a target detection box in the next frame image that matches the target detection box in the current frame image; if there is, the coordinates of the center point of the target detection box are updated, the direction information of the center points of the two target detection boxes are saved, and the ID value of the target detection box remains unchanged.

3. The method for rapidly fixing a target detection box according to claim 2, characterized in that, The method of determining whether there is a target detection box in the next frame that matches the target detection box in the current frame image based on distance tracking includes: Determine if a target detection box exists within a set distance from the center point of the target detection box; if it exists, determine that the target detection box matches the target detection box in the current frame image; otherwise, determine that there is no target detection box in the next frame image that matches the target detection box in the current frame image; if there is a target detection box in the next frame image that cannot match the target detection box in the current frame image, determine that a new target detection box has appeared and assign a new ID value to the target detection box.

4. The method for rapidly fixing a target detection box according to claim 1, characterized in that, When the number of target detection boxes is greater than the target threshold and the target movement speed is less than the speed threshold, tracking the target detection boxes using the intersection-union ratio method includes: For each target detection box in the current frame image, the method based on intersection-union ratio (IU) determines in the next frame image whether there is a target detection box that matches the target detection box in the current frame image; if there is, the coordinates of the center point of the target detection box are updated, and the ID value of the target detection box remains unchanged.

5. The method for rapidly fixing a target detection box according to claim 4, characterized in that, The method based on intersection-over-union (IoU) determines in the next frame whether there is a target detection box that matches the target detection box in the current frame, including: Obtain the intersection-union ratio (IUGR) of the target detection boxes in the current frame image and each target detection box in the next frame image; select the largest IUGR value. If the IUGR value is greater than the set IUGR threshold, it is determined that the target detection box corresponding to the largest IUGR in the next frame image matches the target detection box in the current frame image; otherwise, it is determined that there is no target detection box in the next frame image that matches the target detection box in the current frame image; when there is a target detection box in the next frame image that cannot match the target detection box in the current frame image, it is determined that a new target detection box has appeared, and a new ID value is assigned to the target detection box.

6. The method for rapidly fixing a target detection box according to claim 1, characterized in that, For cases where the number of target detection boxes exceeds a target threshold and the target's movement speed exceeds a speed threshold, Kalman filtering is first applied, followed by tracking the target detection boxes using the cross-union ratio method, including: For each target detection box in the current frame image, a method based on Kalman filtering and cross-union ratio is used to determine whether there is a target detection box in the next frame image that matches the target detection box in the current frame image; if there is, the coordinates of the center point of the target detection box are updated, and the ID value of the target detection box remains unchanged.

7. The method for rapidly fixing a target detection box according to claim 6, characterized in that, The method based on Kalman filtering and cross-union ratio determines whether there is a target detection box in the next frame that matches the target detection box in the current frame, including: Kalman filtering is used to predict each target detection box in the current frame image; the intersection-over-union ratio (IoU) of the predicted target detection box and each target detection box in the next frame image is obtained; the largest IoU value is selected, and if the IoU value is greater than the set IoU threshold, the target detection box corresponding to the maximum IoU value in the next frame image is determined to match the target detection box in the current frame image; otherwise, it is determined that there is no target detection box in the next frame image that matches the target detection box in the current frame image; when there is a target detection box in the next frame image that cannot match the target detection box in the current frame image, it is determined that a new target detection box has appeared, and a new ID value is assigned to the target detection box.