Target tracking method, device, electronic device and storage medium

By combining the SURF and Camshift algorithms and adjusting the search window of the Camshift algorithm, the problem of target tracking loss in complex backgrounds or with similar colors is solved, achieving higher tracking accuracy and stability.

CN114723778BActive Publication Date: 2025-09-12ZHEJIANG UNIVIEW TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011525777.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-22
Publication Date
2025-09-12
Estimated Expiration
2040-12-22

AI Technical Summary

Technical Problem

The Camshift tracking algorithm is prone to target tracking loss in cases with complex backgrounds or pixels of similar colors.

Method used

The SURF algorithm and Camshift algorithm are combined to adjust the search window of the Camshift algorithm by comparing the center of mass positions of the two in the current video frame to track the target in the next video frame.

Benefits of technology

The tracking accuracy of the Camshift algorithm in color interference and occlusion scenes is improved, target loss is avoided, and continuous tracking of moving targets is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114723778B_ABST
    Figure CN114723778B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a target tracking method, device, electronic device and storage medium. The method includes: determining the first center of mass position of the target object tracked based on the SURF algorithm in the current video frame; determining the second center of mass position of the target object tracked based on the Camshift algorithm in the current video frame; by comparing the first center of mass position with the second center of mass position, adjusting the search window of the target object tracked based on the Camshift algorithm in the current video frame, so as to be used when tracking the target object based on the Camshift algorithm in the next video frame. By adopting the solution of the present application, the Camshift tracking algorithm is integrated with fast robustness features through the SURF algorithm, thereby ensuring the accuracy of the Camshift tracking results when tracking using the Camshift tracking algorithm, and solving the problem of target loss caused by Camshift in color interference and occlusion scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of video surveillance technology, and in particular to a target tracking method, device, electronic device and storage medium. Background Art

[0002] Motion target tracking is a key technology in the field of computer vision and machine learning. Its task is to obtain the moving target of interest from the video sequence in real time and track the moving target continuously.

[0003] The traditional CamShift tracking algorithm uses a color histogram to represent the target's color probability. This algorithm performs well for both regular and irregular objects, offering high efficiency and rapid target tracking. However, in complex backgrounds or when there are many pixels with similar colors to the target, the CamShift tracking algorithm is prone to target loss, leading to target tracking failure. Summary of the Invention

[0004] In view of the above problems, embodiments of the present invention provide a target tracking method, device, electronic device, and storage medium to achieve accurate and stable tracking of moving target objects in a video.

[0005] In a first aspect, an embodiment of the present invention provides a target tracking method, the method comprising:

[0006] Determine the first centroid position of the target object tracked based on the SURF algorithm in the current video frame;

[0007] Determine the second centroid position of the target object tracked based on the Camshift algorithm in the current video frame;

[0008] By comparing the first center of mass position with the second center of mass position, the search window of the target object tracked based on the Camshift algorithm in the current video frame is adjusted for use when tracking the target object based on the Camshift algorithm in the next video frame.

[0009] In a second aspect, an embodiment of the present invention further provides a target tracking device, the device comprising:

[0010] A first centroid determination module is used to determine the first centroid position of the target object tracked based on the SURF algorithm in the current video frame;

[0011] A second centroid determination module is used to determine the second centroid position of the target object tracked based on the Camshift algorithm in the current video frame;

[0012] A target object tracking module is used to adjust the search window of the target object tracked based on the Camshift algorithm in the current video frame by comparing the first center of mass position with the second center of mass position, so as to be used when tracking the target object based on the Camshift algorithm in the next video frame.

[0013] In a third aspect, an embodiment of the present invention further provides an electronic device, including:

[0014] one or more processors;

[0015] a storage device for storing one or more programs;

[0016] The one or more programs are executed by the one or more processors, so that the one or more processors implement the target tracking method as described in any embodiment of the present invention.

[0017] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the target tracking method as described in any embodiment of the present invention is implemented.

