A target object time sequence alignment method, device, equipment and readable storage medium
By constructing a target array and managing the index using lifetime values and frame drop thresholds, the problems of storage space waste and time deviation in target object timing alignment are solved, achieving efficient target object timing alignment.
Patent Information
- Application Number
- CN202310915987.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-25
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2043-07-25
AI Technical Summary
Existing technologies suffer from problems such as wasted storage space, time deviation, and strong dependence on target ID management in target time alignment.
By constructing a target array, defining the array size based on the number of target objects, and using lifespan values and frame drop thresholds to manage the index and ID relationship of target objects, adjusting the lifespan value size, and releasing outdated indexes to optimize storage space.
It effectively avoids wasting storage space, ensures the accuracy and efficiency of target time alignment, reduces reliance on high-quality target ID management, and ensures that analysis results are not affected.
Smart Images

Figure CN116977978B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of automatic driving, in particular to a target time sequence alignment method and device, equipment and a readable storage medium. BACKGROUND
[0002] At present, the target time sequence alignment method for realizing automatic driving mainly includes the following:
[0003] (1) An array of the same size is established according to the ID range assigned after target matching tracking to store the distance, speed, size and other related information of the target, for example, the ID range is 0-255, and the size of the array is 256, and each array stores a structure body of the same specification.
[0004] (2) Each target information at the same time is stored according to the minimum time unit, and the minimum number of time periods is greater than the number of targets, at this time, the target information can be placed in a structure body, but different target information is scattered to different time.
[0005] (3) The tracking ID of the fusion output target is stored in an array from small to large, and each array stores a structure body of the same specification.
[0006] Although the above three methods can realize the time sequence alignment of the target, the first method needs to define a fixed array according to the ID range to store the target information, and the actual number of targets is often small, so that a large amount of storage space is wasted; the second method needs to exchange time for space for time sequence alignment, but in fact, the targets at the same time should be sent out at the same time, so that there is a time deviation, which affects the analysis result; the third method needs to manage the target ID with high quality, that is, the result of the time sequence alignment is too dependent on the target ID management, so it is difficult to realize. SUMMARY
[0007] The present application provides a target time sequence alignment method, device, equipment and readable storage medium to solve the problems in the related art.
[0008] In a first aspect, a target time sequence alignment method is provided, comprising the following steps:
[0009] When at least one target is identified during target identification of an initial frame, a target array is constructed based on the number of targets;
[0010] Each target is added to the corresponding index in the target array to construct a mapping relationship between the ID value of the target and the index, and a life length value is set for each target.
[0011] adjusting a size of each life duration value according to a target matching result when target matching of a subsequent frame is performed;
[0012] when a new target object is identified and there is at least one target life duration value less than a preset frame drop threshold, releasing a target index in which a target object corresponding to the target life duration value is located, adding the new target object to the target index, updating an ID value corresponding to the target index to an ID value of the new target object, and setting a life duration value for the new target object.
[0013] In some embodiments, the initial value of the life duration value is 1, and the adjusting of the size of each life duration value according to the target matching result includes:
[0014] for each target object in the target array, when the target matching result is matching, resetting or adding 1 to the life duration value of the target object according to whether the life duration value of the target object is a negative integer;
[0015] when the target matching result is not matching, resetting or subtracting 1 from the life duration value of the target object according to whether the life duration value of the target object is a positive integer.
[0016] In some embodiments, the resetting or adding 1 to the life duration value of the target object according to whether the life duration value of the target object is a negative integer includes:
[0017] if the life duration value of the target object is a negative integer, resetting the life duration value of the target object to 1;
[0018] if the life duration value of the target object is a non-negative integer, adding 1 to the life duration value of the target object.
[0019] In some embodiments, the resetting or subtracting 1 from the life duration value of the target object according to whether the life duration value of the target object is a positive integer includes:
[0020] if the life duration value of the target object is a positive integer, resetting the life duration value of the target object to -1;
[0021] if the life duration value of the target object is a non-positive integer, subtracting 1 from the life duration value of the target object.
[0022] In some embodiments, the frame drop threshold is a negative integer, and when there are multiple target life duration values less than the frame drop threshold, the releasing of the target index in which the target object corresponding to the target life duration value is located and the adding of the new target object to the target index include:
[0023] When there is one new target, release the target index containing the target with the minimum target life value, and add the new target to the target index;
[0024] When multiple new targets are added, the target index corresponding to the target's lifespan value is released in ascending order of target lifespan value, and the multiple new targets are added to the corresponding target index in the order of release.
[0025] In some embodiments, the method further includes:
[0026] When the number of newly added targets exceeds the number of released target indices, the length of the target array is increased based on the difference between the number of newly added targets and the number of released target indices, in order to add the remaining new targets.
[0027] In some embodiments, the method further includes:
[0028] The lifetime values corresponding to the target item are traversed in descending order of index.
[0029] When the first life duration value is detected to be less than the frame drop threshold, the first index of the target object corresponding to the first life duration value is deleted, and the traversal stops when the second life duration value is detected to be greater than or equal to the frame drop threshold.
[0030] Secondly, a target object timing alignment device is provided, comprising:
[0031] The first construction unit is used to construct a target array based on the number of target objects when at least one target object is identified during target recognition in the initial frame.
[0032] The second construction unit is used to add each target to the corresponding index in the target array, build a mapping relationship between the ID value of the target and the index, and set a lifespan value for each target.
[0033] An adjustment unit is used to adjust the size of each lifetime value based on the target matching result when performing target matching in subsequent frames.
[0034] The alignment unit is used to release the target index of the target object corresponding to the target lifespan value when a new target object is detected and at least one target lifespan value is less than the preset frame drop threshold, add the new target object to the target index, update the ID value corresponding to the target index to the ID value of the new target object, and set a lifespan value for the new target object.
[0035] In a third aspect, a target object time alignment device is provided, comprising a memory and a processor, the memory storing at least one instruction, the at least one instruction being loaded and executed by the processor to implement the foregoing target object time alignment method.
[0036] In a fourth aspect, a computer readable storage medium is provided, the computer readable storage medium storing a computer program, when the computer program is executed by a processor, to implement the foregoing target object time alignment method.
[0037] The present application provides a target object time alignment method, device, equipment and readable storage medium, comprising: when target identification is performed on an initial frame, at least one target object is identified, a target array is constructed based on the number of target objects; each target object is added to the corresponding index in the target array, a mapping relationship between the ID value of each target object and the index is constructed, and a life time value is set for each target object; when target matching is performed on a subsequent frame, the size of each life time value is adjusted according to the target matching result; when a new target object is identified and at least one target life time value is less than a preset frame loss threshold, the target index where the target object corresponding to the target life time value is located is released, the new target object is added to the target index, the ID value corresponding to the target index is updated to the ID value of the new target object, and a life time value is set for the new target object. The present application constructs an array of corresponding length by the number of target objects, which can effectively avoid the waste of storage space, and manages the target objects by the size relationship between the life time value of each target object and the frame loss threshold, to ensure the corresponding relationship between the target object ID and the index, and further realize the alignment of the target object time sequence, which not only takes into account the time and space to ensure that the subsequent analysis result is not affected, and does not need to rely on high-quality target ID management, effectively ensuring the realization of target time sequence alignment. BRIEF DESCRIPTION OF DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0039] Figure 1 A flowchart of a target object time alignment method provided by an embodiment of the present application is shown in the figure;
[0040] Figure 2 A specific flowchart of a target object time alignment method provided by an embodiment of the present application is shown in the figure;
[0041] Figure 3A flowchart of a process for deleting obsolete targets at the end is provided for the embodiments of the present application.
[0042] Figure 4 An addition flowchart of a process for adding targets is provided for the embodiments of the present application.
[0043] Figure 5 A timing alignment diagram from the Nth frame to the N+1th frame is provided for the embodiments of the present application.
[0044] Figure 6 A structural diagram of a target timing alignment device is provided for the embodiments of the present application. DETAILED DESCRIPTION
[0045] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0046] Referring to Figure 1 and Figure 2 , the embodiments of the present application provide a target timing alignment method, which includes the following steps:
[0047] Step S10: When identifying targets in an initial frame, if at least one target is identified, a target array is constructed based on the number of targets.
[0048] Exemplarily, it can be understood that in the implementation method of target timing alignment for automatic driving, a fixed array is usually defined according to the ID range, and the fusion target information is stored through the fixed array. Although this method has the advantage of convenient implementation, it will waste a large amount of storage space. For example, if the actual fusion target is 10, and the size of the fixed array is 256, then 96.1% of the space will be idle, and in most cases, the number of fusion targets will remain low for a long time under the condition of high speed or few vehicles and pedestrians, which will be a great waste of storage space. In the embodiments of the present application, the array is defined by the number of targets, so that the size of the array matches the actual size of the target, thereby avoiding the waste of storage space. Specifically, when identifying targets in an initial frame, a target array is constructed according to the number of identified targets. For example, if four targets A, B, C, and D are identified in the initial frame, the size of the target array is defined as 4.
[0049] Step S20: adding each target object to the corresponding index in the target array, constructing the mapping relationship between the ID value of the target object and the index, and setting a life length value for each target object; wherein the initial value of the life length value is 1.
[0050] For example, in this embodiment, after the target array is defined, the target objects are added to the target array in the order of addition, and the index Index of the target array starts from 1 and goes up to the number N of target objects; for example, the order of addition of target objects A, B, C and D is B, C, A, D in turn, as shown in Table 1, B, C, A and D are added to indexes 1 to 4 in turn. At the same time, as shown in Table 1, the target array also stores the ID value assigned to the target object after matching, that is, the mapping relationship between the index Index and the ID value is constructed, for example, the ID value of B is 12, the ID value of C is 23, the ID value of A is 45, and the ID value of D is 5, and the mapping relationship between Index 1 and ID 12, Index 2 and ID 23, Index 3 and ID 45, and Index 4 and ID 5 is established respectively. It can be understood that the specific information of the target object, such as distance, speed, size and other related information, can be queried through the ID value.
[0051] In addition, in this embodiment, a life length value Age is also set for each target object, which is used to represent the life cycle of the target object, that is, through the life length value Age, the length of time when the target object appears and the length of time when the target object disappears can be known. Therefore, the life length value Age of the target object is also stored in the target array, and it should be noted that the initial value of the life length value Age can be determined according to actual needs, which is not limited herein, for example, the initial value of the life length value Age of each target object can be set to 1. In this embodiment, the mapping relationship between the index Index and the ID value is maintained through the life length value Age, and then the time sequence alignment of the target object is realized.
[0052] Table 1: Time sequence alignment corresponding to the initial frame
[0053] Index ID Age 1 12 1 2 23 1 3 45 1 4 5 1
[0054] Step S30: when performing target matching of subsequent frames, adjusting the size of each life length value according to the target matching result.
[0055] It can be understood that in the target recognition fusion process, the next frame needs to match the target based on the recognition result of the previous frame to determine whether the target in the previous frame still appears in the next frame, if yes, the matching is successful, if not, the matching fails. Therefore, in the target matching process of the subsequent frame, the life change of each target is determined according to the matching result of the previous and subsequent frames, and the size of the life time value Age of the target is adjusted to represent the change.
[0056] For example, assuming that the life time value Age of the target E is 5 in the Nth frame, if the target E still exists in the N+1th frame (i.e. the matching is successful), the Age of the target E is increased by 1, i.e. the Age value of the target E is updated to 6, indicating that the target E has appeared in 6 consecutive frames. For another example, assuming that the life time value Age of the target F is 3 in the Nth frame, if the target E does not exist in the N+1th frame (i.e. the matching fails), the Age of the target F is directly assigned to -1, indicating that the target F does not exist in the N+1th frame, i.e. the target F has a frame loss problem.
[0057] It should be noted that the subsequent frame in the embodiment can refer to the frame after the initial frame (i.e. the 1st frame) (i.e. the 2nd frame), or the frame after the Nth frame (i.e. the N+1th frame). For example, after completing the target recognition of the 1st frame, the target A, B, C and D are obtained, and then the target A, B, C and D are matched in the subsequent frame (i.e. the 2nd frame) of the 1st frame. For another example, after completing the target matching of the Nth frame, the target C, D, E and F are obtained, and then the target C, D, E and F are matched in the subsequent frame (i.e. the N+1th frame) of the Nth frame.
[0058] Further, the adjusting the size of each life time value according to the target matching result comprises:
[0059] For each target in the target array, when the target matching result is matching, the life time value is reset or increased by 1 according to whether the life time value of the target is a negative integer. Specifically, if the life time value of the target is a negative integer, the life time value of the target is reset to 1; if the life time value of the target is a non-negative integer, the life time value of the target is increased by 1.
[0060] When the target matching result is not matching, the life time value of the target is reset or decreased by 1 according to whether the life time value of the target is a positive integer. Specifically, if the life time value of the target is a positive integer, the life time value of the target is reset to -1; if the life time value of the target is a non-positive integer, the life time value of the target is decreased by 1.
[0061] For example, in the embodiment, when the target matching of the N+1th frame is performed, the age of the target is updated regardless of whether the target in the Nth frame is successfully matched. However, the mapping relationship between the ID of the target and the index will not change, and the ID corresponding to the index will be updated only when the index is released.
[0062] Specifically, it is assumed that the target A in the target array corresponding to the Nth frame is successfully matched in the N+1th frame, that is, the target A also exists in the N+1th frame. At this time, it is further determined whether the age of the target A is negative, and the age of the target A is updated according to the determination result. For example, the age of the target A is -2, which indicates that the target A has been missing for 2 frames, that is, the target A does not exist in the Nth frame and the N-1th frame, but the target A reappears in the N+1th frame. At this time, the age of the target A is reset to 1, indicating that the target A enters a new life cycle. For another example, the age of the target A is 4, which indicates that the target A has appeared for 4 consecutive frames, that is, the target A exists in the N-3th frame to the Nth frame, and continues to exist in the N+1th frame. At this time, the age of the target A is increased by 1, that is, the age is updated to 5, indicating that the target A has appeared for 5 consecutive frames.
[0063] It is further assumed that the target B in the target array corresponding to the Nth frame is not successfully matched in the N+1th frame, that is, the target B does not exist in the N+1th frame. At this time, it is further determined whether the age of the target A is positive, and the age of the target B is updated according to the determination result.
[0064] For example, the age of the target B is -2, which indicates that the target B has been missing for 2 frames, that is, the target B does not exist in the Nth frame and the N-1th frame. Since the target B does not exist in the N+1th frame, the age of the target B is reduced by 1, that is, the age is updated to -3, indicating that the target B does not exist for 3 consecutive frames. It can be understood that if the age is not positive, the smaller the age, the longer the duration of the missing target. For another example, the age of the target B is 3, which indicates that the target B has appeared for 3 consecutive frames, that is, the target B exists in the N-2th frame to the Nth frame. However, the target B does not exist in the N+1th frame, that is, the target B has a missing problem in the N+1th frame. At this time, the age of the target B is directly reset to -1, indicating that the target B enters a new life cycle.
[0065] Further, the method further comprises:
[0066] The lifetime values corresponding to the target item are traversed in descending order of index.
[0067] When the first life duration value is detected to be less than the frame drop threshold, the first index of the target object corresponding to the first life duration value is deleted, and the traversal stops when the second life duration value is detected to be greater than or equal to the frame drop threshold.
[0068] In this exemplary embodiment, after target matching and the adjustment and update of the Age value of each target object in each frame, the Age values corresponding to the target objects are traversed in descending order of Index. Then, based on the difference between the Age value and the frame drop threshold, it is determined whether the Index that meets the release condition needs to be deleted to reduce the size of the target array and effectively avoid wasting storage space. It should be understood that since there is a mapping relationship between index values and ID values that should not change in the target array, it is necessary to maintain the continuity of index values in the target array to avoid changes in this mapping relationship. Therefore, this embodiment will only delete the releaseable index values at the end of the target array.
[0069] For details, see Figure 3 As shown, the indexes are traversed from back to front, checking if the Age value is less than the frame drop threshold, i.e., checking if the index meets the release condition. If it does, it means that the corresponding target and index are outdated, and the outdated index is deleted. This process continues until an index that does not meet the release condition is encountered. For example, if the frame drop threshold is -3, as shown in Table 2, assuming that in the time alignment of the (N-1)th frame there are target objects I, K, L, M, O, P and their corresponding ID values are 4, 13, 75, 62, 8, 48 respectively, and their corresponding Age values are 8, -5, 25, 6, -6, -4 respectively.
[0070] Table 2 shows the timing alignment corresponding to the (N-1)th frame.
[0071] Index ID Age 1 4 8 2 13 -5 3 75 25 4 62 6 5 8 -6 6 48 -4
[0072] It can be seen that the Age value of the target K is -5, the Age value of the target O is -6, and the Age value of the target P is -4, and since -5, -6 and -4 are all less than the frame dropping threshold -3, it indicates that the targets K, O and P are all outdated targets, and therefore the indexes 2, 5 and 6 where the targets K, O and P are located are outdated indexes, i.e. all belong to indexes that can be released, i.e. satisfy the index release condition; however, since the Age value 6 of the target M corresponding to the index 4 is greater than the frame dropping threshold -3, i.e. the index 4 does not satisfy the release condition, i.e. the index 4 needs to continue to be retained in the array, therefore, in order to ensure the continuity of the index values, only the indexes 5 and 6 and the ID values corresponding thereto that satisfy the release condition are deleted, and the Age values corresponding to the targets O and P are also deleted synchronously, and the index 2 is continued to be retained in the array, i.e. the size of the array is reduced from 6 to 4, thereby avoiding the waste of storage space.
[0073] Step S40: when it is identified that a new target is added and there is at least one target life duration value less than a preset frame dropping threshold, releasing the target index where the target corresponding to the target life duration value is located, adding the new target to the target index, updating the ID value corresponding to the target index to the ID value of the new target, and setting a life duration value for the new target. The frame dropping threshold is a negative integer.
[0074] It is demonstrated that, before the new target in the N+1 frame is added, the outdated indexes at the end of the target array corresponding to the N frame can be deleted first, and then the release order of the outdated indexes is determined according to the order of the Age values of the outdated targets in the target array from small to large, and then the new target is added to the released indexes in sequence.
[0075] Of course, the obsolete index at the end of the target array can not be deleted first, but it can be determined whether there is an obsolete index at the end. If there is, the obsolete index array corresponding to the end is determined, that is, from back to front according to the order of Index, it is detected whether the Age value is less than the frame drop threshold, that is, it is detected whether the Index satisfies the release condition. If it satisfies, the Index is deleted, until an Index that does not satisfy the release condition is encountered. For example, the obsolete index array corresponding to the end in Table 2 includes Index 5 and Index 6. Then, the release order of the obsolete index (such as Index 2 in Table 2) in the middle part is determined according to the Age value of the obsolete target in the target array from small to large. Then, the new target is added to the released index in turn until the obsolete index in the middle part is replaced by all new targets. At this time, if there are still new targets that have not been added, the release order of the obsolete index (such as Index 5 and Index 6 in Table 2) in the end part is determined according to the value of the obsolete index from small to large, and then the new target that has not been added is added to the released index in turn. It should be understood that if all new targets are added, if there are still obsolete indexes in the end part, the obsolete indexes can be deleted to avoid waste of storage space.
[0076] It should be noted that which of the above two methods is used can be determined according to actual needs, and is not limited herein. However, regardless of which of the above methods is used, when the released index is not sufficient to meet the addition needs of the new target, that is, the number of new targets is greater than the number of obsolete indexes, the length of the target array needs to be increased and the new target is added to the end of the target array.
[0077] It should be understood that the purpose of setting the frame drop threshold in the embodiment is to control the maximum number of frames in which a target is not successfully matched, that is, after exceeding the frame number, the array position of the target can be used by other new targets. It should be noted that the specific setting value of the frame drop threshold can be determined according to actual needs, and is not limited herein. For example, the frame drop threshold is preset as -3, where the negative sign "-" represents frame drop, and the number "3" represents the maximum frame drop number as 3 frames. Assuming that at the Nth frame, the Age value corresponding to the target A is -4, which indicates that the target A has not been successfully matched for 4 consecutive frames (i.e., there is a frame drop problem for 4 consecutive frames), and since it has exceeded the maximum frame drop number 3, it indicates that the target A is an obsolete target at this time, and the index Index thereof is an obsolete index, that is, the obsolete Index becomes a release object, that is, it can be used by other new targets.
[0078] Assuming that at the Nth frame, the index of the target object G is 5 and the corresponding ID value is 69, the target Age value of the target object G is -4, and at the N+1th frame, the target object G is not matched, the target Age value of the target object G will be updated to -5; at this time, if a new target object H is identified at the N+1th frame and the corresponding ID value is 36, the index 5 where the target object G is located in the target array is released, the new target object H is added to the index 5, and the ID 69 corresponding to the index 5 is replaced by the ID 36, that is, the mapping relationship between the index 5 and the ID 36 is re-established; at the same time, a life duration value Age is set for the new target object H in the target array, and the initial value of the life duration value Age is set to 1, indicating that the new target object H appears at the N+1th frame, that is, the new target object H has appeared in the continuous 1 frame.
[0079] Further, when there are multiple target life duration values less than the frame drop threshold, the target index where the target object corresponding to the target life duration value is located is released, and the new target object is added to the target index, comprising:
[0080] When the new target object is one, the target index where the target object corresponding to the smallest target life duration value is located is released, and the new target object is added to the target index.
[0081] When the new target object is multiple, the target index where the target object corresponding to the target life duration value is released in the order of the target life duration value from small to large, and the multiple new target objects are added to the corresponding target index in the order of release.
[0082] For example, referring to Table 2, the indexes 5 and 6 have been deleted, and only the obsolete target object K exists in the middle part of the target array, if there is only one new target object R and the corresponding ID value is 2, the obsolete target object K is directly replaced by the new target object R, the ID value corresponding to the index 2 is updated from 13 to 2, and the Age value is set to 1.
[0083] However, referring to Table 3, if there are multiple outdated target objects in the middle part, the Age values corresponding to the multiple outdated target objects will be sorted in ascending order. Since the smaller the Age value is, the longer the outdated target object is out of frame, i.e., the smaller the probability of its reappearing is, the outdated target object can be deleted, i.e., the outdated index where the outdated target object is located will be deleted. Thus, only one new target object R can be added to the outdated index where the outdated target object with the smallest Age value is located, for example, the index 4 where the target object with the smallest Age value is located is released first, and then the new target object R is added to the index 4, the ID value corresponding to the index 4 is updated from 62 to 2, and the Age value is set to 1 synchronously.
[0084] Table 3: Time sequence alignment corresponding to the N-1th frame
[0085] Index ID Age 1 4 8 2 13 -5 3 75 25 4 62 -7 5 10 37 6 58 18
[0086] When the number of new target objects is 2, i.e., the new target object R and the new target object J in turn and the ID values corresponding to the new target objects are 2 and 9 respectively, the index 4 where the target object corresponding to the smaller Age value -7 is located is released first, and then the new target object R is added to the index 4, the ID value corresponding to the index 4 is updated from 62 to 2, and the Age value is set to 1 synchronously; and then the index 2 where the target object corresponding to the larger Age value -5 is located is released, and then the new target object J is added to the index 2, the ID value corresponding to the index 2 is updated from 13 to 9, and the Age value is set to 1 synchronously.
[0087] Further, the method further comprises:
[0088] When the number of new target objects is greater than the number of released target indexes, the length of the target array is increased according to the difference between the number of new target objects and the number of released target indexes, so as to add the remaining new target objects.
[0089] It can be understood that the number of new target objects can be greater than the number of released indexes in the array (i.e., the number of outdated indexes), i.e., the number of outdated indexes is not enough to replace the new target objects. Therefore, referring to Table 4, the embodiment sorts the outdated target objects in the middle part of the target array in ascending order of the Age values, and then obtains the corresponding outdated index array, for example, referring to Table 4, the outdated target objects in the middle part of the target array are sorted in ascending order of the Age values, and then the corresponding outdated index array is obtained. Figure 4 Figure 5 As shown, the obsolete indexes of the middle part of the target array corresponding to the Nth frame include Index 1 and Index 3, and after sorting in ascending order of the Age values, the sorted order of the obsolete indexes is Index 3, Index 1; and the newly added targets in the N+1th frame are four, and the ID values corresponding to the four newly added targets are 96, 97, 98 and 99 respectively, and the order of the four newly added targets (for the sake of simplicity, the ID values are used to represent the newly added targets) is 97, 96, 98 and 99.
[0090] Then, the un-matched targets (i.e. the newly added targets) in the N+1th frame are added. When adding the newly added targets, it is necessary to determine whether the number of replacements of the targets is less than or equal to the number of obsolete indexes, if yes, the newly added targets are replaced at the corresponding obsolete indexes; if no, the length of the target array is increased and the newly added targets are appended to the end of the target array.
[0091] For example, when adding the newly added target with the ID value of 97, since there is only one newly added target to be replaced at this time, i.e. the number of replacements is 1, and the number of obsolete indexes is 2, i.e. the number of replacements is less than the number of obsolete indexes, the newly added target with the ID value of 97 is replaced at the obsolete index Index 3, i.e. the ID value corresponding to Index 3 is replaced from 95 to 97, and the Age value corresponding to the newly added target with the ID value of 97 is set to 1; similarly, the newly added target with the ID value of 96 is replaced at the obsolete index Index 1, i.e. the ID value corresponding to Index 1 is replaced from 73 to 96, and the Age value corresponding to the newly added target with the ID value of 96 is set to 1.
[0092] Since the number of replacements has reached 3 when adding the newly added target with the ID value of 98, i.e. the number of replacements has exceeded the number of obsolete indexes, a new index, Index 11, is added at the end of the target array; then the newly added target with the ID value of 98 is added at Index 11, and a mapping relationship between Index 11 and the ID value 98 is constructed, and the Age value corresponding to the newly added target with the ID value of 98 is set to 1. Similarly, a new index, Index 12, is added at the end of the target array; then the newly added target with the ID value of 99 is added at Index 12, and a mapping relationship between Index 12 and the ID value 99 is constructed, and the Age value corresponding to the newly added target with the ID value of 99 is set to 1. Thus, the addition of all newly added targets is completed.
[0093] It can be seen that, by constructing an array of corresponding lengths through the number of target objects, the embodiment can effectively avoid waste of storage space, and by the size relationship between the life length value of each target object and the frame drop threshold, the target object is managed to ensure the corresponding relationship between the target object ID and the index, and then the target object timing is aligned, which not only takes into account the time and space to ensure that the subsequent analysis result is not affected, and does not need to rely on high-quality target ID management, effectively ensuring the implementation of target timing alignment, and in the process of implementing target timing alignment, the original information of the data does not need to be changed, and the processed data can be used in time, which is convenient and fast.
[0094] It should be noted that the step numbers of the steps in the embodiments of the present application do not limit the front and back order of the operations in the technical solutions of the present application.
[0095] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each unit can refer to the corresponding process in the foregoing target object timing alignment method embodiments, which will not be described here.
[0096] The target object timing alignment device provided in the above embodiments can be implemented in the form of a computer program, which can run on the target object timing alignment device as shown in the above. Figure 6
[0097] The embodiments of the present application also provide a target object timing alignment device, which comprises a memory, a processor and a network interface connected through a system bus, the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement all or part of the steps of the foregoing target object timing alignment method.
[0098] The network interface is used for network communication, such as sending the assigned task. Those skilled in the art can understand that the structure shown in the above, Figure 6 The network interface is used for network communication, such as sending the assigned task. Those skilled in the art can understand that the structure shown in the above,
[0099] The processor can be a CPU, and can also be other general-purpose processors, DSPs (Digital Signal Processors), ASICs (Application Specific Integrated Circuits), FPGAs (Field Programmable Gate Arrays) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor, or the processor can also be any conventional processor, etc. The processor is the control center of the computer device, and connects all parts of the computer device through various interfaces and lines.
[0100] The memory can be used to store computer programs and / or modules, and the processor realizes various functions of the computer device by running or executing the computer programs and / or modules stored in the memory, and calling data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a video playing function, an image playing function, etc.), etc.; and the data storage area can store data created according to the use of the mobile phone (such as video data, image data, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, for example, a hard disk, a memory, a plug-in hard disk, an SMC (Smart Media Card), an SD (Secure Digital) card, a flash card, at least one disk storage device, a flash memory device or other volatile solid-state memory device.
[0101] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize all steps or part of steps of the target object timing alignment method.
[0102] The embodiments of the present application realize all or part of the foregoing processes, and can also be completed by instructing related hardware through a computer program. The computer program can be stored in a computer readable storage medium, and the computer program can realize the steps of the above methods when executed by a processor. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or some intermediate forms. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, ROM (Read-Only memory), RAM (Random Access memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, according to legislation and patent practice in some jurisdictions, the computer readable medium does not include electrical carrier signals and telecommunication signals.
[0103] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, a server or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage, etc.) containing computer-usable program code.
[0104] It should be noted that in this document, the term "comprising" or "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such a process, method, article or system. Without more limitations, the element defined by the statement "including a" does not exclude the presence of additional identical elements in the process, method, article or system including the element.
[0105] The present application is described with reference to flowcharts and / or block diagrams according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general purpose computer, a special purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a machine that implements the functions described in the flowcharts and / or block diagrams. These computer program instructions can also be stored in a computer readable storage medium that can guide the computer program instructions to operate on other programmable data processing devices or other devices to produce a computer implemented process such that the instructions executed by the computer or other programmable data processing device produce a machine that implements the functions described in the flowcharts and / or block diagrams.Figure One apparatuses that implement aspects of the present disclosure. Figure One apparatuses that implement aspects of the present disclosure.
[0106] The preceding detailed descriptions are presented in terms of specific embodiments. A person of ordinary skill in the art will be able to practice one or more aspects of the disclosure with the described implementations, but other implementations can be employed without departing from the spirit or scope of the disclosure. Thus, claims at the end of this detailed description are to serve as limitations as to the scope of the current application but not as limitations to adapting concepts described herein to other applications, scopes and / or complements.
Claims
1. A method for time-series alignment of target objects, characterized in that, The method comprises the following steps: When target recognition of an initial frame is performed, a target array is constructed based on a number of target objects when at least one target object is recognized; Each target object is added to a corresponding index in the target array, a mapping relationship between an ID value of the target object and the index is constructed, and a life duration value is set for each target object; When target matching of a subsequent frame is performed, the size of each life duration value is adjusted according to a target matching result; When a new target object is recognized and at least one target life duration value is less than a preset frame drop threshold, a target index in which a target object corresponding to the target life duration value is released, the new target object is added to the target index, an ID value corresponding to the target index is updated to an ID value of the new target object, and a life duration value is set for the new target object; The frame drop threshold is a negative integer, and when there are multiple target life duration values less than the frame drop threshold, the target index in which the target object corresponding to the target life duration value is released, and the new target object is added to the target index, comprising: When the new target object is one, the target index in which the target object corresponding to the smallest target life duration value is released, and the new target object is added to the target index; When the new target object is multiple, the target index in which the target object corresponding to the target life duration value is released in order of the target life duration value from small to large, and the multiple new target objects are added to the corresponding target index in order of the release.
2. The target timing alignment method of claim 1, wherein, The initial value of the life duration value is 1, and the size of each life duration value is adjusted according to the target matching result, comprising: For each target object in the target array, when the target matching result is matching, the life duration value is reset or incremented by 1 according to whether the life duration value of the target object is a negative integer; When the target matching result is not matching, the life duration value of the target object is reset or decremented by 1 according to whether the life duration value of the target object is a positive integer.
3. The target timing alignment method of claim 2, wherein, The life duration value is reset or incremented by 1 according to whether the life duration value of the target object is a negative integer, comprising: If the life duration value of the target object is a negative integer, the life duration value of the target object is reset to 1; If the life duration value of the target object is a non-negative integer, the life duration value of the target object is incremented by 1.
4. The target timing alignment method of claim 2, wherein, The life duration value of the target object is reset or decremented by 1 according to whether the life duration value of the target object is a positive integer, comprising: If the life duration value of the target object is a positive integer, the life duration value of the target object is reset to -1; If the life duration value of the target object is a non-positive integer, the life duration value of the target object is decremented by 1.
5. The target timing alignment method of claim 1, wherein, The method further comprises: When the number of new target objects is greater than the number of released target indexes, the length of the target array is increased according to a difference between the number of new target objects and the number of released target indexes, so as to add the remaining new target objects.
6. The target timing alignment method of claim 1, wherein, The method further comprises: The life duration values corresponding to the target objects are traversed in order of the index from large to small; When it is detected that the first life duration value is less than the frame drop threshold, the first index where the target corresponding to the first life duration value is located is deleted until it is detected that the second life duration value is greater than or equal to the frame drop threshold, and the traversal is stopped.
7. An object time alignment apparatus, characterized by comprising: The method comprises the following steps: A first constructing unit is configured to, when at least one target is identified in target identification of an initial frame, construct a target array based on the number of the targets; A second constructing unit is configured to add each target to a corresponding index in the target array, construct a mapping relationship between the ID values of the targets and the indexes, and set a life duration value for each target; An adjusting unit is configured to, when target matching of a subsequent frame is performed, adjust the size of each life duration value according to the target matching result; An alignment unit is configured to, when a new target is identified and there is at least one target life duration value less than a preset frame drop threshold, release the target index where the target corresponding to the target life duration value is located, add the new target to the target index, update the ID value corresponding to the target index to the ID value of the new target, and set a life duration value for the new target. The frame drop threshold is a negative integer, and when there are multiple target life duration values less than the frame drop threshold, the alignment unit is specifically configured to: When the new target is one, release the target index where the target corresponding to the smallest target life duration value is located, and add the new target to the target index; When the new target is multiple, release the target index where the target corresponding to the target life duration value is located in the order of the target life duration values from small to large, and add the multiple new targets to the corresponding target indexes in the order of the release.
8. An object time alignment device, comprising: The method comprises the following steps: A memory and a processor, the memory stores at least one instruction, the at least one instruction is loaded and executed by the processor to implement the target timing alignment method of any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer readable storage medium stores a computer program, when the computer program is executed by the processor, to implement the target timing alignment method of any one of claims 1 to 6.
Citation Information
Patent Citations
Object association method, storage equipment and live broadcast and recorded broadcast interaction terminal
CN107292916A