Target tracking method, device, medium and electronic equipment
By using the target detection frame and occlusion detection frame in the target tracking method to update the historical record and regulate the health value of the tracking frame, the problem of tracking loss when the target is occluded for a long time is solved, and a more complete target tracking record is achieved.
Patent Information
- Application Number
- CN202311437340.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-31
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2043-10-31
AI Technical Summary
Existing target tracking methods are prone to losing tracking when targets are occluded for a long time and at high frequencies, resulting in missed detections and fragmented trajectories.
By obtaining the target detection frame and occlusion detection frame of the surveillance video stream, the historical target tracking records are updated, the health value of the target tracking frame is adjusted so that it is not lower than the preset minimum value when it is blocked, and the tracking when blocked is saved. information, and delete records with health values less than the minimum value.
It provides a more complete historical target tracking record, avoids tracking loss, and enhances the ability to preserve target information under occlusion.
Smart Images

Figure CN117876418B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer vision and relates to a target tracking method, and in particular to a target tracking method, device, medium and electronic device. Background Art
[0002] Object tracking is an important research direction in the field of computer vision, especially in areas such as unmanned driving, monitoring systems and robot navigation. In recent years, with the rapid development of deep learning technology, object detection and tracking algorithms have made significant breakthroughs.
[0003] ByteTrack is a tracking method based on the tracking-by-detection paradigm. Most multi-target tracking methods obtain target IDs by associating detection boxes with scores above a threshold. Targets with low detection scores, such as occluded targets, are simply discarded, which brings non-negligible problems, including a large number of missed detections and fragmented tracks. Therefore, current target tracking methods have the problem of tracking loss when the target is occluded for a long time and at a high frequency. Summary of the invention
[0004] The purpose of the present application is to provide a target tracking method, device, medium and electronic device for solving the problem of tracking loss caused by the target being blocked for a long time and at a high frequency in the current target tracking method.
[0005] In a first aspect, the present application provides a target tracking method, including: S1, obtaining a target detection frame and an occlusion detection frame of a current frame of a surveillance video stream; S2, updating a historical target tracking record based on the target detection frame and the occlusion detection frame to obtain an updated historical target tracking record, wherein the historical target tracking record includes the coordinates, life value, whether it is blocked and whether it is matched of the target tracking frame, and if the target tracking frame does not match the target detection frame during the update process, then when the target tracking frame is blocked, its life value remains unchanged, and when the target tracking frame is not blocked, its life value is subtracted from a preset life change amount, otherwise the life value of the target tracking frame is added to the preset life change amount; S3, deleting information associated with a target tracking frame whose life value is less than a preset minimum life value in the updated historical target tracking record, and returning to S1 after obtaining the next frame of the current frame, the current frame in S1 is the next frame of the current frame, and the historical target tracking record in S2 is the updated historical target tracking record.
[0006] In the target tracking method, the life value of the target tracking frame is regulated by the target detection frame and the occlusion detection frame, so that the life value will not be lower than the preset minimum life value when it is occluded, thereby saving the target tracking information when the target is occluded and providing a more complete historical target tracking record.
[0007] In one embodiment of the present application, the implementation method of updating the historical target tracking record based on the target detection frame and the occlusion detection frame to obtain the updated historical target tracking record includes: when the target detection frame does not exist, updating the historical target tracking record based on the occlusion detection frame to obtain the updated historical target tracking record; when the target detection frame exists, updating the historical target tracking record based on the target detection frame and the occlusion detection frame to obtain the updated historical target tracking record.
[0008] In one embodiment of the present application, when the target detection frame exists, the historical target tracking record is updated based on the target detection frame and the occlusion detection frame to obtain an updated historical target tracking record. The implementation method includes: when the historical target tracking record is an empty record, the empty record is updated based on the target detection frame to obtain the updated historical target tracking record, wherein the coordinates of the target tracking frame in the updated historical target tracking record are the coordinates of the target detection frame, the life value is the initial life value, whether it is occluded is no, and whether it is matched is no; when the historical target tracking record is not an empty record, the historical target tracking record is updated based on the target detection frame and the occlusion detection frame to obtain an updated historical target tracking record.
[0009] In one embodiment of the present application, when the historical target tracking record is not an empty record, the historical target tracking record is updated based on the target detection frame and the occlusion detection frame to obtain an updated historical target tracking record. The implementation method includes: setting whether the target tracking frame in the historical target tracking record is occluded to no, and whether it is matched to no; based on a preset target overlap rate threshold, matching the target detection frame and the target tracking frame in pairs to obtain the first updated historical target tracking record, and when the target detection frame matches the target tracking frame, updating whether the target detection frame is matched to yes, updating the coordinates of the target tracking frame to the coordinates of the target detection frame, and whether it is matched to no. Update is yes, whether it is blocked is updated to no, and the life value is added to the preset life change value; when whether the target detection frame is matched is no, information associated with a new target tracking frame is generated in the historical target tracking record updated for the first time to obtain the historical target tracking record updated for the second time, the coordinates of the new target tracking frame are the coordinates of the unmatched target detection frame, whether it is blocked is no, the life value is the initial life value, and whether it is matched is yes; when there is an unmatched target tracking frame in the historical target tracking record updated for the second time, based on the preset occlusion overlap rate threshold, the unmatched target tracking frame and the occlusion detection frame are processed to obtain the updated historical target tracking record.
[0010] In one embodiment of the present application, based on a preset target overlap rate threshold, the target detection frame and the target tracking frame are matched in pairs to obtain a first updated historical target tracking record. The implementation method includes: based on the coordinates of the target detection frame and the coordinates of the target tracking frame, obtaining an actual target overlap rate value, the actual target overlap rate value being the ratio of the intersection area of the target detection frame and the target tracking frame to the area of the target tracking frame; based on the actual target overlap rate value and the preset target overlap rate threshold, obtaining the first updated historical target tracking record, if the actual target overlap rate value is greater than the preset target overlap rate threshold, the target detection frame matches the target tracking frame, otherwise they do not match.
[0011] In one embodiment of the present application, based on a preset occlusion overlap rate threshold, an unmatched target tracking frame and the occlusion detection frame are processed to obtain the updated historical target tracking record. The implementation method includes: when whether the unmatched target tracking frame is occluded is no, based on the coordinates of the unmatched target tracking frame and the coordinates of the occlusion detection frame, a first actual occlusion overlap rate value is obtained, and the first actual occlusion overlap rate value is the ratio of the intersection area of the unmatched target tracking frame and the occlusion detection frame to the area of the unmatched target tracking frame; based on the first actual occlusion overlap rate value and the preset occlusion overlap rate threshold, the updated historical target tracking record is obtained, if the first actual occlusion overlap rate value is greater than the preset occlusion overlap rate threshold, whether the unmatched target tracking frame is occluded is updated to yes, otherwise the life value is subtracted from the preset life change amount.
[0012] In one embodiment of the present application, when the target detection frame does not exist, the historical target tracking record is updated based on the occlusion detection frame to obtain an updated historical target tracking record. The implementation method includes: setting whether the target tracking frame in the historical target tracking record is occluded to no and whether it is matched to no; based on the coordinates of the unobstructed target tracking frame and the coordinates of the occlusion detection frame, obtaining a second actual occlusion overlap rate value, the second actual occlusion overlap rate value being the ratio of the intersection area of the unobstructed target tracking frame and the occlusion detection frame to the area of the unobstructed target tracking frame; based on the second actual occlusion overlap rate value and the preset occlusion overlap rate threshold, obtaining the updated historical target tracking record, if the second actual occlusion overlap rate value is greater than the preset occlusion overlap rate threshold, then whether the unobstructed target tracking frame is occluded is updated to yes, otherwise the life value of the unobstructed target tracking frame is subtracted from the preset life change amount.
[0013] In a second aspect, the present application provides a target tracking device, including: a detection frame acquisition module, used to acquire a target detection frame and an occlusion detection frame of a current frame of a monitoring video stream; a record update module, used to update a historical target tracking record based on the target detection frame and the occlusion detection frame to obtain an updated historical target tracking record, wherein the historical target tracking record includes the coordinates, life value, whether it is occluded, and whether it matches the target tracking frame. During the update process, if the target tracking frame does not match the target detection frame, then when the target tracking frame is occluded, its life value remains unchanged, and when the target tracking frame is not occluded, its life value is reduced by a preset life change value, otherwise the life value of the target tracking frame is increased by the preset life change value; an information deletion module, used to delete information associated with a target tracking frame whose life value is less than a preset minimum life value in the updated historical target tracking record, and return to the detection frame acquisition module after acquiring the next frame of the current frame, and the current frame in the detection frame acquisition module is the next frame of the current frame.
[0014] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the target tracking method described in any one of the first aspects of the present application.
[0015] In a fourth aspect, the present application provides an electronic device, comprising: a memory storing a computer program; and a processor communicatively connected to the memory, for executing any target tracking method described in the first aspect of the present application when the computer program is called.
[0016] As described above, the target tracking method, device, medium and electronic device described in the present application have the following beneficial effects:
[0017] In the target tracking method, the life value of the target tracking frame is regulated by the target detection frame and the occlusion detection frame, so that the life value will not be lower than the preset minimum life value when it is occluded, thereby saving the target tracking information when the target is occluded and providing a more complete historical target tracking record. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 Shown is a schematic diagram of the hardware structure for running the target tracking method according to an embodiment of the present application.
[0019] Figure 2 Shown is a flow chart of the target tracking method described in an embodiment of the present application.
[0020] Figure 3 Shown is a flowchart of an implementation method of the present application for updating the historical target tracking record based on the target detection frame and the occlusion detection frame to obtain an updated historical target tracking record.
[0021] Figure 4 Shown is a flowchart of an implementation method of the present application for updating the historical target tracking record based on the target detection frame and the occlusion detection frame when the target detection frame exists to obtain the updated historical target tracking record.
[0022] Figure 5 Shown is a flowchart of an implementation method of the present application for updating the historical target tracking record based on the target detection frame and the occlusion detection frame when the historical target tracking record is not an empty record to obtain an updated historical target tracking record.
[0023] Figure 6 Shown is a flowchart of an implementation method of the present application for performing pairwise matching of the target detection frame and the target tracking frame based on a preset target overlap rate threshold to obtain a first updated historical target tracking record.
[0024] Figure 7 Shown is a flowchart of an implementation method of the present application for processing an unmatched target tracking frame and the occlusion detection frame based on a preset occlusion overlap rate threshold to obtain the updated historical target tracking record.
[0025] Figure 8 Shown is a flowchart of an implementation method of the present application for updating the historical target tracking record based on the occlusion detection frame to obtain an updated historical target tracking record when the target detection frame does not exist.
[0026] Fig. 9 Shown is a schematic diagram of the structure of the target tracking device described in an embodiment of the present application.
[0027] Component number description
[0028] 10 Electronic devices
[0029] 110 Memory
[0030] 120 processors
[0031] 130 Bus
[0032] 140 Access Device
[0033] 150 Database
[0034] 900 Target Tracking Device
[0035] 910 Detection frame acquisition module
[0036] 920 Record Update Module
[0037] 930 Information Deletion Module
[0038] Steps S1-S3
[0039] Steps S21-S22
[0040] S31-S32 Steps
[0041] Steps S41-S43
[0042] Steps S51-S52
[0043] Steps S61-S62
[0044] Steps S71-S73 DETAILED DESCRIPTION
[0045] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0046] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.
[0047] The technical solutions in the embodiments of the present application are described in detail below in conjunction with the drawings in the embodiments of the present application.
[0048] The target tracking method provided in the embodiment of the present application can be executed in a computing device. Figure 1 For example, Figure 1 The hardware structure block diagram of the computing device for running the target tracking method is shown in FIG. The computing device 10 includes but is not limited to a memory 110 and a processor 120. The processor 120 is connected to the memory 110 via a bus 130, and the database 150 is used to store data.
[0049] The computing device 10 also includes an access device 140 that enables the computing device 10 to communicate via one or more networks 160. Examples of these networks include a public switched telephone network, a local area network, a wide area network, a personal area network, or a combination of communication networks such as the Internet. The access device 140 may include any type of network interface, wired or wireless, for example, one or more of a network interface card, such as an IEEE 802.11 wireless LAN wireless interface, a global microwave interconnection access interface, an Ethernet interface, a universal serial bus interface, a cellular network interface, a Bluetooth interface, a near field communication interface, and the like.
[0050] In the embodiment of the present application, the above components of the computing device 10 and Figure 1 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 1 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0051] The computing device 10 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 10 may also be a mobile or stationary server.
[0052] like Figure 2 As shown, this embodiment provides a target tracking method, including:
[0053] S1, obtain the target detection frame and occlusion detection frame of the current frame of the surveillance video stream.
[0054] Optionally, the monitoring video stream may refer to a video data stream transmitted in real time from a monitoring camera or a video acquisition device. It is a continuous sequence of video images transmitted at a certain frame rate. The current frame may refer to an image frame presented at the current time point in the monitoring video stream. The target detection frame is a bounding box used to mark the target of interest in the image. It is usually a rectangular frame that can tightly frame the target object and is used to indicate the position and range of the target in the image. The target detection frame is widely used in target detection tasks to locate and identify different targets in the image, such as faces, vehicles, animals, etc. The occlusion detection frame is a bounding box used to mark occluded objects in an image or video. When the target object is obscured by other objects or occluders, the occlusion detection frame can be used to mark the position and range of the occluder. The occlusion detection frame plays an important role in tasks such as scene understanding and object segmentation, and can be used to analyze and infer the properties and features of the occluded target.
[0055] Optionally, the target detection frame and the occlusion detection frame can be obtained by processing the current frame of the monitoring video stream according to a target detection algorithm, and the relevant content of the target detection algorithm is not repeated in this embodiment.
[0056] S2, based on the target detection frame and the occlusion detection frame, the historical target tracking record is updated to obtain an updated historical target tracking record, wherein the historical target tracking record includes the coordinates, life value, whether it is occluded and whether it is matched of the target tracking frame. During the updating process, if the target tracking frame does not match the target detection frame, then when the target tracking frame is occluded, its life value remains unchanged; when the target tracking frame is not occluded, its life value is subtracted from a preset life change amount; otherwise, the life value of the target tracking frame is added to the preset life change amount.
[0057] Optionally, the historical target tracking record may refer to historical data for recording and tracking the position, state and trajectory of the target in a time series in a target tracking task. The updated historical target tracking record may refer to data after the historical data in the historical target tracking record is updated. The target tracking frame may refer to a rectangular frame used to represent the position and boundary of the target in each frame in a target tracking task, which may play a role in recording and describing the target position.
[0058] Optionally, the preset life change amount can be flexibly set according to actual conditions, and this embodiment does not explicitly limit this. Preferably, the preset life change amount is 1. During the update process, when the target tracking frame is not blocked, its life value is subtracted from the preset life change amount. If the life value of the target tracking frame is 5, it is updated to 4.
[0059] Optionally, a life value upper limit is set in the target tracking method, and when the life value of the target tracking frame increases to the life value upper limit, the life value of the target tracking frame no longer increases.
[0060] Optionally, whether the target tracking frame matches the target detection frame is related to the areas of the target tracking frame and the target detection frame. The areas of the target tracking frame and the target detection frame can be obtained according to their coordinates, which will not be repeated here.
[0061] S3, delete the information associated with the target tracking frame whose health value is less than the preset minimum health value in the updated historical target tracking record, and return to S1 after obtaining the next frame of the current frame, the current frame in S1 is the next frame of the current frame, and the historical target tracking record in S2 is the updated historical target tracking record.
[0062] Optionally, the preset minimum health value can be flexibly set according to actual conditions, and this embodiment does not explicitly limit this. Preferably, the preset minimum health value can be 0. The updated historical target tracking record may include, for example, information associated with target tracking frame 1, information associated with target tracking frame 2, etc. If the health value of target tracking frame 2 is -1, the information associated with target tracking frame 2 is deleted in the updated historical target tracking record.
[0063] Optionally, the information associated with the target tracking frame may include the coordinates, life value, whether it is blocked, and whether it is matched of the target tracking frame.
[0064] Optionally, the frame sequence of the monitoring video stream may be arranged in order according to the time of frame acquisition, and the next frame of the current frame is the next frame of the current frame in the monitoring video stream.
[0065] According to the above description, the target tracking method includes: obtaining a target detection frame and an occlusion detection frame of a current frame of a surveillance video stream; updating a historical target tracking record based on the target detection frame and the occlusion detection frame to obtain an updated historical target tracking record, wherein the historical target tracking record includes the coordinates, life value, whether it is blocked and whether it is matched of the target tracking frame. During the updating process, if the target tracking frame does not match the target detection frame, then when the target tracking frame is blocked, its life value remains unchanged, and when the target tracking frame is not blocked, its life value is reduced by a preset life change amount, otherwise the life value of the target tracking frame is increased by the preset life change amount; deleting information associated with a target tracking frame whose life value is less than a preset minimum life value in the updated historical target tracking record, and returning to S1 after obtaining the next frame of the current frame to execute S1 to S3 again, the current frame in S1 is the next frame of the current frame, and the historical target tracking record in S2 is the updated historical target tracking record.
[0066] In the target tracking method, the life value of the target tracking frame is regulated by the target detection frame and the occlusion detection frame, so that the life value will not be lower than the preset minimum life value when it is occluded, thereby saving the target tracking information when the target is occluded and providing a more complete historical target tracking record.
[0067] like Figure 3 As shown, this embodiment provides a method for updating the historical target tracking record based on the target detection frame and the occlusion detection frame to obtain the updated historical target tracking record, including:
[0068] S21, when the target detection frame does not exist, updating the historical target tracking record based on the occlusion detection frame to obtain the updated historical target tracking record.
[0069] S22: When the target detection frame exists, the historical target tracking record is updated based on the target detection frame and the occlusion detection frame to obtain the updated historical target tracking record.
[0070] Optionally, the absence of the target detection frame may refer to the fact that the target object is not detected in the current frame, and the presence of the target detection frame may refer to the fact that the target object is detected in the current frame.
[0071] like Figure 4 As shown, this embodiment provides a method for updating the historical target tracking record based on the target detection frame and the occlusion detection frame when the target detection frame exists to obtain the updated historical target tracking record, including:
[0072] S31, when the historical target tracking record is an empty record, the empty record is updated based on the target detection frame to obtain the updated historical target tracking record, in which the coordinates of the target tracking frame are the coordinates of the target detection frame, the life value is the initial life value, whether it is blocked is no, and whether it is matched is yes.
[0073] Optionally, the empty record may refer to the absence of any information associated with the target tracking frame in the historical target tracking record.
[0074] Optionally, the initial life value may be flexibly set according to actual conditions, and this embodiment does not explicitly limit this. Preferably, the initial life value may be 0.
[0075] Optionally, the method for updating the empty record based on the target detection frame to obtain the updated historical target tracking record includes: based on the coordinates of the target detection frame, generating information associated with the target tracking frame in the empty record to obtain the updated historical target tracking record, wherein the coordinates of the target tracking frame are the coordinates of the target detection frame, the life value is the initial life value, whether it is blocked is no, and whether it is matched is yes. The target tracking frame is associated with the target detection frame one by one, that is, the number of target tracking frames is the same as the number of target detection frames, and the process of traversing the target detection frame is not repeated here.
[0076] S32: When the historical target tracking record is not an empty record, the historical target tracking record is updated based on the target detection frame and the occlusion detection frame to obtain an updated historical target tracking record.
[0077] like Figure 5 As shown, this embodiment provides a method for updating the historical target tracking record based on the target detection frame and the occlusion detection frame when the historical target tracking record is not an empty record to obtain an updated historical target tracking record, including:
[0078] S41, setting whether the target tracking frame in the historical target tracking record is blocked to no, and whether it is matched to no.
[0079] Optionally, in the process of setting whether the target tracking frame in the historical target tracking record is blocked to no, whether it is matched to no, the process of traversing the target tracking frame in the historical target tracking record is not repeated here.
[0080] S42, based on a preset target overlap rate threshold, the target detection frame and the target tracking frame are matched in pairs to obtain the first updated historical target tracking record. When the target detection frame matches the target tracking frame, whether the target detection frame is matched is updated to yes, the coordinates of the target tracking frame are updated to the coordinates of the target detection frame, whether it is matched is updated to yes, whether it is occluded is updated to no, and the life value is added to the preset life change amount.
[0081] Optionally, pairwise matching of the target detection frame and the target tracking frame may refer to a process of searching for a target tracking frame matching the target detection frame in the historical target tracking record for each target detection frame, and the number of the target detection frames may be multiple. During the traversal of the target detection frames, if a target tracking frame matching the current target detection frame has been searched in the historical target tracking record, then the historical target tracking record is started to search for a target tracking frame matching the next target detection frame. The process of traversing and searching the target detection frame and the target tracking frame is a conventional method, and this embodiment will not be described in detail.
[0082] Optionally, the update process from the historical target tracking record to the updated historical target tracking record is not completed in one update of the data in the historical target tracking record, but may require multiple updates to complete the update of the data in the historical target tracking record. The historical target tracking record updated for the first time may refer to the historical target tracking record after the historical target tracking record has been updated for the first time.
[0083] S43, when whether the target detection frame is matched is no, generating information associated with a new target tracking frame in the historical target tracking record updated for the first time to obtain the historical target tracking record updated for the second time, wherein the coordinates of the new target tracking frame are the coordinates of the unmatched target detection frame, whether it is occluded is no, the life value is the initial life value, and whether it is matched is yes.
[0084] Optionally, the preset target overlap rate threshold can be flexibly set according to actual conditions, and this embodiment does not explicitly limit this. Optionally, the unmatched target detection frame refers to a target detection frame whose match is negative.
[0085] Optionally, the second updated historical target tracking record may refer to the historical target tracking record after the historical target tracking record has been updated for the second time.
[0086] S44, when there is an unmatched target tracking frame in the second updated historical target tracking record, the unmatched target tracking frame and the occlusion detection frame are processed based on a preset occlusion overlap rate threshold to obtain the updated historical target tracking record.
[0087] Optionally, the unmatched target tracking frame refers to a target tracking frame whose matching is negative.
[0088] Optionally, the preset barrier overlap rate threshold may be flexibly set according to actual conditions, and this embodiment does not explicitly limit this.
[0089] like Figure 6 As shown, this embodiment provides a method for matching the target detection frame and the target tracking frame in pairs based on a preset target overlap rate threshold to obtain a first updated historical target tracking record, including:
[0090] S51, based on the coordinates of the target detection frame and the coordinates of the target tracking frame, obtaining an actual target overlap ratio value, wherein the actual target overlap ratio value is a ratio of an intersection area between the target detection frame and the target tracking frame to an area of the target tracking frame.
[0091] Optionally, the intersection area of the target detection frame and the target tracking frame and the area of the target tracking frame can be calculated and obtained according to the coordinates of the target detection frame and the target tracking frame, which will not be repeated here.
[0092] S52: Based on the actual target overlap rate value and the preset target overlap rate threshold, obtain the historical target tracking record updated for the first time.
[0093] Optionally, the preset target overlap rate threshold may be flexibly set according to actual conditions, and this embodiment does not explicitly limit this.
[0094] like Figure 7 As shown, this embodiment provides a method for processing the unmatched target tracking frame and the occlusion detection frame based on a preset occlusion overlap rate threshold to obtain the updated historical target tracking record, including:
[0095] S61, when whether the unmatched target tracking frame is occluded is no, based on the coordinates of the unmatched target tracking frame and the coordinates of the occlusion detection frame, obtain a first actual occlusion overlap rate value, and the first actual occlusion overlap rate value is the ratio of the intersection area of the unmatched target tracking frame and the occlusion detection frame to the area of the unmatched target tracking frame.
[0096] Optionally, the intersection area of the unmatched target tracking frame and the occlusion detection frame and the area of the target tracking frame can be calculated and obtained based on the coordinates of the target tracking frame and the occlusion detection frame, which will not be repeated here.
[0097] S62, based on the first actual occlusion overlap rate value and the preset occlusion overlap rate threshold, obtain the updated historical target tracking record, if the first actual occlusion overlap rate value is greater than the preset occlusion overlap rate threshold, then whether the unmatched target tracking frame is occluded is updated to yes, otherwise the life value of the unmatched target tracking frame is subtracted from the preset life change amount.
[0098] Optionally, the preset barrier overlap rate threshold may be flexibly set according to actual conditions, and this embodiment does not explicitly limit this.
[0099] Optionally, since there may be multiple unmatched target tracking frames and occlusion detection frames, the unmatched target tracking frames need to be traversed in obtaining the updated historical target tracking records. In the updating process of the current unmatched target tracking frame, if an occlusion detection frame that satisfies the first actual occlusion overlap rate value and the preset occlusion overlap rate threshold has been found when searching for the occlusion detection frame, after the unmatched target tracking frame is updated to yes, the updating process of the next unmatched target tracking frame can be started directly, thereby improving the updating efficiency. The process of traversing and searching the occlusion detection frame and the target tracking frame is a conventional method, which will not be described in detail in this embodiment.
[0100] like Figure 8 As shown, this embodiment provides a method for updating the historical target tracking record based on the occlusion detection frame when the target detection frame does not exist to obtain an updated historical target tracking record, including:
[0101] S71, setting whether the target tracking frame in the historical target tracking record is blocked to no, and whether it is matched to no.
[0102] S72, based on the coordinates of the unobstructed target tracking frame and the coordinates of the obstruction detection frame, obtain a second actual obstruction overlap ratio value, wherein the second actual obstruction overlap ratio value is the ratio of the intersection area of the unobstructed target tracking frame and the obstruction detection frame to the area of the unobstructed target tracking frame.
[0103] Optionally, the unobstructed target tracking frame is the target tracking frame whether it is obstructed or not. The intersection area of the unobstructed target tracking frame and the obstruction detection frame and the area of the unobstructed target tracking frame can be calculated based on the coordinates of the unobstructed target tracking frame and the coordinates of the obstruction detection frame. The specific details of this embodiment will not be repeated here.
[0104] S73, based on the second actual occlusion overlap rate value and the preset occlusion overlap rate threshold, obtain the updated historical target tracking record, if the second actual occlusion overlap rate value is greater than the preset occlusion overlap rate threshold, then whether the unobstructed target tracking frame is obstructed is updated to yes, otherwise the life value of the unobstructed target tracking frame is subtracted from the preset life change amount.
[0105] Optionally, there may be multiple unobstructed target tracking frames and multiple obstruction detection frames. The traversal and update process of the unobstructed target tracking frame is similar to the principle of the unmatched target tracking frame, which will not be described in detail here.
[0106] The protection scope of the target tracking method described in the embodiment of the present application is not limited to the execution order of the steps listed in the present embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present application are included in the protection scope of the present application.
[0107] like Fig. 9 As shown, this embodiment provides a target tracking device 900, which is characterized by comprising:
[0108] The detection frame acquisition module 910 is used to acquire the target detection frame and the occlusion detection frame of the current frame of the monitoring video stream.
[0109] The record update module 920 is used to update the historical target tracking record based on the target detection frame and the occlusion detection frame to obtain an updated historical target tracking record. The historical target tracking record includes the coordinates, life value, whether it is occluded and whether it matches the target tracking frame. During the update process, if the target tracking frame does not match the target detection frame, then when the target tracking frame is occluded, its life value remains unchanged. When the target tracking frame is not occluded, its life value is reduced by a preset life change value. Otherwise, the life value of the target tracking frame is increased by the preset life change value.
[0110] The information deletion module 930 is used to delete the information associated with the target tracking frame whose health value is less than the preset minimum health value in the updated historical target tracking record, and return to the detection frame acquisition module after obtaining the next frame of the current frame. The current frame in the detection frame acquisition module is the next frame of the current frame, and the historical target tracking record in the record update module is the updated historical target tracking record.
[0111] In the target tracking device 900 provided in this embodiment, the detection frame acquisition module 910 and Figure 2 The target tracking method shown corresponds to step S1, the record updating module 920 corresponds to step S2, and the information deleting module 930 corresponds to step S3.
[0112] In the several embodiments provided in the present application, it should be understood that the disclosed device or method can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules / units is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules or units, which can be electrical, mechanical or other forms.
[0113] The modules / units described as separate components may or may not be physically separated, and the components displayed as modules / units may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules / units may be selected according to actual needs to achieve the purpose of the embodiments of the present application. For example, the functional modules / units in the various embodiments of the present application may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.
[0114] Those of ordinary skill in the art should further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0115] This embodiment provides an electronic device, the electronic device comprising a memory storing a computer program; a processor connected to the memory for communication, and executing the computer program when the computer program is called. Figure 2 The target tracking method shown.
[0116] The present application embodiment also provides a computer-readable storage medium. A person of ordinary skill in the art can understand that all or part of the steps in the method for implementing the above embodiment can be completed by a program to instruct the processor, and the program can be stored in a computer-readable storage medium, and the storage medium is a non-transitory medium, such as a random access memory, a read-only memory, a flash memory, a hard disk, a solid-state hard disk, a magnetic tape, a floppy disk, an optical disc, and any combination thereof. The above storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state hard disk (SSD)), etc.
[0117] The present application embodiment may also provide a computer program product, the computer program product including one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer or data center.
[0118] When the computer program product is executed by a computer, the computer executes the method described in the above method embodiment. The computer program product may be a software installation package, and when the above method is required, the computer program product may be downloaded and executed on a computer.
[0119] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.
[0120] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A target tracking method, characterized in that: include: S1, obtain the target detection frame and occlusion detection frame of the current frame of the surveillance video stream; S2, based on the target detection frame and the occlusion detection frame, the historical target tracking record is updated to obtain an updated historical target tracking record, wherein the historical target tracking record includes the coordinates of the target tracking frame, the life value, whether it is blocked and whether it is matched. During the updating process, if the target tracking frame does not match the target detection frame, then when the target tracking frame is blocked, its life value remains unchanged. When the target tracking frame is not blocked, its life value is subtracted from the preset life change amount. Otherwise, the life value of the target tracking frame is added to the preset life change amount. Based on the target detection frame and the occlusion detection frame, the historical target tracking record is updated to obtain an updated historical target tracking record. The recording implementation method includes: when the target detection frame does not exist, the historical target tracking record is updated based on the occlusion detection frame to obtain the updated historical target tracking record; when the target detection frame exists, the historical target tracking record is updated based on the target detection frame and the occlusion detection frame to obtain the updated historical target tracking record, whether the target detection frame is matched is initially set to no, whether the target tracking frame is blocked and whether it is matched is initially set to no and yes, when the target detection frame exists, the historical target tracking record is updated based on the target detection frame and the occlusion detection frame to obtain the updated historical target tracking record The recording implementation method includes: when the historical target tracking record is an empty record, updating the empty record based on the target detection frame to obtain the updated historical target tracking record, the coordinates of the target tracking frame in the updated historical target tracking record are the coordinates of the target detection frame, the life value is the initial life value, whether it is blocked is no, whether it is matched is yes, and whether the target detection frame is matched is updated to yes; when the historical target tracking record is not an empty record, updating the historical target tracking record based on the target detection frame and the occlusion detection frame to obtain the updated historical target tracking record, when the historical target tracking record is not an empty record, based on the target The method for implementing the target tracking record after the update includes: setting whether the target tracking frame in the historical target tracking record is blocked to no, and whether it is matched to no; matching the target detection frame and the target tracking frame in pairs based on a preset target overlap rate threshold to obtain the first updated historical target tracking record, when the target detection frame matches the target tracking frame, whether the target detection frame is matched is updated to yes, the coordinates of the target tracking frame are updated to the coordinates of the target detection frame, whether it is matched is updated to yes, whether it is blocked is updated to no, and the life value is added to the preset life change amount;When whether the target detection frame is matched is no, information associated with a new target tracking frame is generated in the historical target tracking record updated for the first time to obtain the historical target tracking record updated for the second time, the coordinates of the new target tracking frame are the coordinates of the unmatched target detection frame, whether it is blocked is no, the life value is the initial life value, whether it is matched is yes, and whether the unmatched target detection frame is matched is updated from no to yes; when there is an unmatched target tracking frame in the historical target tracking record updated for the second time, the unmatched target tracking frame and the occlusion detection frame are processed based on a preset occlusion overlap rate threshold to obtain the updated historical target tracking record; S3, delete the information associated with the target tracking frame whose health value is less than the preset minimum health value in the updated historical target tracking record, and return to S1 after obtaining the next frame of the current frame, the current frame in S1 is the next frame of the current frame, and the historical target tracking record in S2 is the updated historical target tracking record.
2. The target tracking method according to claim 1, characterized in that: Based on a preset target overlap rate threshold, the target detection frame and the target tracking frame are matched in pairs to obtain the first updated historical target tracking record, and the implementation method includes: Based on the coordinates of the target detection frame and the coordinates of the target tracking frame, obtaining an actual target overlap rate value, wherein the actual target overlap rate value is a ratio of an intersection area of the target detection frame and the target tracking frame to an area of the target tracking frame; Based on the actual target overlap rate value and the preset target overlap rate threshold, the historical target tracking record updated for the first time is obtained. If the actual target overlap rate value is greater than the preset target overlap rate threshold, the target detection frame matches the target tracking frame, otherwise they do not match.
3. The target tracking method according to claim 2, characterized in that: The method for processing the unmatched target tracking frame and the occlusion detection frame based on a preset occlusion overlap rate threshold to obtain the updated historical target tracking record includes: When whether the unmatched target tracking frame is occluded is no, obtaining a first actual occluder overlap ratio value based on the coordinates of the unmatched target tracking frame and the coordinates of the occluder detection frame, where the first actual occluder overlap ratio value is a ratio of an intersection area of the unmatched target tracking frame and the occluder detection frame to an area of the unmatched target tracking frame; Based on the first actual occlusion overlap rate value and the preset occlusion overlap rate threshold, the updated historical target tracking record is obtained; if the first actual occlusion overlap rate value is greater than the preset occlusion overlap rate threshold, whether the unmatched target tracking frame is occluded is updated to yes; otherwise, the life value of the unmatched target tracking frame is subtracted from the preset life change amount.
4. The target tracking method according to claim 3, characterized in that: When the target detection frame does not exist, the historical target tracking record is updated based on the occlusion detection frame to obtain an updated historical target tracking record. The implementation method includes: Set whether the target tracking frame in the historical target tracking record is blocked or matched; Based on the coordinates of the unobstructed target tracking frame and the coordinates of the obstruction detection frame, obtaining a second actual obstruction overlap ratio value, where the second actual obstruction overlap ratio value is a ratio of an intersection area of the unobstructed target tracking frame and the obstruction detection frame to an area of the unobstructed target tracking frame; Based on the second actual occluder overlap rate value and the preset occluder overlap rate threshold, the updated historical target tracking record is obtained. If the second actual occluder overlap rate value is greater than the preset occluder overlap rate threshold, whether the unobstructed target tracking frame is obstructed is updated to yes, otherwise the life value of the unobstructed target tracking frame is subtracted from the preset life change amount.
5. A target tracking device, characterized in that: include: The detection frame acquisition module is used to obtain the target detection frame and the occlusion detection frame of the current frame of the monitoring video stream; A record update module is used to update the historical target tracking record based on the target detection frame and the occlusion detection frame to obtain an updated historical target tracking record, wherein the historical target tracking record includes the coordinates of the target tracking frame, the life value, whether it is blocked and whether it is matched. During the update process, if the target tracking frame does not match the target detection frame, then when the target tracking frame is blocked, its life value remains unchanged; when the target tracking frame is not blocked, its life value is reduced by a preset life change amount; otherwise, the life value of the target tracking frame is increased by the preset life change amount; based on the target detection frame and the occlusion detection frame, the historical target tracking record is updated to obtain an updated historical target The method for realizing target tracking record includes: when the target detection frame does not exist, updating the historical target tracking record based on the occlusion detection frame to obtain the updated historical target tracking record; when the target detection frame exists, updating the historical target tracking record based on the target detection frame and the occlusion detection frame to obtain the updated historical target tracking record, whether the target detection frame is matched is initially set to no, whether the target tracking frame is blocked and whether it is matched is initially set to no and yes, when the target detection frame exists, updating the historical target tracking record based on the target detection frame and the occlusion detection frame to obtain the updated historical target The implementation method of the tracking record includes: when the historical target tracking record is an empty record, updating the empty record based on the target detection frame to obtain the updated historical target tracking record, the coordinates of the target tracking frame in the updated historical target tracking record are the coordinates of the target detection frame, the life value is the initial life value, whether it is blocked is no, whether it is matched is yes, and whether the target detection frame is matched is updated to yes; when the historical target tracking record is not an empty record, updating the historical target tracking record based on the target detection frame and the occlusion detection frame to obtain the updated historical target tracking record, and when the historical target tracking record is not an empty record, updating the historical target tracking record based on the target detection frame and the occlusion detection frame to obtain the updated historical target tracking record. The method for implementing the target detection frame and the occlusion detection frame to update the historical target tracking record to obtain the updated historical target tracking record includes: setting whether the target tracking frame in the historical target tracking record is occluded to no, and whether it is matched to no; based on a preset target overlap rate threshold, matching the target detection frame and the target tracking frame in pairs to obtain the first updated historical target tracking record, when the target detection frame matches the target tracking frame, whether the target detection frame is matched is updated to yes, the coordinates of the target tracking frame are updated to the coordinates of the target detection frame, whether it is matched is updated to yes, whether it is occluded is updated to no, and the life value is added to the preset life change amount;When whether the target detection frame is matched is no, information associated with a new target tracking frame is generated in the historical target tracking record updated for the first time to obtain the historical target tracking record updated for the second time, the coordinates of the new target tracking frame are the coordinates of the unmatched target detection frame, whether it is blocked is no, the life value is the initial life value, whether it is matched is yes, and whether the unmatched target detection frame is matched is updated from no to yes; when there is an unmatched target tracking frame in the historical target tracking record updated for the second time, the unmatched target tracking frame and the occlusion detection frame are processed based on a preset occlusion overlap rate threshold to obtain the updated historical target tracking record; An information deletion module is used to delete the information associated with the target tracking frame whose health value is less than the preset minimum health value in the updated historical target tracking record, and return to the detection frame acquisition module after obtaining the next frame of the current frame. The current frame in the detection frame acquisition module is the next frame of the current frame, and the historical target tracking record in the record update module is the updated historical target tracking record.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the target tracking method described in any one of claims 1 to 4 is implemented.
7. An electronic device, characterized in that: The electronic device comprises: A memory storing a computer program; A processor is communicatively connected to the memory, and executes the target tracking method according to any one of claims 1 to 4 when calling the computer program.
Citation Information
Patent Citations
Video multi-target tracking method using convolutional neural network and bidirectional matching algorithm
CN114092519A