[0018] An embodiment of the present invention provides a target tracking method, which determines the first center of mass position of the target object tracked based on the SURF algorithm in the current video frame and determines the second center of mass position of the target object tracked based on the Camshift algorithm in the current video frame; then, by comparing the first center of mass position with the second center of mass position, the search window of the target object tracked based on the Camshift algorithm in the current video frame is adjusted for use when tracking the target object based on the Camshift algorithm in the next video frame.

[0019] By adopting the solution of this application, the tracking results of the SURF algorithm and the Camshift algorithm will be compared and judged in each round of target tracking. The search window of the Camshift tracking algorithm will be updated in real time through comparison so that the updated search window can be used when tracking the target in the next video frame. The SURF algorithm allows the Camshift tracking algorithm to integrate fast and robust features to ensure the accuracy of the Camshift tracking results when tracking using the Camshift tracking algorithm, and solves the problem of Camshift losing target tracking in color interference and occlusion scenarios.

[0020] The above content of the invention is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Other features, objects, and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments made with reference to the following drawings. The drawings are for the purpose of illustrating preferred embodiments only and are not to be considered as limiting the present invention. Like reference characters are used throughout the drawings to denote like parts. In the drawings:

[0022] Figure 1 is a flow chart of a target tracking method provided in an embodiment of the present invention;

[0023] Figure 2 is a flow chart of another target tracking method provided in an embodiment of the present invention;

[0024] Figure 3 is a structural block diagram of a target tracking device provided in an embodiment of the present invention;

[0025] Figure 4 It is a structural diagram of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0026] The present invention will be further described in detail below with reference to the accompanying drawings and examples. It will be understood that the specific embodiments described herein are intended only to illustrate the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions relevant to the present invention, not all structures.

[0027] Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the various operations (or steps) as sequential processes, many of the operations (or steps) therein can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the various operations can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0028] In order to better understand the target tracking solution in this application, the following is a brief explanation of the SURF algorithm and the Camshift algorithm. In the related art, when the Camshift algorithm tracking fails, the SURF algorithm is enabled to re-position, and the Camshift algorithm initializes the search window to re-track. However, the SURF algorithm is used to locate the target after the target is lost, which is not conducive to the continuous tracking of the moving target. In addition, the Camshift tracking algorithm is prone to the problem of losing the tracking target when the background is complex or there are many pixels with similar colors to the target. Therefore, it is very important to continuously track the target object and avoid the situation of losing the target as much as possible.

[0029] The target tracking method, device, electronic device and storage medium provided in the solution of this application are described in detail below through the following embodiments and optional solutions.

[0030] Figure 1 This is a flow chart of a target tracking method provided in an embodiment of the present invention. The embodiment of the present invention is applicable to the case of tracking a moving target in a video. The target tracking method can be executed by a target tracking device, which can be implemented in software and / or hardware and can be integrated into any electronic device with network communication function, such as a video surveillance device. Figure 1 As shown, the target tracking method in this embodiment may include the following steps:

[0031] S110: Determine a first centroid position of a target object tracked based on a SURF algorithm in a current video frame.

[0032] In this embodiment, SURF is an algorithm for feature point extraction and matching. It extracts local features of the image and has good invariance to translation, rotation, scaling, brightness changes, occlusion, and noise. It also maintains a certain degree of stability to visual changes and affine changes. It can be seen that the SURF algorithm has excellent robustness characteristics and is effective and accurate in locating target objects. The SURF algorithm can well locate the target object in the video frame image. Therefore, the SURF algorithm is introduced in the present application solution to perform real-time positioning of the target object in each video frame image to avoid the target object being lost as much as possible.

[0033] In this embodiment, a video segment can be cut and divided into multiple video frames (video sequences), and the multiple video frame images can be tracked in turn. Taking the current video frame currently obtained as an example, the SURF algorithm can be used to extract feature points from the current video frame image and match the extracted feature points, thereby obtaining the center of mass position of the target object in the current video frame image, which is recorded as the first center of mass position. Among them, the target object can be a target that moves in real time in the environment. It should be noted that the "first" here is used to distinguish the center of mass position determined by the subsequent Camshift algorithm tracking.

