A method and device for tracking multiple targets in low frame rate video streams
By calculating multiple similarities between video frames and combining the Hungarian algorithm for target matching, the problem of insufficient computing power of multi-target tracking in low frame rate video applications in the existing technology is solved, and efficient, real-time and robust goals are achieved. Track performance.
Patent Information
- Application Number
- CN202410967649.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-07-18
AI Technical Summary
Existing target tracking algorithms cannot effectively implement multi-target tracking in limited computing power and low frame rate video applications, and cannot meet the computing power and frame rate requirements of neural networks and IOU matching, resulting in unsatisfactory results.
The low frame rate video stream multi-target tracking method is used to calculate the category, coordinates, color features, aspect ratio and area similarity between video frames, combined with the Hungarian algorithm to perform target matching, and dynamically adjust the weight according to environmental conditions and target occlusion. , to achieve target tracking.
It achieves target tracking with low computational cost, high real-time performance and robustness, improves the accuracy and robustness of matching results, and is suitable for video scenarios with limited computing power and low frame rate.
Smart Images

Figure CN118505757B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image target recognition and tracking, and in particular to a method and device for tracking multiple targets in a low frame rate video stream. Background Art
[0002] As a typical problem in machine vision applications, target tracking algorithm is currently one of the research hotspots of computer vision. With the development of artificial intelligence, intelligent monitoring equipment is widely used. The target tracking technology currently used in monitoring equipment mainly captures the target image through the monitoring camera, and then uses computer vision technology in the edge device or central server to detect and analyze the image features and motion models between frames to obtain the tracking results. However, this method requires the use of deepsort, bytetrack, or feature matching methods, based on iou matching, neural network reasoning to obtain features for matching, or a combination of the two for image matching. However, for security scenarios with limited computing power and the need to cover multiple cameras, it is impossible to meet the computing power requirements required by the neural network or the frame rate requirements required for iou matching, and applications for low frame rate videos cannot obtain satisfactory results. Summary of the invention
[0003] In order to overcome the above-mentioned deficiencies of the prior art, the present application provides a method and device for tracking multiple targets in a low frame rate video stream, which specifically adopts the following technical solutions:
[0004] A method for tracking multiple targets in a low frame rate video stream comprises the following steps:
[0005] Get video frames based on image recognition algorithm i and video frames i-1 The bounding box, category and target number of each detected target in;
[0006] Based on the video frame i and video frames i-1 Whether the categories of the detected targets are the same, calculate the video frame i and video frames i-1 The category similarity of the detected targets of the same category in ;
[0007] Get video frame i and video frames i-1 The bounding boxes of the detected targets of the same category in the video are obtained, and the video frames are obtained according to the bounding boxes. i and video frames i-1 The coordinate similarity of the detected targets of the same category in , color feature similarity , aspect ratio similarity And area similarity ;
[0008] Based on the video frame i and video frames i-1 The category similarity, coordinate similarity, color feature similarity, aspect ratio similarity and area similarity between the detected targets are calculated in the video frame i and video frames i-1 The comprehensive similarity between the detected targets S :
[0009] ;
[0010] in For video frames i The coordinate similarity of the corresponding bounding box in ; For video frames i Adaptive weights for the coordinate similarity of the corresponding bounding boxes in ; For video frames i Similarity of color features of corresponding bounding boxes in ; For video frames i Adaptive weights for the similarity of color features of the corresponding bounding boxes in ; For video frames i Similarity of aspect ratio of corresponding bounding boxes in ; For video frames i Adaptive weights for the aspect ratio similarity of the corresponding bounding boxes in ; For video frames i The area similarity of the corresponding bounding box in ; For video frames i Adaptive weights for the area similarity of the corresponding bounding boxes in ; For video frames i The category similarity of the corresponding detection target in the video frame is combined with the Hungarian algorithm and the comprehensive similarity i and video frames i-1 Detect the target in the matching;
[0011] For successfully matched detection targets, record video frames i and video frames i-1 Detect the target number of the target and update the trajectory maintenance table;
[0012] Output the tracking result of each target in the video stream according to the updated trajectory maintenance table.
[0013] Optional: The calculation video frame i and video frames i-1 The category similarity of the detected targets of the same category in The steps are:
[0014] Get video framei and video frames i-1 The category of the detection target to be matched;
[0015] Based on the video frame i and video frames i-1 The category of the detected target to be matched in the video frame is calculated i and video frames i-1 The category similarity of the detection targets to be matched :
[0016] ;
[0017] in For video frames i The category of the detected target; For video frames i-1 The category of the detected target.
[0018] Optional: The calculation video frame i and video frames i-1 The coordinate similarity of the detected targets of the same category in includes:
[0019] Get video frame i At least one set of diagonal coordinates of the bounding box of the detected object in A i,cor , B i,cor )and( a i,cor , b i,cor ); and get the video frame i-1 At least one set of diagonal coordinates of the bounding box of the detected object in A i-1,cor , B i-1,cor )and( a i-1,cor , b i-1,cor );
[0020] Based on the video frame i The diagonal coordinates of the bounding box of the detected target are calculated to obtain the video frame i The center coordinates of the bounding box of the detected object ( X i,cen , Y i,cen ):
[0021] ;
[0022] Based on the video frame i-1 The diagonal coordinates of the bounding box of the detected target are calculated to obtain the video frame i-1The center coordinates of the bounding box of the detected object ( X i-1,cen , Y i-1,cen ):
[0023] ;
[0024] Based on the video frame i and video frames i-1 The center coordinates of the bounding box of the detected target are calculated to obtain the video frame i With video frame i-1 The coordinate similarity of the bounding box of the detected target for:
[0025] .
[0026] Optional: The calculation video frame i and video frames i-1 The color feature similarity of the detection targets of the same category in The steps include:
[0027] Video Frame i and video frames i-1 The bounding box of the detected target of the same category in extracts the color distribution matrix;
[0028] Video Frame i and video frames i-1 The RGB images in are converted into HSV images respectively;
[0029] Extract video frames separately i and video frames i-1 The region of interest in the bounding box is selected and scaled to a uniform scale using RoI Align.
[0030] Calculate video frames separately i and video frames i-1 Structural similarity index of the region of interest in:
[0031] ;
[0032] in For video frames i The average value of the data in the region of interest; For video frames i-1 The average value of the data in the region of interest; For video frames i The variance of the data in the region of interest; For video frames i-1 The variance of the data in the region of interest; For video framesi and video frames i-1 The covariance of the data within the region of interest; C 1 and C 2 is a constant used to stabilize the calculation;
[0033] The video frame i and video frames i-1 The color feature similarity of the detection targets of the same category For video frames i and video frames i-1 Structural similarity index of the region of interest in .
[0034] Optional: The calculation video frame i and video frames i-1 The similarity of aspect ratios of detected objects of the same category in The steps include:
[0035] Get video frame i At least one set of diagonal coordinates of the bounding box of the detected object in A i,cor , B i,cor )and( a i,cor , b i,cor ); and get the video frame i-1 At least one set of diagonal coordinates of the bounding box of the detected object in A i-1,cor , B i-1,cor )and( a i-1,cor , b i-1,cor );
[0036] Calculate video frames separately i and video frames i-1 The aspect ratio of the bounding box of the detected target of the same category in :
[0037] ;
[0038] Based on the video frame i and video frames i-1 Calculate the aspect ratio of the bounding box in the video frame i and video frames i-1 The similarity of the aspect ratio of the detected targets of the same category :
[0039] ;
[0040] in For video frames i The aspect ratio of the bounding box of the detected target of the same category in ; For video frames i-1 The aspect ratio of the bounding box of the detected objects of the same category in .
[0041] Optional: The calculation video frame i and video frames i-1 The area similarity of the detected targets of the same category in The steps include:
[0042] Get video frame i At least one set of diagonal coordinates of the bounding box of the detected object in A i,cor , B i,cor )and( a i,cor , b i,cor ); and get the video frame i-1 At least one set of diagonal coordinates of the bounding box of the detected object in A i-1,cor , B i-1,cor )and( a i-1,cor , b i-1,cor );
[0043] Calculate video frames separately i and video frames i-1 The pixel area of the bounding box in:
[0044] ;
[0045] Based on the video frame i and video frames i-1 Calculate the pixel area of the bounding box in the video frame i and video frames i-1 The area similarity of the detected targets of the same category in :
[0046] ;
[0047] in For video frames i The pixel area of the middle bounding box; For video frames i-1 The pixel area of the bounding box in .
[0048] Optional: The Hungarian algorithm and the comprehensive similarity are combined to measure the video frames. i and video frames i-1 The steps for detecting and matching targets include:
[0049] Get video frame i and video frames i-1 The comprehensive similarity between the detection targets S ;
[0050] Determine video frame i and video frames i-1 The comprehensive similarity between the detection targets S Whether it is greater than a preset threshold;
[0051] If the comprehensive similarity is greater than the preset threshold, the video frame is maintained i and video frames i-1 The comprehensive similarity between the detection targets; if the comprehensive similarity is less than or equal to the preset threshold, the video frame is discarded i and video frames i-1 The comprehensive similarity corresponding to the detection targets between them is calculated, and the next detection target is replaced;
[0052] Based on the Hungarian algorithm, video frames i and video frames i-1 One-to-one matching is performed between the detection targets to obtain the video frame i and video frames i-1 The matching results of the detection targets.
[0053] Optional: When calculating video frames i and video frames i-1 The comprehensive similarity between the detected targets S When , the step of taking values of the adaptive weights of the coordinate similarity, color feature similarity, aspect ratio similarity and area similarity comprises:
[0054] Get video frame i Ambient brightness L i And the occlusion score of the detected target M i ;
[0055] Based on the video frame i The ambient brightness of the target to be detected L i and occlusion score M i Adjust video frame i The adaptive weight corresponding to the detected target:
[0056] The video frame i The adaptive weight of the coordinate similarity of the corresponding detection target for:
[0057] ;
[0058] The video frame i The adaptive weight of the color feature similarity of the corresponding detection target for:
[0059] ;
[0060] The video frame i The adaptive weight of the area similarity of the corresponding detection target for:
[0061] ;
[0062] The video frame i The adaptive weight of the aspect ratio similarity of the corresponding detection target for:
[0063] ;
[0064] in are the correction coefficients respectively.
[0065] Optional: For the successfully matched detection target, if the comprehensive similarity between adjacent video frames is always higher than or equal to the preset threshold within the preset time period or the preset number of video frames, the target number in the current trajectory maintenance table is maintained and updated; if the comprehensive similarity of the detection target between adjacent video frames is lower than the preset threshold within the preset time period or the preset number of video frames, the target number corresponding to the detection target in the trajectory maintenance table is deleted.
[0066] In addition, the present application also discloses a low frame rate video stream multi-target tracking device, the device comprising:
[0067] Target recognition module, used to obtain video frames based on image recognition algorithms i and video frames i-1 The bounding box, category and target number of each detected target in;
[0068] The first calculation module is used to calculate the video frame i and video frames i-1 Detect whether the target category is the same and output the video frame i and video frames i-1 The category similarity of the detected targets of the same category in ;
[0069] The second computing module is used to obtain the video frame i and video frames i-1 The bounding boxes of the detected targets of the same category in the video are obtained, and the video frames are obtained according to the bounding boxes. i and video frames i-1The coordinate similarity of the detected targets of the same category in , color feature similarity , aspect ratio similarity And area similarity ;
[0070] Comprehensive similarity calculation module, used to calculate the similarity of video frames i and video frames i-1 The category similarity, coordinate similarity, color feature similarity, aspect ratio similarity and area similarity between the detected targets are calculated in the video frame i and video frames i-1 The comprehensive similarity between the detected targets S :
[0071] ;
[0072] in For video frames i The coordinate similarity of the corresponding bounding box in ; For video frames i Adaptive weights for the coordinate similarity of the corresponding bounding boxes in ; For video frames i Similarity of color features of corresponding bounding boxes in ; For video frames i Adaptive weights for the similarity of color features of the corresponding bounding boxes in ; For video frames i Similarity of aspect ratio of corresponding bounding boxes in ; For video frames i Adaptive weights for the aspect ratio similarity of the corresponding bounding boxes in ; For video frames i The area similarity of the corresponding bounding box in ; For video frames i Adaptive weights for the area similarity of the corresponding bounding boxes in ; For video frames i The category similarity of the corresponding detection target in the video frame is combined with the Hungarian algorithm and the comprehensive similarity i and video frames i-1 Detect the target in the matching;
[0073] The target matching module is used to match video frames with the Hungarian algorithm and comprehensive similarity. i and video frames i-1 Detect the target in the matching;
[0074] The trajectory table maintenance module is used to record video frames for successfully matched detection targets i and video frames i-1Detect the target number of the target and update the trajectory maintenance table;
[0075] The tracking output module is used to output the tracking result of each target in the video stream according to the updated trajectory maintenance table.
[0076] Beneficial Effects
[0077] The technical solution of this application has the following beneficial effects:
[0078] The low frame rate video stream multi-target tracking method of the present application obtains comprehensive similarity by integrating the distance between the center points of the integrated bounding box, color distribution similarity, aspect ratio similarity, area similarity, category similarity, etc., and matches the image targets with the comprehensive similarity to achieve target tracking. It does not need to rely on computationally intensive matching strategies or deep learning feature extraction methods, and has the characteristics of low computing cost, high real-time performance and strong robustness. At the same time, the method can dynamically adjust the results of the comprehensive similarity based on environmental conditions and target occlusion conditions, so as to further improve the robustness of the matching results and improve the accuracy of the matching results. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] Figure 1 This is a flowchart of a method for tracking multiple targets in a low frame rate video stream in an embodiment of the present application.
[0080] Figure 2 2 is a structural diagram of a multi-target tracking device with a low frame rate video stream in an embodiment of the present application.
[0081] Figure 3 This is a structural diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0082] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Therefore, it should be appreciated by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without making creative work are within the scope of protection of the present application.
[0083] Combination Figure 1 As shown, the embodiment of the present application specifically discloses a low frame rate video stream multi-target tracking method, which includes the following steps:
[0084] Step 1: Get video frames based on image recognition algorithm i and video frames i-1The bounding box, category and target number of each detected target. It should be noted that the image recognition algorithm described in step one can adopt the AdaBoost classifier based on Haar features or the deep learning model using the MobileNet architecture. Of course, other lightweight target detection algorithms can also be used. It should be understood that the detection target identified and obtained in this step one uses the image recognition algorithm to calibrate the bounding box size and position of the target detection, and the corresponding type will be identified for the detection targets in different bounding boxes. This type is mainly used to distinguish the types of detection targets, such as different types of targets such as people, cars, trees, animals, buildings, etc., and their type attributes are different.
[0085] Step 2: Based on the video frame i and video frames i-1 Whether the categories of the detected targets are the same, calculate the video frame i and video frames i-1 The category similarity of the detected targets of the same category in .
[0086] Specifically, in this step, for the video frame i and video frames i-1 The specific calculation steps for the category similarity of the detection targets of the same category in are:
[0087] First get the video frame i and video frames i-1 The category of the detection target to be matched;
[0088] Secondly, according to the video frame i and video frames i-1 The category of the detected target to be matched in the video frame is calculated i and video frames i-1 The category similarity of the detection targets to be matched :
[0089] ;
[0090] in For video frames i The category of the detected target; For video frames i-1 The category of the detected target.
[0091] It should be understood that the category similarity in step two is judged based on the category attributes of the detection target pre-identified and marked in step one. For example, in adjacent video frames, the category of the detection target selected in the previous video frame is human, and the category of the detection target selected in the subsequent video frame is also human, which indicates that the detection target selected in the subsequent video frame has the possibility of being the same as the detection target in the previous video frame, which needs to be further judged in subsequent steps; and if in adjacent video frames, the category of the detection target selected in the previous video frame is human, and the category of the detection target selected in the subsequent video frame is car, which indicates that the detection target selected in the subsequent video frame does not have the possibility of being the same as the detection target in the previous video frame, and no subsequent steps are required for further judgment or the weight of the judgment result is reduced in the subsequent steps.
[0092] Step 3: Get video frames i and video frames i-1 The bounding boxes of the detected targets of the same category in the video are obtained, and the video frames are obtained according to the bounding boxes. i and video frames i-1 The coordinate similarity of the detected targets of the same category in , color feature similarity , aspect ratio similarity And area similarity .
[0093] Specifically, the method for obtaining each similarity in the above step 3 is:
[0094] (1) Get video frames i and video frames i-1 The center coordinates of the bounding box of the detected target of the same category in the video frame are calculated based on the center coordinates of the bounding box. i and video frames i-1 The coordinate similarity of the detected targets of the same category in .
[0095] Specifically, the coordinate similarity is calculated based on the center coordinates of the bounding box, and the specific steps include:
[0096] First get the video frame i At least one set of diagonal coordinates of the bounding box of the detected object in A i,cor , B i,cor )and( a i,cor , b i,cor ); and get the video frame i-1 At least one set of diagonal coordinates of the bounding box of the detected object in A i-1,cor ,B i-1,cor )and( a i-1,cor , b i-1,cor ); It should be understood that when the bounding box (generally a rectangular bounding box) of the detection target is obtained using the image recognition algorithm in step one, the diagonal coordinates of the bounding box will be obtained at the same time. At this time, any diagonal coordinate can be selected to define the position information of the bounding box.
[0097] Secondly, according to the video frame i The diagonal coordinates of the bounding box of the detected target are calculated to obtain the video frame i The center coordinates of the bounding box of the detected object ( X i,cen , Y i,cen ):
[0098] ;
[0099] Again according to the video frame i-1 The diagonal coordinates of the bounding box of the detected target are calculated to obtain the video frame i-1 The center coordinates of the bounding box of the detected object ( X i-1,cen , Y i-1,cen ):
[0100] ;
[0101] Finally, according to the video frame i and video frames i-1 The center coordinates of the bounding box of the detected target are calculated to obtain the video frame i With video frame i-1 The coordinate similarity of the bounding box of the detected target for:
[0102] .
[0103] It should be understood that the coordinate similarity can be used to determine potential matching targets within a specific distance around the detection target. By setting a screening threshold for coordinate similarity, potential matching detection targets within a certain distance of a target can be selected to reduce the amount of data for subsequent matching and improve matching efficiency. It should also be noted that the screening threshold for coordinate similarity can generally be estimated based on the time interval between data frames and the moving speed of the detection target.
[0104] (2) Get video frames i and video frames i-1 The color distribution matrix within the bounding box of the detected target of the same category in the video frame is calculatedi and video frames i-1 The color feature similarity of the detection targets of the same category in ;
[0105] Specifically, the color feature similarity is calculated based on the color distribution within the bounding box, and the specific calculation steps include:
[0106] First, the video frame i and video frames i-1 The color distribution matrix is extracted from the bounding box of the detected target of the same category in the image; the color distribution matrix can effectively indicate the color distribution in the image, it does not require color space quantization, and the feature vector dimension is low. In practical applications, it is often used to filter images to narrow the retrieval range.
[0107] Next, the video frame i and video frames i-1 The RGB images in the image are converted into HSV images respectively; when using RGB images, the RGB values of the detection target may change significantly due to changes in light, increasing the difficulty of recognition. Therefore, the image is converted to an HSV image. By setting a relatively stable hue and saturation range, the color of the detection target can be accurately identified without being greatly affected by changes in lighting.
[0108] Extract the video frames separately again i and video frames i-1 The region of interest in the bounding box is defined, and RoI Align is used to scale the region of interest to a uniform scale; it should be understood that the region of interest refers to the part of the image that is of special concern or that you want to process or analyze. The region of interest can help us focus on operating on a specific area, thereby improving processing efficiency and accuracy. By defining the region of interest, it is convenient to further extract various feature information in the area.
[0109] Then calculate the video frames separately i and video frames i-1 The structural similarity index (SSIM) of the region of interest in , specifically, the calculation method of the structural similarity index (SSIM) is:
[0110] ;
[0111] in For video frames i The average value of the data in the region of interest; For video frames i-1 The average value of the data in the region of interest; For video frames i The variance of the data in the region of interest; For video frames i-1The variance of the data in the region of interest; For video frames i and video frames i-1 The covariance of the data within the region of interest; C 1 and C 2 is a constant used to stabilize the calculation;
[0112] The last video frame i and video frames i-1 The color feature similarity of the detection targets of the same category For video frames i and video frames i-1 Structural similarity index of the region of interest in .
[0113] It should be understood that the structural similarity index is an indicator to measure the similarity between two images. It measures the similarity of images from three aspects: brightness, contrast, and structure. The range of the structural similarity index is generally 0 to 1. When two images are exactly the same, the value of SSIM is equal to 1, that is, the closer the value of SSIM is to 1, the higher the similarity of the two images. Similarly, the closer the color feature similarity is to 1, the higher the similarity of the images of the detected targets in adjacent video frames.
[0114] (3) Get video frames i and video frames i-1 The aspect ratio of the bounding box of the detected target of the same category in the video frame is calculated i and video frames i-1 The similarity of aspect ratios of detected objects of the same category in ;
[0115] Specifically, in this step, the video frame is calculated i and video frames i-1 The similarity of aspect ratios of detected objects of the same category in The steps include:
[0116] First get the video frame i At least one set of diagonal coordinates of the bounding box of the detected object in A i,cor , B i,cor )and( a i,cor , b i,cor ); and get the video frame i-1 At least one set of diagonal coordinates of the bounding box of the detected object in A i-1,cor , B i-1,cor )and( ai-1,cor , b i-1,cor ); It should be understood that when the bounding box (generally a rectangular bounding box) of the detection target is obtained using the image recognition algorithm in step one, the diagonal coordinates of the bounding box will be obtained at the same time. At this time, any diagonal coordinate can be selected to define the position information of the bounding box.
[0117] Secondly, calculate the video frames separately i and video frames i-1 The aspect ratio of the bounding box of the detected target of the same category in :
[0118] ;
[0119] It should be understood that, since the bounding box obtained in the image recognition process is generally a regular shape, the length and width data of the bounding box can be obtained through any diagonal coordinates of the bounding box, and then the length-to-width ratio of the bounding box can be compared.
[0120] Then according to the video frame i and video frames i-1 Calculate the aspect ratio of the bounding box in the video frame i and video frames i-1 The similarity of the aspect ratio of the detected targets of the same category :
[0121] ;
[0122] in For video frames i The aspect ratio of the bounding box of the detected target of the same category in ; For video frames i-1 The aspect ratio of the bounding box of the detected objects of the same category in .
[0123] It should be understood that for the same detection target, the aspect ratio of the bounding box is generally consistent, and for the detection targets of the same category, the aspect ratio of the bounding box is generally slightly different. For example, when the detection target is a person or a vehicle, the aspect ratio of the two is quite different; when the detection target is an adult or a child, the aspect ratio of the two is different, but the difference is small. i and video frames i-1 The closer the aspect ratio similarity of the detection targets of the same category is to 1, the greater the probability that the detection targets in adjacent video frames are the same detection target.
[0124] (4) Get video frames i and video frames i-1 The area of the bounding box of the detected target of the same category in the video frame is calculated i and video frames i-1The area similarity of the detected targets of the same category in It should be understood that the purpose of calculating the area similarity of the detection target in this step is mainly to determine whether the distance of the detection target in adjacent video frames is consistent. Generally, the farther the detection target position in the image, the smaller the target, which will cause the error of the aspect ratio and color distribution results to become larger.
[0125] Specifically, for the calculation video frame i and video frames i-1 The area similarity of the detected targets of the same category in The steps include:
[0126] First get the video frame i At least one set of diagonal coordinates of the bounding box of the detected object in A i,cor , B i,cor )and( a i,cor , b i,cor ); and get the video frame i-1 At least one set of diagonal coordinates of the bounding box of the detected object in A i-1,cor , B i-1,cor )and( a i-1,cor , b i-1,cor ); It should be understood that when the bounding box (generally a rectangular bounding box) of the detection target is obtained using the image recognition algorithm in step one, the diagonal coordinates of the bounding box will be obtained at the same time. At this time, any diagonal coordinate can be selected to define the position information of the bounding box.
[0127] Secondly, calculate the video frames separately i and video frames i-1 The pixel area of the bounding box in:
[0128] ;
[0129] Finally, according to the video frame i and video frames i-1 Calculate the pixel area of the bounding box in the video frame i and video frames i-1 The area similarity of the detected targets of the same category in :
[0130] ;
[0131] in For video frames i The pixel area of the middle bounding box; For video frames i-1 The pixel area of the bounding box in .
[0132] It should be noted that, when the area similarity is closer to 1, it indicates that the bounding box areas in adjacent video frames tend to be the same, and it also indicates that the probability that the detected targets in adjacent video frames are the same target is greater.
[0133] Step 4: Based on the video frame i and video frames i-1 The category similarity, coordinate similarity, color feature similarity, aspect ratio similarity and area similarity between the detected targets are calculated in the video frame i and video frames i-1 The comprehensive similarity between the detected targets S :
[0134] ;
[0135] in For video frames i The coordinate similarity of the corresponding bounding box in ; For video frames i Adaptive weights for the coordinate similarity of the corresponding bounding boxes in ; For video frames i Similarity of color features of corresponding bounding boxes in ; For video frames i Adaptive weights for the similarity of color features of the corresponding bounding boxes in ; For video frames i Similarity of aspect ratio of corresponding bounding boxes in ; For video frames i Adaptive weights for the aspect ratio similarity of the corresponding bounding boxes in ; For video frames i The area similarity of the corresponding bounding box in ; For video frames i Adaptive weights for the area similarity of the corresponding bounding boxes in ; For video frames i The category similarity of the corresponding detection target.
[0136] It should be noted that when calculating the comprehensive similarity in the embodiment of the present application, not only parameters such as target distance, color features, and size features are considered, but also parameters such as category features and area features are added as similarity parameters, and the comprehensive calculation obtains the similarity of targets between adjacent video frames. In addition, in the process of calculating the comprehensive similarity, various similarity parameters corresponding to the detected targets under different lighting conditions and different distance conditions are dynamically adjusted in a targeted manner, so that the result of the comprehensive similarity is adjusted accordingly based on the environmental state and the target state to improve the accuracy of the result and the precision of the matching result.
[0137] Specifically, in the embodiment of the present application, when calculating the video frame i and video frames i-1 The comprehensive similarity between the detected targets S , dynamically taking values for the adaptive weights of the coordinate similarity, color feature similarity, aspect ratio similarity, and area similarity, respectively, and the specific steps include:
[0138] First get the video frame i Ambient brightness L i And the occlusion score of the detected target M i It should be understood that the ambient brightness of the target in the video frame can be measured by professional image processing software, such as Adobe Photoshop, GIMP, etc., to measure the brightness value or brightness statistics around the detected target in the image, or by counting the brightness values of each pixel in the bounding box and performing statistical analysis to obtain the overall brightness value of the bounding box. Of course, specific equipment (such as a camera or video camera with a brightness sensor) can also be used to directly capture images, and relevant brightness data can be directly obtained from the device. The occlusion score of the target in the video frame can be identified and evaluated through some predefined or pre-trained neural network learning models.
[0139] Secondly, according to the video frame i The ambient brightness of the target to be detected L i and occlusion score M i Adjust video frame i The adaptive weight corresponding to the detected target:
[0140] (1) The video frame i The adaptive weight of the coordinate similarity of the corresponding detection target for:
[0141] ;
[0142] The above formula is intended to show that the adaptive weight of the coordinate similarity is related to the ambient brightness of the detected target. L i And the occlusion score M iThe accuracy of the bounding box detected by the image recognition algorithm will be improved, and the coordinates of the bounding box will be more accurate. The accuracy of the matching result using the coordinate similarity will be better. Therefore, the adaptive weight of the coordinate similarity is positively correlated with the ambient brightness; and as the degree of occlusion of the detected target in the image increases (the higher the occlusion score), the bounding box of the identified detected target cannot accurately cover the detected target, and the accuracy of the matching result using the coordinate similarity of the bounding box will decrease. Therefore, the weight of the coordinate similarity needs to be appropriately reduced at this time. Therefore, the adaptive weight of the coordinate similarity is negatively correlated with the occlusion score.
[0143] (2) The video frame i The adaptive weight of the color feature similarity of the corresponding detection target for:
[0144] ;
[0145] The above formula is intended to show that the adaptive weight of the color feature similarity is related to the ambient brightness of the detection target. L i And the occlusion score M i The color distribution in the bounding box of the detected target in the image is clearer as the ambient brightness increases, and the color distribution data detected by the image recognition algorithm is more accurate. At this time, the accuracy of the matching result using the color feature similarity is better, so the adaptive weight of the color feature similarity is positively correlated with the ambient brightness; and as the degree of occlusion of the detected target in the image increases (the higher the occlusion score), the color distribution in the bounding box of the detected target decreases, and the accuracy of the matching result using the color feature similarity in the bounding box will decrease. Therefore, the weight of the color feature similarity needs to be appropriately reduced at this time, so the adaptive weight of the color feature similarity is negatively correlated with the occlusion score.
[0146] (3) The video frame i The adaptive weight of the area similarity of the corresponding detection target for:
[0147] ;
[0148] The above formula is intended to show that the adaptive weight of the area similarity is related to the ambient brightness of the detection target. L i And the occlusion score M iThe accuracy of the bounding box detected by the image recognition algorithm will be improved, and the calculated bounding box area will be more accurate. The accuracy of the matching result using area similarity will be better. Therefore, the adaptive weight of area similarity is positively correlated with the ambient brightness. As the degree of occlusion of the detected target in the image increases (the higher the occlusion score), the bounding box of the identified detected target cannot accurately cover the detected target. At this time, the area value of the bounding box decreases, and the accuracy of the matching result using the area similarity of the bounding box will decrease. Therefore, the weight of area similarity needs to be appropriately reduced at this time. Therefore, the adaptive weight of area similarity is negatively correlated with the occlusion score.
[0149] (4) The video frame i The adaptive weight of the aspect ratio similarity of the corresponding detection target for:
[0150] ;
[0151] The above formula is intended to show that the adaptive weight of the aspect ratio similarity is related to the ambient brightness of the detected target. L i And the area similarity, where as the ambient brightness increases, the target in the image is clearer, the edge of the bounding box of the detected target in the image is clearer, and the accuracy of the bounding box detected by the image recognition algorithm will be improved. At this time, the length and width data of the bounding box are more accurate, and the accuracy of the matching result using aspect ratio similarity is better. Therefore, the adaptive weight of aspect ratio similarity is positively correlated with the ambient brightness; and as the area similarity of the detected target in the image becomes lower, it indicates that there is a difference in distance or occlusion between the detected targets in adjacent video frames. At this time, the accuracy of the matching result using the aspect ratio similarity of the bounding box will decrease. Therefore, the weight of aspect ratio similarity needs to be appropriately reduced at this time. Therefore, the adaptive weight of aspect ratio similarity is positively correlated with area similarity.
[0152] It should be understood that the above They are correction coefficients respectively, and the correction coefficients can be obtained by training the image with a neural training model for environment brightness, occlusion, target matching, etc.
[0153] Step 5: Combine the Hungarian algorithm and comprehensive similarity to compare video frames i and video frames i-1 Detect the target for matching.
[0154] Specifically, the Hungarian algorithm in step 5 is an algorithm for solving the bipartite graph matching problem. It can be used to find the maximum number of matches in the bipartite graph and applied to the video frame for target matching. It can find the optimal target matching solution in adjacent images so that the cost matrix after matching is minimized. The specific steps of the matching process are:
[0155] First get the video frame i and video frames i-1 The comprehensive similarity between the detection targets S ;
[0156] Secondly, judge the video frame i and video frames i-1 The comprehensive similarity between the detection targets S Whether it is greater than a preset threshold;
[0157] If the comprehensive similarity is greater than the preset threshold, the video frame is maintained. i and video frames i-1 The comprehensive similarity between the detection targets; if the comprehensive similarity is less than or equal to the preset threshold, the video frame is discarded i and video frames i-1 The comprehensive similarity corresponding to the detection targets between them is calculated, and the next detection target is replaced; some matching targets with low comprehensive similarity can be preliminarily screened out through the preset threshold, reducing the matching amount of the subsequent Hungarian algorithm and improving the matching efficiency.
[0158] Finally, based on the Hungarian algorithm, the video frames i and video frames i-1 One-to-one matching is performed between the detection targets to obtain the video frame i and video frames i-1 The matching results of the detection targets.
[0159] Step 6: Record video frames for successfully matched detection targets i and video frames i-1 The target number of the detected target is updated and the track maintenance table is updated. It should be understood that each detected target in each video frame has a unique target number. When the detected targets between adjacent video frames are successfully matched, the target number of the successfully matched detected target can be recorded. For the same target in the video stream, its track maintenance table can be recorded as a series of target number matching pairs arranged in chronological order. Of course, each target number can correspond to the bounding box, category and other information of the detected target.
[0160] In addition, for the successfully matched detection targets, if the comprehensive similarity between adjacent video frames is always higher than or equal to the preset threshold within the preset time period or the preset number of video frames, it indicates that the probability of belonging to the same target is relatively high, and the target number in the current trajectory maintenance table is maintained and updated; however, if the comprehensive similarity of the detection targets between adjacent video frames is lower than the preset threshold within the preset time period or the preset number of video frames, it indicates that the trajectory composed of the current target number matching pair does not belong to the same target, and the target number corresponding to the detection target in the trajectory maintenance table is deleted.
[0161] Step 7: Output the tracking result of each target in the video stream according to the updated trajectory maintenance table.
[0162] The embodiment of the present application obtains comprehensive similarity by calculating comprehensive category similarity, coordinate similarity, color feature similarity, aspect ratio similarity and area similarity, and matches image targets with the comprehensive similarity to achieve target tracking. It does not need to rely on computationally intensive matching strategies or deep learning feature extraction methods, and has the characteristics of low computing cost, high real-time performance and strong robustness. At the same time, the method can dynamically adjust the results of the comprehensive similarity based on environmental conditions and target occlusion conditions, so as to further improve the robustness of the matching results and improve the accuracy of the matching results.
[0163] In addition, combined Figure 2 As shown, the present application also discloses a low frame rate video stream multi-target tracking device, the device comprising:
[0164] Target recognition module, used to obtain video frames based on image recognition algorithms i and video frames i-1 The bounding box, category and target number of each detected target in;
[0165] The first calculation module is used to calculate the video frame i and video frames i-1 Detect whether the target category is the same and output the video frame i and video frames i-1 The category similarity of the detected targets of the same category in ;
[0166] The second computing module is used to obtain the video frame i and video frames i-1 The bounding boxes of the detected targets of the same category in the video are obtained, and the video frames are obtained according to the bounding boxes. i and video frames i-1 The coordinate similarity of the detected targets of the same category in , color feature similarity , aspect ratio similarity And area similarity ;
[0167] Comprehensive similarity calculation module, used to calculate the similarity of video frames i and video frames i-1 The category similarity, coordinate similarity, color feature similarity, aspect ratio similarity and area similarity between the detected targets are calculated in the video frame i and video frames i-1 The comprehensive similarity between the detected targets S :
[0168] ;
[0169] in For video frames i The coordinate similarity of the corresponding bounding box in ; For video frames i Adaptive weights for the coordinate similarity of the corresponding bounding boxes in ; For video frames i Similarity of color features of corresponding bounding boxes in ; For video frames i Adaptive weights for the similarity of color features of the corresponding bounding boxes in ; For video frames i Similarity of aspect ratio of corresponding bounding boxes in ; For video frames i Adaptive weights for the aspect ratio similarity of the corresponding bounding boxes in ; For video frames i The area similarity of the corresponding bounding box in ; For video frames i Adaptive weights for the area similarity of the corresponding bounding boxes in ; For video frames i The category similarity of the corresponding detection target in the video frame is combined with the Hungarian algorithm and the comprehensive similarity i and video frames i-1 Detect the target in the matching;
[0170] The target matching module is used to match video frames with the Hungarian algorithm and comprehensive similarity. i and video frames i-1 Detect the target in the matching;
[0171] The trajectory table maintenance module is used to record video frames for successfully matched detection targets i and video frames i-1 Detect the target number of the target and update the trajectory maintenance table;
[0172] The tracking output module is used to output the tracking result of each target in the video stream according to the updated trajectory maintenance table.
[0173] The device provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented by the method embodiment will not be described again here.
[0174] like Figure 3 As shown, the embodiment of the present application also provides an electronic device, including a processor and a memory, a program or instruction stored in the memory and executable on the processor, and when the program or instruction is executed by the processor, the following is achieved: Figure 1 The various processes of the method embodiment shown in the figure can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0175] The embodiment of the present application also provides a readable storage medium on which a program or instruction is stored. When the program or instruction is executed by a processor, the above Figure 1 The various processes of the method embodiments described above can achieve the same technical effect, and will not be described again here to avoid repetition.
[0176] The present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the above Figure 1 The various processes of the method embodiments described above can achieve the same technical effect, and will not be described again here to avoid repetition.
[0177] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned sequence numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0178] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0179] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another device, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0180] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0181] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0182] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.
[0183] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can essentially or in other words, the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a device (which can be a terminal or a platform, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0184] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A multi-target tracking method for low frame rate video stream, characterized in that: The steps include: Get video frames based on image recognition algorithm i and video frames i-1 The bounding box, category and target number of each detected target in; Based on the video frame i and video frames i-1 Whether the categories of the detected targets are the same, calculate the video frame i and video frames i-1 The category similarity between detected targets of the same category in ; Get video frame i and video frames i-1 The bounding boxes of the detected targets of the same category in the video are obtained, and the video frames are obtained according to the bounding boxes. i and video frames i-1 The coordinate similarity of the detected targets of the same category in , color feature similarity , aspect ratio similarity And area similarity ; Based on the video frame i and video frames i-1 The category similarity, coordinate similarity, color feature similarity, aspect ratio similarity and area similarity between the detected targets are calculated in the video frame i and video frames i-1 The comprehensive similarity between the detected targets S : ; in For video frames i The coordinate similarity of the corresponding bounding box in ; For video frames i Adaptive weights for the coordinate similarity of the corresponding bounding boxes in ; For video frames i Similarity of color features of corresponding bounding boxes in ; For video frames i Adaptive weights for the similarity of color features of the corresponding bounding boxes in ; For video frames i Similarity of aspect ratio of corresponding bounding boxes in ; For video frames i Adaptive weights for the aspect ratio similarity of the corresponding bounding boxes in ; For video frames i The area similarity of the corresponding bounding box in ; For video frames i Adaptive weights for the area similarity of the corresponding bounding boxes in ; For video frames i The category similarity of the corresponding detection target; Combining the Hungarian algorithm and comprehensive similarity to compare video frames i and video frames i-1 Detect the target in the matching; For successfully matched detection targets, record video frames i and video frames i-1 Detect the target number of the target and update the trajectory maintenance table; Output the tracking result of each target in the video stream according to the updated trajectory maintenance table.
2. The low frame rate video stream multi-target tracking method according to claim 1, characterized in that: The calculated video frame i and video frames i-1 The category similarity of the detected targets of the same category in The steps are: Get video frame i and video frames i-1 The category of the detection target to be matched; Based on the video frame i and video frames i-1 The category of the detected target to be matched in the video frame is calculated i and video frames i-1 The category similarity of the detection targets to be matched : ; in For video frames i The category of the detected target; For video frames i-1 The category of the detected target.
3. The low frame rate video stream multi-target tracking method according to claim 2, characterized in that: The calculated video frame i and video frames i-1 The coordinate similarity of the detected targets of the same category in includes: Get video frame i At least one set of diagonal coordinates of the bounding box of the detected object in A i,cor , B i,cor )and( a i,cor , b i,cor ); and get the video frame i-1 At least one set of diagonal coordinates of the bounding box of the detected object in A i-1,cor , B i-1,cor )and( a i-1,cor , b i-1,cor ); Based on the video frame i The diagonal coordinates of the bounding box of the detected target are calculated to obtain the video frame i The center coordinates of the bounding box of the detected object ( X i,cen , Y i,cen ): ; Based on the video frame i-1 The diagonal coordinates of the bounding box of the detected target are calculated to obtain the video frame i-1 The center coordinates of the bounding box of the detected object ( X i-1,cen , Y i-1,cen ): ; Based on the video frame i and video frames i-1 The center coordinates of the bounding box of the detected target are calculated to obtain the video frame i With video frame i-1 The coordinate similarity of the bounding box of the detected target for: 。 4. The low frame rate video stream multi-target tracking method according to claim 3 is characterized in that: The calculated video frame i and video frames i-1 The color feature similarity of the detection targets of the same category in The steps include: Video Frame i and video frames i-1 The bounding box of the detected target of the same category in extracts the color distribution matrix; Video Frame i and video frames i-1 The RGB images in are converted into HSV images respectively; Extract video frames separately i and video frames i-1 The region of interest in the bounding box is selected and scaled to a uniform scale using RoI Align. Calculate video frames separately i and video frames i-1 Structural similarity index of the region of interest in : ; in For video frames i The average value of the data in the region of interest; For video frames i-1 The average value of the data in the region of interest; For video frames i The variance of the data in the region of interest; For video frames i-1 The variance of the data in the region of interest; For video frames i and video frames i-1 The covariance of the data within the region of interest; C 1 and C 2 is a constant used to stabilize the calculation; The video frame i and video frames i-1 The color feature similarity of the detection targets of the same category For video frames i and video frames i-1 Structural similarity index of the region of interest in .
5. The low frame rate video stream multi-target tracking method according to claim 4, characterized in that: The calculated video frame i and video frames i-1 The similarity of aspect ratios of detected objects of the same category in The steps include: Get video frame i At least one set of diagonal coordinates of the bounding box of the detected object in A i,cor , B i,cor )and( a i,cor , b i,cor ); and get the video frame i-1 At least one set of diagonal coordinates of the bounding box of the detected object in A i-1,cor , B i-1,cor )and( a i-1,cor , b i-1,cor ); Calculate video frames separately i and video frames i-1 The aspect ratio of the bounding box of the detected target of the same category in : ; Based on the video frame i and video frames i-1 Calculate the aspect ratio of the bounding box in the video frame i and video frames i-1 The similarity of the aspect ratio of the detected targets of the same category : ; in For video frames i The aspect ratio of the bounding box of the detected target of the same category in ; For video frames i-1 The aspect ratio of the bounding box of the detected objects of the same category in .
6. The method for tracking multiple targets in a low frame rate video stream according to claim 5, characterized in that: The calculated video frame i and video frames i-1 The area similarity of the detected targets of the same category in The steps include: Get video frame i At least one set of diagonal coordinates of the bounding box of the detected object in A i,cor , B i,cor )and( a i,cor , b i,cor ); and get the video frame i-1 At least one set of diagonal coordinates of the bounding box of the detected object in A i-1,cor , B i-1,cor )and( a i-1,cor , b i-1,cor ); Calculate video frames separately i and video frames i-1 The pixel area of the bounding box in: ; Based on the video frame i and video frames i-1 Calculate the pixel area of the bounding box in the video frame i and video frames i-1 The area similarity of the detected targets of the same category in : ; in For video frames i The pixel area of the middle bounding box; For video frames i-1 The pixel area of the bounding box in .
7. The low frame rate video stream multi-target tracking method according to claim 1, characterized in that: The Hungarian algorithm and the comprehensive similarity are combined to detect the video frames. i and video frames i-1 The steps for detecting and matching targets include: Get video frame i and video frames i-1 The comprehensive similarity between the detection targets S ; Determine video frame i and video frames i-1 The comprehensive similarity between the detection targets S Whether it is greater than a preset threshold; If the comprehensive similarity is greater than the preset threshold, the video frame is maintained i and video frames i-1 The comprehensive similarity corresponding to the detection target between the two frames; if the comprehensive similarity is less than or equal to the preset threshold, the video frame is discarded i and video frames i-1 The comprehensive similarity corresponding to the detection targets between them is calculated, and the next detection target is replaced; Based on the Hungarian algorithm, video frames i and video frames i-1 One-to-one matching is performed between the detection targets to obtain the video frame i and video frames i-1 The matching results of the detection targets.
8. The method for tracking multiple targets in a low frame rate video stream according to claim 6, characterized in that: When calculating video frames i and video frames i-1 The comprehensive similarity between the detected targets S When , the step of taking values of the adaptive weights of the coordinate similarity, color feature similarity, aspect ratio similarity and area similarity comprises: Get video frame i Ambient brightness L i And the occlusion score of the detected target M i ; Based on the video frame i The ambient brightness of the target to be detected L i and occlusion score M i Adjust video frame i The adaptive weight corresponding to the detected target: The video frame i The adaptive weight of the coordinate similarity of the corresponding detection target in for: ; The video frame i The adaptive weight of the color feature similarity of the corresponding detection target for: ; The video frame i The adaptive weight of the area similarity of the corresponding detection target for: ; The video frame i The adaptive weight of the aspect ratio similarity of the corresponding detection target for: ; in are the correction coefficients respectively.
9. The method for tracking multiple targets in a low frame rate video stream according to claim 7, characterized in that: For successfully matched detection targets, if the comprehensive similarity between adjacent video frames is always higher than or equal to the preset threshold within a preset time period or a preset number of video frames, the target number in the current trajectory maintenance table is maintained and updated; if the comprehensive similarity of detection targets between adjacent video frames is lower than the preset threshold within a preset time period or a preset number of video frames, the target number of the corresponding detection target in the trajectory maintenance table is deleted.
10. A low frame rate video stream multi-target tracking device, characterized in that: The device comprises: Target recognition module, used to obtain video frames based on image recognition algorithms i and video frames i-1 The bounding box, category and target number of each detected target in; The first calculation module is used to calculate the video frame i and video frames i-1 Whether the categories of the detected targets are the same, calculate the video frame i and video frames i-1 The category similarity of the detected targets of the same category in ; The second computing module is used to obtain the video frame i and video frames i-1 The bounding boxes of the detected targets of the same category in the video are obtained, and the video frames are obtained according to the bounding boxes. i and video frames i-1 The coordinate similarity of the detected targets of the same category in , color feature similarity , aspect ratio similarity And area similarity ; Comprehensive similarity calculation module, used to calculate the similarity of video frames i and video frames i-1 The category similarity, coordinate similarity, color feature similarity, aspect ratio similarity and area similarity between the detected targets are calculated in the video frame i and video frames i-1 The comprehensive similarity between the detected targets S : ; in For video frames i The coordinate similarity of the corresponding bounding box in ; For video frames i Adaptive weights for the coordinate similarity of the corresponding bounding boxes in ; For video frames i Similarity of color features of corresponding bounding boxes in ; For video frames i Adaptive weights for the similarity of color features of the corresponding bounding boxes in ; For video frames i Similarity of aspect ratio of corresponding bounding boxes in ; For video frames i Adaptive weights for the aspect ratio similarity of the corresponding bounding boxes in ; For video frames i The area similarity of the corresponding bounding box in ; For video frames i Adaptive weights for the area similarity of the corresponding bounding boxes in ; For video frames i The category similarity of the corresponding detection target; The target matching module is used to match video frames with the Hungarian algorithm and comprehensive similarity. i and video frames i-1 Detect the target in the matching; The trajectory table maintenance module is used to record video frames for successfully matched detection targets i and video frames i-1 Detect the target number of the target and update the trajectory maintenance table; The tracking output module is used to output the tracking result of each target in the video stream according to the updated trajectory maintenance table.
