Target tracking method, device, electronic device and storage medium
By registering the center of gravity, rotation angle and scaling of the target in the intelligent driving system, the accuracy problem of target tracking between frames is solved, high-accuracy target tracking is achieved, and the stability of the intelligent driving system is improved. sex and safety.
Patent Information
- Application Number
- CN202411027186.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-07-30
AI Technical Summary
In the target recognition process, how to accurately track the target between frames based on the target segmentation map and target detection frame has become a key challenge in intelligent driving technology.
By associating the tracked target of the previous frame target image with the target to be tracked in the current frame target image, gravity registration, rotation registration and zoom registration are performed, and the number of difference pixels after registration is calculated to determine the relationship between the target to be tracked and Whether the tracked target is the same target, and determine the rotation angle and scaling ratio through curve fitting to achieve accurate target tracking.
It improves the accuracy and precision of target tracking, ensures target continuity between frames, and enhances the stability and safety of the intelligent driving system.
Smart Images

Figure CN118552582B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of intelligent driving technology, and in particular to a target tracking method, device, electronic device and storage medium. Background Art
[0002] With the application of AI technology in the fields of autonomous driving and assisted driving, the ability to process AI network results is becoming increasingly important.
[0003] In the process of target recognition, since the semantic segmentation network outputs the target segmentation map and the target detection network outputs the target detection box, how to associate the target between frames based on the target segmentation map and the target detection box to achieve accurate tracking of the target has become a key point of current technology. Summary of the invention
[0004] The present invention provides a target tracking method, device, electronic equipment and storage medium to achieve accurate tracking of a target.
[0005] In a first aspect, an embodiment of the present invention provides a target tracking method, the method comprising:
[0006] Associating the tracked target of the previous frame target image with the target to be tracked of the current frame target image;
[0007] Perform gravity center registration for the tracked target and the target to be tracked;
[0008] Performing rotation registration and / or scaling registration on the target to be tracked and the tracked target after the center of gravity registration;
[0009] Calculate the number of difference pixels between the target to be tracked and the tracked target after registration;
[0010] Whether the target to be tracked and the tracked target are the same target is determined according to the number of difference pixels, so as to track the target in the current frame.
[0011] Furthermore, the rotational registration and / or scaling registration of the target to be tracked and the tracked target after the center of gravity registration includes:
[0012] Rotating and / or scaling the target to be tracked after the center of gravity registration, and calculating the number of pixels where the rotated and / or scaled target to be tracked does not match the tracked target;
[0013] Performing curve fitting on the number of inconsistently matched pixels calculated after rotating at different angles and / or scaling at different ratios;
[0014] Determine, according to the fitted curve, a target rotation angle and / or a target scaling ratio corresponding to a minimum value of the number of pixels with inconsistent matching;
[0015] The target to be tracked after the center of gravity is aligned is rotated and / or scaled according to the target rotation angle and / or the target scaling ratio.
[0016] Furthermore, the center of gravity of the tracked target and the target to be tracked is aligned, including:
[0017] Scale the target to be tracked according to the size of the tracked target;
[0018] Calculate the center of gravity of the target to be tracked after scaling;
[0019] Move the position of the target to be tracked in the image so that the center of gravity of the target to be tracked is at the same position as the center of gravity of the tracked target in the image.
[0020] Furthermore, after the position of the target to be tracked in the image is moved so that the center of gravity of the target to be tracked and the center of gravity of the tracked target are at the same position in the image, the method further comprises:
[0021] Determine the intersection of the target to be tracked and the tracked target after movement, and use the determined intersection as the target overlap area;
[0022] Calculate the center of gravity of the target overlap area;
[0023] Calculate the difference between the center of gravity of the tracked target and the center of gravity of the target overlap area to obtain a first center of gravity difference value;
[0024] If the first centroid difference is less than the set difference threshold, it is determined that the centroids of the tracked target and the target to be tracked are aligned.
[0025] Further, determining whether the target to be tracked and the tracked target are the same target according to the number of difference pixels so as to track the target in the current frame includes:
[0026] Calculate the ratio of the number of difference pixels to the total number of pixels of the target to be tracked, and obtain the correlation coefficient between the target to be tracked and the tracked target;
[0027] It is determined whether the target to be tracked and the tracked target are the same target according to the correlation coefficient, so as to track the target in the current frame.
[0028] Furthermore, associating the tracked target of the previous frame target image with the target to be tracked of the current frame target image includes:
[0029] Input the current frame target image into the target detection network, and output the target detection frame of the target to be tracked in the current frame, which is recorded as the current detection frame;
[0030] Input the current frame target image into the semantic segmentation network, and output the segmentation area of the target to be tracked in the current frame, which is recorded as the current segmentation map;
[0031] According to the image position, associate the current detection box with the target segmentation area of the target to be tracked in the current segmentation map;
[0032] According to the type of the detected target, the tracked target in the previous detection frame is associated with the target to be tracked in the current detection frame, where the previous detection frame is the target detection frame of the tracked target in the target image of the previous frame.
[0033] In a second aspect, an embodiment of the present invention further provides a target tracking device, the device comprising:
[0034] A target association module is used to associate the tracked target of the previous frame target image with the target to be tracked of the current frame target image;
[0035] A center-of-gravity registration module is used to perform center-of-gravity registration on the tracked target and the target to be tracked;
[0036] A rotation registration module, used for performing rotation registration and / or scaling registration on the target to be tracked and the tracked target after the center of gravity registration;
[0037] The difference calculation module is used to calculate the number of difference pixels between the target to be tracked and the tracked target after registration;
[0038] The target tracking module is used to determine whether the target to be tracked and the tracked target are the same target according to the number of difference pixels, so as to track the target in the current frame.
[0039] Furthermore, the rotation registration module comprises
[0040] A first rotation unit is used to rotate and / or scale the target to be tracked after the center of gravity is aligned, and calculate the number of pixels of the rotated and / or scaled target to be tracked that are inconsistent with the tracked target;
[0041] A fitting unit, used for performing curve fitting on the number of inconsistently matched pixels calculated after rotating at different angles and / or scaling at different ratios;
[0042] An angle determination unit, used to determine, according to the fitted curve, a target rotation angle and / or a target scaling ratio corresponding to a minimum number of pixels with inconsistent matching;
[0043] The second rotation unit is used to rotate and / or scale the target to be tracked after the center of gravity is aligned according to the target rotation angle and / or the target scaling ratio.
[0044] In a third aspect, an embodiment of the present invention provides an electronic device, the device comprising:
[0045] one or more processors;
[0046] a storage device for storing one or more programs,
[0047] When the one or more programs are executed by the one or more processors, the one or more processors implement a target tracking method as described in any one of the embodiments of the present invention.
[0048] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a target tracking method as described in any one of the embodiments of the present invention.
[0049] The technical solution provided by the embodiment of the present invention further aligns the center of gravity, rotation angle and scaling ratio of the target to be tracked after target association, and determines whether they are the same target based on the pixel difference between the aligned targets, thereby improving the accuracy of target tracking.
[0050] By performing curve fitting on the number of inconsistently matched pixels calculated after rotation at different angles and / or scaling at different ratios, the target rotation angle and / or target scaling ratio corresponding to the minimum number of inconsistently matched pixels is determined according to the fitted curve, thereby achieving accurate alignment of the rotation angle and scaling ratio of the tracked target with the target to be tracked.
[0051] By moving the position of the target to be tracked in the image so that the center of gravity of the target to be tracked is at the same position as the center of gravity of the tracked target in the image, the success of the center of gravity matching is judged based on the center of gravity of the intersection of the target to be tracked and the tracked target after the movement, thereby further improving the accuracy of the center of gravity alignment of the target to be tracked and the tracked target. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0053] Figure 1 is a flow chart of a target tracking method provided by an embodiment of the present invention;
[0054] Figure 2 is a schematic structural diagram of a target tracking device provided by an embodiment of the present invention;
[0055] Figure 3 It is a structural schematic diagram of a device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.
[0057] In the description of the present invention, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" and "plurality" refer to two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be different.
[0058] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way for easy understanding.
[0059] In addition, the terms "including" and "having" and any variations thereof mentioned in the description of this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or modules is not limited to the listed steps or modules, but may optionally include other steps or modules that are not listed, or may optionally include other steps or modules that are inherent to these processes, methods, products or devices.
[0060] In order to make the purpose, technical solutions and advantages of the present invention more clear, the following will be described through specific embodiments in conjunction with the accompanying drawings of the present invention.
[0061] Figure 1 This is a flowchart of a target tracking method provided by an embodiment of the present invention. This method is applicable to scenarios where a target is tracked. Typically, this method can be applied to tracking targets such as pedestrians, riders or vehicles, and when the target is close to the vehicle or in the blind spot, collision warning or braking is performed. This method is applied to a target tracking device, which can be installed on a moving vehicle, which can be a passenger car or a commercial vehicle. See Figure 1 , a target tracking method provided by an embodiment of the present invention includes:
[0062] S110, associating the tracked target in the previous frame target image with the target to be tracked in the current frame target image.
[0063] The tracking target can be any target that needs to be tracked, such as pedestrians, riders, vehicles, pets, etc.
[0064] A tracked target is a target that has established an association with the target in the previous frame.
[0065] The target to be tracked is a target to be associated with the tracked target.
[0066] There are many methods for associating the tracked target with the target to be tracked, such as making a preliminary association determination based on the position of the target in the image, the type of the target and / or the shape of the target. As long as the preliminary determination can be achieved in a short time and efficiently, accurate determination is not required.
[0067] Optionally, associating the tracked target of the previous frame target image with the target to be tracked of the current frame target image includes:
[0068] Input the current frame target image into the target detection network, and output the target detection frame of the target to be tracked in the current frame, which is recorded as the current detection frame;
[0069] Input the current frame target image into the semantic segmentation network, and output the segmentation area of the target to be tracked in the current frame, which is recorded as the current segmentation map;
[0070] According to the image position, associate the current detection box with the target segmentation area of the target to be tracked in the current segmentation map;
[0071] According to the type of the detected target, the tracked target in the previous detection frame is associated with the target to be tracked in the current detection frame, where the previous detection frame is the target detection frame of the tracked target in the target image of the previous frame.
[0072] The target detection network is a network used for target detection, and the output is a target detection frame. Specifically, the target detection network can be YOLOv5 or other model networks, which is not limited in this embodiment. YOLOv5 is a target detection model, which is the latest version of the YOLO (You Only Look Once) series.
[0073] The semantic segmentation network is a network used to segment the target region, and the output is the target region. Specifically, the semantic segmentation network can be a fully convolutional neural network or other classic network models, which is not limited in this embodiment.
[0074] S120: Perform centroid registration on the tracked target and the target to be tracked.
[0075] Specifically, the center of gravity of the detection frame of the target to be tracked can be moved to the center of gravity of the detection frame of the tracked target to achieve the alignment of the centers of gravity of the two.
[0076] The inventors found in the process of implementing the present invention that the center of gravity of the target detection frame cannot accurately describe the center of gravity of the target. In addition, the difference in target size also affects the target registration accuracy. Therefore, in order to improve the registration accuracy of the target center of gravity, the center of gravity of the tracked target and the target to be tracked are registered, including:
[0077] Scale the target to be tracked according to the size of the tracked target;
[0078] Calculate the center of gravity of the target to be tracked after scaling;
[0079] Move the position of the target to be tracked in the image so that the center of gravity of the target to be tracked is at the same position as the center of gravity of the tracked target in the image.
[0080] To further improve the center-of-gravity registration accuracy of the target to be tracked and the tracked target, after moving the position of the target to be tracked in the image so that the center of gravity of the target to be tracked and the center of gravity of the tracked target are at the same position in the image, the method further includes:
[0081] Determine the intersection of the target to be tracked and the tracked target after movement, and use the determined intersection as the target overlap area;
[0082] Calculate the center of gravity of the target overlap area;
[0083] Calculate the difference between the center of gravity of the tracked target and the center of gravity of the target overlap area to obtain a first center of gravity difference value;
[0084] If the first centroid difference is less than the set difference threshold, it is determined that the centroids of the tracked target and the target to be tracked are aligned.
[0085] S130: performing rotational registration and / or scaling registration on the target to be tracked and the tracked target after the center of gravity registration.
[0086] Optionally, the rotational alignment may be performed based on the longest side in the target area, or based on a certain feature point in the target area.
[0087] The registration can be done by scaling based on the size of the target region.
[0088] To achieve registration accuracy, the target to be tracked and the tracked target after the center of gravity registration are subjected to rotation registration and / or scaling registration, including:
[0089] Rotating and / or scaling the target to be tracked after the center of gravity registration, and calculating the number of pixels where the rotated and / or scaled target to be tracked does not match the tracked target;
[0090] Performing curve fitting on the number of inconsistently matched pixels calculated after rotating at different angles and / or scaling at different ratios;
[0091] Determine, according to the fitted curve, a target rotation angle and / or a target scaling ratio corresponding to a minimum value of the number of pixels with inconsistent matching;
[0092] The target to be tracked after the center of gravity is aligned is rotated and / or scaled according to the target rotation angle and / or the target scaling ratio.
[0093] S140, calculating the number of difference pixels between the target to be tracked and the tracked target after registration.
[0094] S150: Determine whether the target to be tracked and the tracked target are the same target according to the number of difference pixels, so as to track the target in the current frame.
[0095] Optionally, determining whether the target to be tracked and the tracked target are the same target according to the number of difference pixels includes:
[0096] If the number of difference pixels is less than the set threshold number, it is determined that the target to be tracked and the tracked target are the same target.
[0097] In order to improve the tracking accuracy, the step of determining whether the target to be tracked and the tracked target are the same target according to the number of difference pixels, so as to track the target in the current frame, includes:
[0098] Calculate the ratio of the number of difference pixels to the total number of pixels of the target to be tracked, and obtain the correlation coefficient between the target to be tracked and the tracked target;
[0099] It is determined whether the target to be tracked and the tracked target are the same target according to the correlation coefficient, so as to track the target in the current frame.
[0100] The above registration is achieved by adjusting the target to be tracked, and optionally, may also be achieved by adjusting the tracked target, which is not limited in this embodiment.
[0101] The technical solution provided by the embodiment of the present invention further aligns the center of gravity, rotation angle and scaling ratio of the target to be tracked after target association, and determines whether they are the same target based on the pixel difference between the aligned targets, thereby improving the accuracy of target tracking.
[0102] Taking the tracking target as a vehicle traveling in front of or beside the vehicle as an example, the above method can be described as follows:
[0103] Input the current frame target image into the target detection network, and output the target detection frame of the target to be tracked in the current frame, which is recorded as the current detection frame;
[0104] Copy the current frame target image and the current frame detection frame as image copies;
[0105] Input the current frame target image into the semantic segmentation network, and output the segmentation area of the target to be tracked in the current frame, which is recorded as the current segmentation map;
[0106] According to the image position, associate the current detection box with the target segmentation area of the target to be tracked in the current segmentation map;
[0107] According to the type of the detected target, associate the tracked target in the previous detection frame with the target to be tracked in the current detection frame, where the previous detection frame is the target detection frame of the tracked target in the target image of the previous frame;
[0108] Scaling the image of the current detection frame according to the size of the associated previous detection frame, and recording the scaling ratio as a first scaling ratio;
[0109] According to the target segmentation area in the current detection frame after scaling, the center of gravity of the target in the current detection frame after scaling is calculated;
[0110] Move the image of the current detection frame so that the center of gravity of the target to be tracked in the current detection frame coincides with the center of gravity of the tracked target in the previous detection frame, and record the displacement data of the movement as the first displacement information;
[0111] Take the intersection of the current detection frame and the target in the previous detection frame to get the target overlap area;
[0112] Calculate the center of gravity of the target overlap area;
[0113] Calculate the difference between the center of gravity of the tracked target in the previous detection frame and the center of gravity of the target overlap area to obtain a first center of gravity difference;
[0114] If the first centroid difference is less than the set difference threshold, the intersection of the detection frame of the target overlap area and the previous detection frame is calculated to obtain a new detection frame;
[0115] Rotate the image of the new detection frame and calculate the number of pixels where the target area in the new detection frame after rotation is inconsistent with that in the previous detection frame;
[0116] Perform curve fitting on the number of pixels with inconsistent matching in the target area calculated after rotating at different angles;
[0117] According to the fitted curve, the target rotation angle corresponding to the minimum number of pixels with inconsistent matching is determined;
[0118] Rotate the image of the new detection frame according to the target rotation angle;
[0119] Scale the image of the rotated new detection frame according to the set different scaling ratios;
[0120] Count the number of pixels where the zoomed detection frame and the target area in the previous detection frame do not match each other;
[0121] Perform curve fitting on the number of pixels with inconsistent matching in the target area calculated after scaling at different angles;
[0122] According to the fitted curve, determine the target scaling ratio corresponding to the minimum number of pixels with inconsistent matching;
[0123] According to the first scaling ratio, the first displacement information, the target rotation angle and the target scaling ratio, scaling, moving and rotating the target area of the target to be tracked in the current detection frame in the image copy to obtain an adjusted target area;
[0124] Calculate the number of difference pixels between the adjusted target area and the target area in the previous detection frame;
[0125] Calculate the ratio of the number of difference pixels to the total number of pixels in the target area to obtain the correlation coefficient between the tracked target in the previous detection frame and the target to be tracked in the current detection frame;
[0126] According to the correlation coefficient, it is determined whether the tracked target in the previous detection frame and the target to be tracked in the current detection frame are the same target, so as to track the target in the current frame.
[0127] Figure 2 Schematic diagram of a target tracking device provided by an embodiment of the present invention. Figure 2 As shown, the target tracking device may specifically include the following:
[0128] A target associating module 21 is used to associate a tracked target in a previous frame of target image with a target to be tracked in a current frame of target image;
[0129] A center-of-gravity registration module 22, used for performing center-of-gravity registration on a tracked target and a target to be tracked;
[0130] A rotation registration module 23, used for performing rotation registration and / or scaling registration on the target to be tracked and the tracked target after the center of gravity registration;
[0131] The difference calculation module 24 is used to calculate the number of difference pixels between the target to be tracked and the tracked target after registration;
[0132] The target tracking module 25 is used to determine whether the target to be tracked and the tracked target are the same target according to the number of difference pixels, so as to track the target in the current frame.
[0133] The technical solution provided by the embodiment of the present invention further aligns the center of gravity, rotation angle and scaling ratio of the target to be tracked after target association, and determines whether they are the same target based on the pixel difference between the aligned targets, thereby improving the accuracy of target tracking.
[0134] Furthermore, the rotation registration module comprises
[0135] A first rotation unit is used to rotate and / or scale the target to be tracked after the center of gravity is aligned, and calculate the number of pixels of the rotated and / or scaled target to be tracked that are inconsistent with the tracked target;
[0136] A fitting unit, used for performing curve fitting on the number of inconsistently matched pixels calculated after rotating at different angles and / or scaling at different ratios;
[0137] An angle determination unit, used to determine, according to the fitted curve, a target rotation angle and / or a target scaling ratio corresponding to a minimum number of pixels with inconsistent matching;
[0138] The second rotation unit is used to rotate and / or scale the target to be tracked after the center of gravity is aligned according to the target rotation angle and / or the target scaling ratio.
[0139] Furthermore, the centroid registration module is used to:
[0140] Scale the target to be tracked according to the size of the tracked target;
[0141] Calculate the center of gravity of the target to be tracked after scaling;
[0142] Move the position of the target to be tracked in the image so that the center of gravity of the target to be tracked is at the same position as the center of gravity of the tracked target in the image.
[0143] The target tracking device also includes:
[0144] An overlap region determination module is used for moving the position of the target to be tracked in the image so that the center of gravity of the target to be tracked and the center of gravity of the tracked target are at the same position in the image, determining the intersection of the target to be tracked and the tracked target after the movement, and taking the determined intersection as the target overlap region;
[0145] A center of gravity calculation module is used to calculate the center of gravity of the target overlap area;
[0146] A center of gravity difference module is used to calculate the difference between the center of gravity of the tracked target and the center of gravity of the target overlap area to obtain a first center of gravity difference value;
[0147] The second center of gravity registration module is used to determine that the centers of gravity of the tracked target and the target to be tracked are aligned if the first center of gravity difference is less than a set difference threshold.
[0148] The target tracking module is specifically used for:
[0149] Calculate the ratio of the number of difference pixels to the total number of pixels of the target to be tracked, and obtain the correlation coefficient between the target to be tracked and the tracked target;
[0150] It is determined whether the target to be tracked and the tracked target are the same target according to the correlation coefficient, so as to track the target in the current frame.
[0151] The target association module is specifically used for:
[0152] Input the current frame target image into the target detection network, and output the target detection frame of the target to be tracked in the current frame, which is recorded as the current detection frame;
[0153] Input the current frame target image into the semantic segmentation network, and output the segmentation area of the target to be tracked in the current frame, which is recorded as the current segmentation map;
[0154] According to the image position, associate the current detection box with the target segmentation area of the target to be tracked in the current segmentation map;
[0155] According to the type of the detected target, the tracked target in the previous detection frame is associated with the target to be tracked in the current detection frame, where the previous detection frame is the target detection frame of the tracked target in the target image of the previous frame.
[0156] Figure 3 Schematic diagram of a device provided by an embodiment of the present invention. Figure 3 As shown, the device includes a processor 30, a memory 31, an input device 32 and an output device 33; the number of processors 30 in the device can be one or more. Figure 3 A processor 30 is taken as an example; the processor 30, memory 31, input device 32 and output device 33 in the device can be connected by a bus or other means. Figure 3 The example of connecting through bus is taken in the following.
[0157] The memory 31, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to a target tracking method in an embodiment of the present invention (for example, various modules included in the target tracking device). The processor 30 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 31, that is, realizes the above-mentioned target tracking method.
[0158] The memory 31 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 31 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 31 may further include a memory remotely arranged relative to the processor 30, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0159] The input device 32 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 33 may include a display device such as a display screen.
[0160] An embodiment of the present invention further provides a storage medium containing computer executable instructions, which are used to execute a target tracking method when executed by a computer processor. The method includes:
[0161] Associating the tracked target of the previous frame target image with the target to be tracked of the current frame target image;
[0162] Perform gravity center registration for the tracked target and the target to be tracked;
[0163] Performing rotation registration and / or scaling registration on the target to be tracked and the tracked target after the center of gravity registration;
[0164] Calculate the number of difference pixels between the target to be tracked and the tracked target after registration;
[0165] According to the number of difference pixels, it is determined whether the target to be tracked is the same target as the target already tracked, so as to track the target in the current frame. Of course, the computer executable instructions of the storage medium including computer executable instructions provided by the embodiment of the present invention are not limited to the above method operations, and can also perform related operations in the target tracking method provided by any embodiment of the present invention.
[0166] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various embodiments of the present invention.
[0167] It is worth noting that in the embodiment of the above-mentioned target tracking device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0168] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A target tracking method, characterized in that: The method comprises: Associating the tracked target of the previous frame target image with the target to be tracked of the current frame target image; Perform gravity center registration for the tracked target and the target to be tracked; Performing rotation registration and / or scaling registration on the target to be tracked and the tracked target after the center of gravity registration; Calculate the number of difference pixels between the target to be tracked and the tracked target after registration; Determine whether the target to be tracked and the tracked target are the same target according to the number of difference pixels, so as to track the target in the current frame; The rotation registration and / or scaling registration of the target to be tracked and the tracked target after the center of gravity registration includes: Rotating and / or scaling the target to be tracked after the center of gravity registration, and calculating the number of pixels where the rotated and / or scaled target to be tracked does not match the tracked target; Performing curve fitting on the number of inconsistently matched pixels calculated after rotating at different angles and / or scaling at different ratios; Determine, according to the fitted curve, a target rotation angle and / or a target scaling ratio corresponding to a minimum value of the number of pixels with inconsistent matching; The target to be tracked after the center of gravity is aligned is rotated and / or scaled according to the target rotation angle and / or the target scaling ratio.
2. The method according to claim 1, characterized in that Perform gravity center registration for the tracked target and the target to be tracked, including: Scale the target to be tracked according to the size of the tracked target; Calculate the center of gravity of the target to be tracked after scaling; Move the position of the target to be tracked in the image so that the center of gravity of the target to be tracked is at the same position as the center of gravity of the tracked target in the image.
3. The method according to claim 2, characterized in that After moving the position of the target to be tracked in the image so that the center of gravity of the target to be tracked and the center of gravity of the tracked target are at the same position in the image, the method further comprises: Determine the intersection of the target to be tracked and the tracked target after movement, and use the determined intersection as the target overlap area; Calculate the center of gravity of the target overlap area; Calculate the difference between the center of gravity of the tracked target and the center of gravity of the target overlap area to obtain a first center of gravity difference value; If the first centroid difference is less than the set difference threshold, it is determined that the centroids of the tracked target and the target to be tracked are aligned.
4. The method according to claim 1, characterized in that The step of determining whether the target to be tracked and the tracked target are the same target according to the number of difference pixels, so as to track the target in the current frame, includes: Calculate the ratio of the number of difference pixels to the total number of pixels of the target to be tracked, and obtain the correlation coefficient between the target to be tracked and the tracked target; It is determined whether the target to be tracked and the tracked target are the same target according to the correlation coefficient, so as to track the target in the current frame.
5. The method according to claim 1, characterized in that The associating the tracked target of the previous frame target image with the target to be tracked of the current frame target image includes: Input the current frame target image into the target detection network, and output the target detection frame of the target to be tracked in the current frame, which is recorded as the current detection frame; Input the current frame target image into the semantic segmentation network, and output the segmentation area of the target to be tracked in the current frame, which is recorded as the current segmentation map; According to the image position, associate the current detection box with the target segmentation area of the target to be tracked in the current segmentation map; According to the type of the detected target, the tracked target in the previous detection frame is associated with the target to be tracked in the current detection frame, where the previous detection frame is the target detection frame of the tracked target in the target image of the previous frame.
6. A target tracking device, characterized in that: The device comprises: A target association module is used to associate the tracked target of the previous frame target image with the target to be tracked of the current frame target image; A center-of-gravity registration module is used to perform center-of-gravity registration on the tracked target and the target to be tracked; A rotation registration module, used for performing rotation registration and / or scaling registration on the target to be tracked and the tracked target after the center of gravity registration; The difference calculation module is used to calculate the number of difference pixels between the target to be tracked and the tracked target after registration; The target tracking module is used to determine whether the target to be tracked and the tracked target are the same target according to the number of difference pixels, so as to track the target in the current frame; The rotation registration module comprises A first rotation unit is used to rotate and / or scale the target to be tracked after the center of gravity is aligned, and calculate the number of pixels of the rotated and / or scaled target to be tracked that are inconsistent with the tracked target; A fitting unit, used for performing curve fitting on the number of inconsistently matched pixels calculated after rotating at different angles and / or scaling at different ratios; An angle determination unit, used to determine, according to the fitted curve, a target rotation angle and / or a target scaling ratio corresponding to a minimum number of pixels with inconsistent matching; The second rotation unit is used to rotate and / or scale the target to be tracked after the center of gravity is aligned according to the target rotation angle and / or the target scaling ratio.
7. An electronic device, characterized in that: The device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement a target tracking method as described in any one of claims 1-5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a target tracking method as described in any one of claims 1 to 5 is implemented.