[0034] In an optional solution of this embodiment, which can be combined with various optional solutions in one or more of the above embodiments, determining the first centroid position of the target object tracked based on the SURF algorithm in the current video frame can include steps A1-A2:

[0035] Step A1: Determine the pixel position and pixel value of the target object obtained by tracking the target object in the current video frame based on the SURF algorithm.

[0036] Step A2: According to the pixel positions and pixel values ​​of the target object, a first centroid position of the target object in the current video frame is obtained by a preset centroid position calculation formula based on SURF algorithm tracking.

[0037] In this embodiment, for the current video frame in a video, fast and robust features for detecting moving targets, namely SURF feature points, are extracted. The extracted SURF feature points are then matched using the Hausdorff distance. If the extracted SURF feature points are successfully matched, the pixel position (x, y) and pixel value I(x, y) of the moving target object tracked in the current video frame are determined.

[0038] In this embodiment, after determining the pixel position and pixel value of the target object, the center position of the moving target object tracked by the SURF algorithm can be calculated by the centroid position calculation formula, specifically expressed as the centroid position O(x, y). Among them, the zero-order moment M 00 and the first-order moment M 01 、M 10 They are:

[0039]

[0040]

[0041]

[0042] After the above zero-order moment M 00 and the first-order moment M 01 、M10 , the first centroid position of the target object in the current video frame can be obtained as: The first center of mass position of the moving target object is recorded as O(x0, y0).

[0043] S120: Determine a second center of mass position of the target object tracked based on the Camshift algorithm in the current video frame.

[0044] In this embodiment, after determining the initial search window of the Camshift algorithm, the target object included in the current video frame can be tracked once based on the Camshift algorithm, that is, the Camshift tracking algorithm is executed once, and the tracking search window is updated once. At this time, the zero-order moment and the first-order moment of the search window are recorded as m 00 , m 10 , m 01 , then the Camshift algorithm tracks the new position (x', y') of the moving target object in the current video frame, specifically: The new position is recorded as the second center of mass position O'(x', y') of the target object tracked based on the Camshift algorithm in the current video frame. In addition to determining the second center of mass position O'(x', y') of the target object tracked based on the Camshift algorithm in the current video frame, the window size information of the search window after tracking update can also be determined. The width W' and length H' of the window size are recorded as:

[0045] In an optional solution of this embodiment, which can be combined with various optional solutions in one or more of the above embodiments, when the Camshift algorithm is used to track the target object for the first time in the current video frame, determining the second center of mass position of the target object tracked based on the Camshift algorithm in the current video frame may include the following steps B1-B3:

[0046] Step B1: Taking the first centroid position as the center, determine the minimum bounding rectangle of the target object located and tracked using the SURF algorithm in the current video frame.

[0047] Step B2: Use the minimum bounding rectangle of the target object in the current video frame as the initial search window of the Camshift algorithm.

[0048] Step B3: According to the initialization search window of the Camshift algorithm, the Camshift algorithm is used to track the target object in the current video frame, and the centroid position of the search window tracked in the current video frame is used as the second centroid position.

[0049] In this embodiment, the first centroid position O(x0, y0) of the target object in the current video frame is taken as the center position, and the four local centroids around the first centroid position O(x0, y0) are respectively recorded as A, B, C and D, with width W and height H. Then the local p+q order moments of the above local centroids are: as well as The local mass centers A, B, C, and D around the first mass center position O(x0, y0) can be determined by the above local p+q order moments. A ,Y A )、(X B ,Y B )、(X C ,Y C ) and (X D ,Y D ), and then we can get the minimum bounding rectangle R(A,B,C,D) of the target object in the current video frame, where A, B, C, and D are the four points of the rectangle. The calculation of each local centroid position is as follows:

[0050]

[0051] In this embodiment, when the Camshift algorithm is used for the first time, the present application solution no longer manually selects a search area to initialize the Camshift algorithm's search window. Instead, the SURF algorithm is used to locate and track the target object's minimum bounding rectangle in the current video frame to initialize the Camshift algorithm's search window. By changing the traditional manual selection of the search area to initialize the Camshift algorithm's search window, the Camshift search window is automatically initialized using the SURF tracking algorithm's value assignment.

[0052] In this embodiment, after initializing the search window of the Camshift algorithm, the Camshift algorithm can track the target object in the current video frame according to the initialized search window, and use the center of mass position indicated by the updated search window tracked in the current video frame as the second center of mass position of the target object tracked by the Camshift algorithm in the current video frame. The updated search window tracked by the Camshift algorithm in the current video frame can also include a window size of the search window.

[0053] Using the above method, the first search is performed through the SURF algorithm, and the minimum enclosing rectangle of the target object's center of mass is determined. The search window of the Camshift algorithm is initialized by the minimum enclosing rectangle of the located target object's center of mass. During the first tracking process of the Camshift algorithm, a more accurate search window is constructed by the SURF algorithm, so the target object in the current video frame can be correctly tracked.

[0054] In another optional solution of this embodiment, which can be combined with each optional solution in one or more of the above embodiments, when the Camshift algorithm is not used for tracking the target object in the current video frame for the first time, determining the second center of mass position of the target object tracked based on the Camshift algorithm in the current video frame may include steps C1-C2:

[0055] Step C1: determining a new search window obtained by adjusting a search window obtained by tracking a target object in a previous video frame based on a Camshift algorithm.

[0056] Step C2: According to the new search window obtained by adjusting the previous video frame, the Camshift algorithm is used to track the target object in the current video frame, and the centroid position of the search window tracked in the current video frame is used as the second centroid position.

[0057] Using the above method, each time tracking is performed, the first center of mass position and the second center of mass position of the target object in the current video frame are compared and determined, so that the search window updated by the Camshift algorithm in the current video frame is adjusted in real time, and the optimal search window center of mass position and size are constructed. The adjusted optimal search window is then iterated to the next video frame for use in Camshift algorithm tracking, thereby improving the correct tracking of the target object in the next video frame, and achieving continuous tracking of the target object by continuously iterative tracking in different video frames.

[0058] S130. Adjust the search window of the target object tracked based on the Camshift algorithm in the current video frame by comparing the first center of mass position with the second center of mass position, so as to be used when tracking the target object based on the Camshift algorithm in the next video frame.

[0059] In this embodiment, the above-described method is used. For each video frame, while the Camshift algorithm is used to track the target in each video frame, the SURF algorithm is also used to track the target once. In other words, the SURF algorithm is not only used during the initial tracking, but is also used once for tracking the target object in each video frame. Thus, after each iteration of the Camshift algorithm tracking the target object in the video frame, the second center of mass position obtained by the Camshift algorithm is compared in real time with the first center of mass position obtained by the SURF algorithm to determine which algorithm has the more accurate tracking result. This allows for real-time adjustment of the search window obtained by the Camshift algorithm, effectively avoiding the risk of losing the moving target object due to color interference and occlusion caused by a single algorithm. Furthermore, based on the real-time comparison of the two algorithms, the search window updated by the Camshift algorithm is adjusted in real time, and the adjusted new search window is loaded into the next video frame for use by the Camshift algorithm, thereby improving the tracking accuracy of the target object in the next video frame.

[0060] According to the target tracking method provided in an embodiment of the present invention, the tracking results of the SURF algorithm and the Camshift algorithm are compared and judged in each round of target tracking. The search window of the Camshift tracking algorithm is updated in real time through comparison so that the updated search window can be used when tracking the target in the next video frame. The SURF algorithm is used to allow the Camshift tracking algorithm to integrate fast and robust features, thereby ensuring the accuracy of the Camshift tracking results when tracking using the Camshift tracking algorithm, and solving the problem of Camshift losing target tracking in color interference and occlusion scenarios.

[0061] Figure 2 This is a flow chart of another target tracking method provided in an embodiment of the present invention. The embodiment of the present invention is optimized based on the above embodiment, and the embodiment of the present invention can be combined with various optional solutions in one or more of the above embodiments. Figure 2 As shown, the target tracking method in the embodiment of the present application may include the following steps:

[0062] S210: Determine a first centroid position of a target object tracked based on a SURF algorithm in a current video frame.

[0063] S220: Determine a second centroid position of the target object tracked based on the Camshift algorithm in the current video frame.

[0064] S230: Determine an inter-center-of-mass similarity metric value between the first center-of-mass position and the second center-of-mass position.

[0065] In this embodiment, when comparing the first centroid position tracked by the SURF algorithm with the second centroid position tracked by the Camshift algorithm, an inter-centroid similarity metric between the first centroid position and the second centroid position can be calculated to determine whether the moving target object is the tracking object, thereby achieving moving target object tracking. The inter-centroid similarity metric can be measured using, but is not limited to, the following: Euclidean distance, weighted distance, Bhattacharyya coefficient, and Hausdorff distance.

[0066] In this embodiment, the Euclidean distance is used as a similarity measurement method to calculate the Euclidean distance between the first center of mass position O(x,y) of the moving target object tracked by the SURF algorithm in the current video frame and the second center of mass position O'(x',y') of the moving target object tracked by Camshift in the current video frame, which is recorded as the Euclidean distance between the centers of mass Dist[O(x,y),O'(x',y')], and the Euclidean distance between the centers of mass Dist[O(x,y),O'(x',y')] is used as the similarity measurement value between the centers of mass. The calculation formula of the Euclidean distance between the centers of mass Dist[O(x,y),O'(x',y')] is as follows:

[0067]

[0068] S240. If it is determined that the similarity measure value between the centroids is greater than the preset measure threshold, the first centroid position tracked in the current video frame based on the SURF algorithm and the window size of the search window tracked in the current video frame based on the Camshift algorithm are combined to construct a new search window.

[0069] In this embodiment, taking the example of using Euclidean distance to represent the similarity measure between centroids, a preset threshold distance T0 of the Euclidean distance can be pre-set. If it is detected that the Euclidean distance between centroids is greater than the preset threshold distance T0 of the Euclidean distance, it is considered that the second centroid position of the target object tracked in the current video frame based on the Camshift algorithm is inaccurate. At this time, the Camshift algorithm is likely to have a deviation in the tracking position of the target object. If the second centroid position tracked in the current video frame is continued to be used for Camshift tracking in the next video frame, the deviation will become larger and larger, causing the Camshift algorithm to lose the target object. Among them, the comparison logic of the similarity measure between centroids represented by the Bhattacharyya coefficient, weighted distance, and Hausdorff distance is similar and will not be repeated here.

[0070] In this embodiment, after detecting that the second centroid position tracked by the Camshift algorithm in the current video frame deviates, the first centroid position tracked by the SURF algorithm in the current video frame can be used as the standard, and at the same time, in order to reduce the influence of the minimum bounding rectangle on the target object tracking in the next video frame, the application can reconstruct the search window by combining the first centroid O(x, y) of the moving target object tracked by the SURF algorithm in the current video frame with the window size (width W' and length H') of the search window tracked by Camshift in the current video frame to obtain a new search window.

[0071] S250: Iterate the new search window constructed in the current video frame to the next video frame, so as to be used when tracking the target object based on the Camshift algorithm in the next video frame.

[0072] In this embodiment, each tracking step is compared and determined based on the center of mass positions tracked by the SURF algorithm and the Camshift algorithm. In the event of loss or tracking deviation, the current search window size tracked by the Camshift algorithm and the center of mass located by the SURF algorithm are combined to reconstruct the search window and position for the next iteration. Using the parameters obtained by the SURF tracking algorithm as a test condition, each time a SURF tracking and Camshift tracking step is completed, the center of mass selection and search box selection for the SURF and Camshift algorithms are performed. Simultaneously, the currently reconstructed search window is used by the Camshift algorithm to continuously track the moving target object in the next video frame until the moving target object is tracked in each video frame.

[0073] In this embodiment, optionally, by comparing the first center of mass position with the second center of mass position, the search window of the target object tracked based on the Camshift algorithm in the current video frame is adjusted, and it also includes: if it is determined that the similarity measure value between the centers of mass is less than or equal to a preset measure threshold, then the search window tracked based on the Camshift algorithm in the current video frame is continued to be maintained for use when iterating to the next video frame to track the target object based on the Camshift algorithm.

[0074] According to the target tracking method provided in the embodiment of the present invention, the tracking results of the SURF algorithm and the Camshift algorithm are compared and judged in each round of target tracking. The search window of the Camshift tracking algorithm is updated in real time through comparison, so that the updated search window can be used when tracking the target in the next video frame. Since the SURF algorithm has scale and direction robustness, combined with the unique color features of the Camshift algorithm, it can effectively circumvent the defects of "SURF is insensitive to color" and "Camshift is insensitive to size and direction changes". The Camshift tracking algorithm is integrated with fast and robust features through the SURF algorithm, which can ensure that the moving target can be accurately tracked when there is size scaling and direction changes. This makes the accuracy of the Camshift tracking results when tracking using the Camshift tracking algorithm more accurate, and solves the problem of Camshift losing target in color interference and occlusion scenarios.

[0075] Figure 3 This is a structural block diagram of a target tracking device provided in an embodiment of the present invention. The embodiment of the present invention is applicable to the case of tracking moving targets in a video. The device can be implemented in software and / or hardware and can be integrated into any electronic device with network communication function. Figure 1 As shown, the target tracking device in this embodiment may include the following: a first mass center determination module 310, a second mass center determination module 320, and a target object tracking module 330.

[0076] A first centroid determination module 310 is configured to determine a first centroid position of a target object tracked based on a SURF algorithm in a current video frame;

[0077] A second centroid determination module 320 is configured to determine a second centroid position of a target object tracked based on a Camshift algorithm in a current video frame;

[0078] The target object tracking module 330 is used to adjust the search window of the target object tracked based on the Camshift algorithm in the current video frame by comparing the first center of mass position with the second center of mass position, so as to be used when tracking the target object based on the Camshift algorithm in the next video frame.

[0079] Based on the above embodiment, optionally, the first centroid determination module 310 includes:

[0080] Determine the pixel position and pixel value of the target object obtained by tracking the target object in the current video frame based on the SURF algorithm;

[0081] According to the pixel position and pixel value of the target object, the first centroid position of the target object in the current video frame determined by tracking based on the SURF algorithm is obtained by using a preset centroid position calculation formula.

[0082] Based on the above embodiment, optionally, the second centroid determination module 320 includes:

[0083] Determine the minimum bounding rectangle of the target object located and tracked using the SURF algorithm in the current video frame, with the first centroid position as the center;

[0084] The minimum bounding rectangle of the target object in the current video frame is used as the initial search window of the Camshift algorithm;

[0085] According to the initialization search window of the Camshift algorithm, the Camshift algorithm is used to track the target object in the current video frame, and the centroid position of the search window tracked in the current video frame is used as the second centroid position.

[0086] Based on the above embodiment, optionally, the second centroid determination module 320 includes:

[0087] Determining a new search window obtained by adjusting a search window obtained by tracking a target object in a previous video frame based on a Camshift algorithm;

[0088] According to the new search window obtained by adjusting the previous video frame, the Camshift algorithm is used to track the target object in the current video frame, and the center of mass position of the search window tracked in the current video frame is used as the second center of mass position.

[0089] Based on the above embodiment, optionally, the target object tracking module 330 includes:

[0090] determining an inter-centroid similarity measure between the first centroid position and the second centroid position;

[0091] If it is determined that the similarity measure value between the centroids is greater than the preset measure threshold, the first centroid position tracked in the current video frame based on the SURF algorithm and the window size of the search window tracked in the current video frame based on the Camshift algorithm are combined to construct a new search window.

[0092] Based on the above embodiment, optionally, the target object tracking module 330 further includes:

[0093] If it is determined that the similarity metric value between the centroids is less than or equal to the preset metric threshold, the search window tracked based on the Camshift algorithm in the current video frame is continued to be maintained.

[0094] The target tracking device provided in the embodiment of the present invention can execute the target tracking method provided in any embodiment of the present invention mentioned above, and has the corresponding functions and beneficial effects of executing the target tracking method. For technical details not described in detail in the above embodiments, please refer to the target tracking method provided in any embodiment of the present application.

[0095] Figure 4 FIG. 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Figure 4 The electronic device provided in the embodiment of the present invention includes: one or more processors 410 and a storage device 420; the processor 410 in the electronic device can be one or more, Figure 4 A processor 410 is taken as an example; the storage device 420 is used to store one or more programs; the one or more programs are executed by the one or more processors 410, so that the one or more processors 410 implement the target tracking method as described in any one of the embodiments of the present invention.

[0096] The electronic device may further include an input device 430 and an output device 440 .

[0097] The processor 410, storage device 420, input device 430 and output device 440 in the electronic device can be connected via a bus or other means. Figure 4 The bus connection is taken as an example.

[0098] The storage device 420 in the electronic device serves as a computer-readable storage medium and can be used to store one or more programs, which may be software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the target tracking method provided in the embodiments of the present invention. The processor 410 executes the software programs, instructions, and modules stored in the storage device 420 to execute various functional applications and data processing of the electronic device, thereby implementing the target tracking method in the above-mentioned method embodiment.

[0099] The storage device 420 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device, etc. In addition, the storage device 420 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 storage device 420 may further include a memory remotely located relative to the processor 410, 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.

[0100] The input device 430 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the electronic device. The output device 440 may include a display device such as a display screen.

[0101] Furthermore, when one or more programs included in the electronic device are executed by the one or more processors 410, the programs perform the following operations:

[0102] Determine the first centroid position of the target object tracked based on the SURF algorithm in the current video frame;

[0103] Determine the second centroid position of the target object tracked based on the Camshift algorithm in the current video frame;

[0104] By comparing the first center of mass position with the second center of mass position, the search window of the target object tracked based on the Camshift algorithm in the current video frame is adjusted for use when tracking the target object based on the Camshift algorithm in the next video frame.

[0105] Of course, those skilled in the art will understand that when one or more programs included in the above-mentioned electronic device are executed by the one or more processors 410, the programs may also perform relevant operations in the target tracking method provided in any embodiment of the present invention.

[0106] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the program is used to perform a target tracking method. The method includes:

[0107] Determine the first centroid position of the target object tracked based on the SURF algorithm in the current video frame;

[0108] Determine the second centroid position of the target object tracked based on the Camshift algorithm in the current video frame;

[0109] By comparing the first center of mass position with the second center of mass position, the search window of the target object tracked based on the Camshift algorithm in the current video frame is adjusted for use when tracking the target object based on the Camshift algorithm in the next video frame.

[0110] Optionally, when the program is executed by a processor, it can also be used to execute the target tracking method provided in any embodiment of the present invention.

[0111] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination thereof. The computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or device.

[0112] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0113] The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wire, optical cable, radio frequency (RF), etc., or any suitable combination of the foregoing.

[0114] Computer program code for performing the operations of the present invention may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0115] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0116] Note that the above are only preferred embodiments of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described 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 detail through the above embodiments, the present invention is not limited to the above embodiments and may include many other equivalent embodiments without departing from the concept of the present invention. 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: Determine the first centroid position of the target object tracked based on the SURF algorithm in the current video frame; Determine the second centroid position of the target object tracked based on the Camshift algorithm in the current video frame; By comparing the first centroid position with the second centroid position, adjusting a search window of a target object tracked based on the Camshift algorithm in a current video frame, so as to be used when tracking the target object based on the Camshift algorithm in a next video frame; Determining a second center of mass position of a target object tracked based on a Camshift algorithm in a current video frame includes: Determine the minimum bounding rectangle of the target object located and tracked using the SURF algorithm in the current video frame, with the first centroid position as the center; The minimum bounding rectangle of the target object in the current video frame is used as the initial search window of the Camshift algorithm; Determining a new search window obtained by adjusting a search window obtained by tracking a target object in a previous video frame based on a Camshift algorithm; According to the new search window obtained by adjusting the previous video frame, the Camshift algorithm is used to track the target object in the current video frame, and the center of mass position of the search window tracked in the current video frame is used as the second center of mass position.

2. The method according to claim 1, characterized in that Determine the first centroid position of the target object tracked based on the SURF algorithm in the current video frame, including: Determine the pixel position and pixel value of the target object obtained by tracking the target object in the current video frame based on the SURF algorithm; According to the pixel position and pixel value of the target object, the first centroid position of the target object in the current video frame is obtained by a preset centroid position calculation formula based on SURF algorithm tracking.

3. The method according to claim 1, characterized in that Determining the second centroid position of the target object tracked based on the Camshift algorithm in the current video frame also includes: According to the initialization search window of the Camshift algorithm, the Camshift algorithm is used to track the target object in the current video frame, and the centroid position of the search window tracked in the current video frame is used as the second centroid position.

4. The method according to claim 1, wherein Adjusting a search window of a target object tracked based on a Camshift algorithm in a current video frame by comparing the first center of mass position with the second center of mass position includes: determining an inter-centroid similarity measure between the first centroid position and the second centroid position; If it is determined that the similarity measure value between the centroids is greater than the preset measure threshold, the first centroid position tracked in the current video frame based on the SURF algorithm and the window size of the search window tracked in the current video frame based on the Camshift algorithm are combined to construct a new search window.

5. The method according to claim 4, characterized in that By comparing the first centroid position with the second centroid position, a search window of the target object tracked based on the Camshift algorithm in the current video frame is adjusted, further comprising: If it is determined that the similarity metric value between the centroids is less than or equal to the preset metric threshold, the search window tracked based on the Camshift algorithm in the current video frame is continued to be maintained.

6. A target tracking device, characterized in that: The device comprises: A first centroid determination module is used to determine the first centroid position of the target object tracked based on the SURF algorithm in the current video frame; A second centroid determination module is used to determine the second centroid position of the target object tracked based on the Camshift algorithm in the current video frame; a target object tracking module, configured to adjust a search window of a target object tracked based on a Camshift algorithm in a current video frame by comparing the first center of mass position with the second center of mass position, so as to be used when tracking the target object based on the Camshift algorithm in a next video frame; The second center of mass determination module is specifically used to determine the minimum bounding rectangle of the target object located and tracked using the SURF algorithm in the current video frame with the first center of mass position as the center; use the minimum bounding rectangle of the target object in the current video frame as the initialization search window of the Camshift algorithm; determine a new search window obtained by adjusting the search window obtained by tracking the target object in the previous video frame based on the Camshift algorithm; track the target object in the current video frame using the Camshift algorithm according to the new search window obtained by adjusting the previous video frame, and use the center of mass position of the search window tracked in the current video frame as the second center of mass position.

7. The device according to claim 6, characterized in that The target object tracking module includes: determining an inter-centroid similarity measure between the first centroid position and the second centroid position; If it is determined that the similarity measure value between the centroids is greater than the preset measure threshold, the first centroid position tracked in the current video frame based on the SURF algorithm and the window size of the search window tracked in the current video frame based on the Camshift algorithm are combined to construct a new search window.

8. An electronic device, characterized in that: include: 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 the target tracking method according to any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the target tracking method described in any one of claims 1 to 5 is implemented.