Target tracking method based on improved CamShift algorithm
By improving the CamShift algorithm, optimizing the trajectory prediction window using Lagrange interpolation and Kalman filtering, and dynamically adjusting the search window, the problem of insufficient robustness and accuracy of the traditional CamShift algorithm in complex environments is solved, achieving more efficient target tracking.
Patent Information
- Application Number
- CN202510898818.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-01
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-07-01
AI Technical Summary
Traditional CamShift target tracking algorithm is not robust and accurate enough in the face of target occlusion, motion deformation, background interference, etc., and has a large computational load, making it difficult to meet real-time requirements. In particular, it performs poorly in target tracking in complex dynamic environments.
The trajectory prediction window is generated using Lagrange interpolation, and then corrected using Kalman filtering. The search window is dynamically adjusted by an improved continuous adaptive mean drift algorithm to optimize target detection and recognition.
It improves the robustness and accuracy of target tracking, enhances the target acquisition probability in complex dynamic environments, solves the problem of re-identification after rapid movement and occlusion, and improves the stability and real-time performance of tracking.
Smart Images

Figure CN120807581A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of visual target tracking, in particular to a target tracking method based on an improved CamShift algorithm. BACKGROUND
[0002] In recent years, the field of artificial intelligence has been developing, and visual target tracking technology has gradually become one of the research hotspots in this field. Target tracking technology has gradually penetrated from the previous military application field to various civilian fields, and plays an increasingly important role in car unmanned driving, automated production line, unmanned vehicle navigation, intelligent monitoring, medical image diagnosis and other aspects, and promotes the development of human society.
[0003] The problems that need to be solved by a real-time target tracking system usually include:
[0004] (1) Robustness. Robustness refers to the ability of the system to resist external interference. When the tracked target is partially occluded, deformed, disturbed by the background, etc., the target appearance information will change, resulting in failure of the target positioning of the image tracking system.
[0005] (2) Accuracy. Accuracy refers to the difference between the current position of the target tracked by the target tracking algorithm and the real position of the target, which is usually expressed as a percentage, directly evaluating the performance of the algorithm.
[0006] (3) Real-time performance. Real-time performance represents the running speed of the target tracking algorithm. In actual applications, the real-time processing capability of the system is required to be very high, which determines whether the system is practical. The main factors affecting real-time performance are algorithm performance and platform performance. The operation time of the same algorithm on different implementation platforms is quite different, and different algorithms on the same platform will also be different due to the difference in algorithm complexity. In actual applications, a suitable algorithm and platform should be selected.
[0007] Traditional visual target tracking systems usually use processors based on the von Neumann architecture to process images, that is, image data obtained from a camera is transmitted to a computer for image processing, and finally the tracking of the target is completed. The advantages of this method are low algorithm implementation threshold and high efficiency, but the disadvantages are high system power consumption, high hardware cost, poor real-time performance and lack of portability, which makes it difficult to meet the requirements of specific application scenarios with high real-time requirements. Both the central processing unit (CPU) and the graphics processing unit (GPU) belong to processors based on the von Neumann architecture. CPU instructions need to be decoded and executed in series, requiring various branch jump commands and complex control logic, and consuming a lot of time for data reading, which greatly limits the processing speed. Compared with CPU, GPU has a simple internal structure and more operation units, and can process massive data in parallel, but the high price and high power consumption limit its wide application.
[0008] In addition, the traditional visual target tracking system usually tracks the target through a CamShift target tracking algorithm, and the traditional CamShift target tracking algorithm has the following deficiencies:
[0009] (1) The CamShift target tracking algorithm uses the second moment of an image to adjust the length and width size of a search window, and has a large demand for operation amount.
[0010] (2) The observation model of the CamShift tracking algorithm is determined by an initial target region and does not change with the apparent change of the target, and when a large change occurs, the tracking effect is poor.
[0011] (3) When the target is fast, the target leaves the search range, and the CamShift algorithm is difficult to search effectively, resulting in loss of the target.
[0012] (4) When the target is similar to the background tone and texture, the CamShift tracking algorithm will expand the search window, increase the operation amount, and reduce the tracking effect.
[0013] In view of the problems in the related art, no effective solution has been proposed so far. SUMMARY
[0014] In view of the problems in the related art, the present application proposes a target tracking method based on an improved CamShift algorithm to overcome the above technical problems existing in the prior art.
[0015] To this end, the specific technical solutions adopted by the present application are as follows:
[0016] A target tracking method based on an improved CamShift algorithm, the method comprising the following steps:
[0017] S1, acquiring image data and pre-processing the image data to obtain pre-processed image data, using a target detection algorithm to detect the target in the pre-processed image data, and obtaining a tracking target;
[0018] S2, tracing the historical trajectory of the tracking target, and generating a trajectory prediction window using the Lagrange interpolation method according to the traced historical trajectory, and correcting the trajectory prediction window using the Kalman filter algorithm to obtain a corrected trajectory prediction window;
[0019] S3, improving the continuous adaptive mean shift algorithm through a search window dynamic adjustment strategy to obtain an improved continuous adaptive mean shift algorithm, and tracking the tracking target based on the corrected trajectory prediction window using the improved continuous adaptive mean shift algorithm to obtain a tracking result.
[0020] Further, in order to realize the tracking target detection, the detection of the tracking target can be realized under the detection of the target detection algorithm, the image data is acquired and preprocessed, the preprocessed image data is obtained, the target detection algorithm is used for target detection on the preprocessed image data, and the tracking target includes:
[0021] S11, acquire image data, and perform scaling and normalization processing on the image data to obtain preprocessed image data;
[0022] S12, train the target detection algorithm based on the pre-acquired image data to obtain a target detection model;
[0023] S13, use the target detection model to perform target detection on the preprocessed image data to obtain a tracking target.
[0024] Further, in order to effectively solve the problem of re-identification of the tracking target after rapid motion, mutation and occlusion, the capture probability of the tracking target in a complex dynamic environment can be improved under the action of the trajectory prediction window generated by the Lagrange interpolation method, the historical trajectory of the tracking target is traced, and the trajectory prediction window is generated based on the traced historical trajectory by using the Lagrange interpolation method, and the trajectory prediction window is corrected by using the Kalman filtering algorithm to obtain a corrected trajectory prediction window, including:
[0025] S21, trace the historical trajectory of the tracking target, and construct a one-dimensional interpolation polynomial based on the traced historical trajectory by using the Lagrange interpolation method;
[0026] S22, predict the trajectory position by using the one-dimensional interpolation polynomial, and generate a trajectory prediction window based on the trajectory position prediction result;
[0027] S23, correct the trajectory prediction window by using the Kalman filtering algorithm combined with the tracking target to obtain a corrected trajectory prediction window.
[0028] Further, in order to realize trajectory prediction, the predicted position can be acquired to realize trajectory prediction under the construction of the one-dimensional interpolation polynomial, the historical trajectory of the tracking target is traced, and the one-dimensional interpolation polynomial is constructed based on the traced historical trajectory by using the Lagrange interpolation method, including:
[0029] S211, trace the historical trajectory of the tracking target, acquire a center coordinate set of the target trajectory based on the traced historical trajectory;
[0030] S212, set a timestamp based on the center coordinate set, and divide the center coordinate set into a horizontal coordinate set and a vertical coordinate set;
[0031] S213, a one-dimensional interpolation polynomial is constructed for the horizontal coordinate set and the vertical coordinate set by using the Lagrange interpolation method combined with the timestamp setting result, to obtain a Lagrange interpolation polynomial of the horizontal coordinate and a Lagrange interpolation polynomial of the vertical coordinate.
[0032] Further, in order to improve the accuracy of the prediction window, the capture probability of the prediction window for the tracking target can be enhanced under the correction of the Kalman filtering algorithm, the trajectory prediction window is corrected by the Kalman filtering algorithm, to obtain a corrected trajectory prediction window, including:
[0033] S231, a position is predicted based on the Kalman filtering algorithm combined with the tracking target, to obtain a predicted position, and a prior error covariance matrix of the predicted position is calculated;
[0034] S232, the trajectory prediction window is taken as an actual observation value, a residual between the actual observation value and the predicted position is calculated, and a Kalman gain is calculated by using the prior error covariance matrix combined with a preset observation noise, and an update weight of each point in the prediction window is generated according to the Kalman gain;
[0035] S233, each trajectory point of the prediction window is adjusted by the update weight of each point combined with the residual, to obtain the corrected trajectory prediction window.
[0036] Further, in order to solve the problem occurring during target tracking, the continuous adaptive mean shift algorithm can be improved under the adjustment of the search window optimization adjustment strategy, and then the identification problem occurring during target tracking is solved, the continuous adaptive mean shift algorithm is improved by the search window dynamic adjustment strategy, to obtain an improved continuous adaptive mean shift algorithm, and the tracking target is tracked based on the corrected trajectory prediction window by using the improved continuous adaptive mean shift algorithm, to obtain a tracking result, including:
[0037] S31, a search window adaptive adjustment strategy is generated by using an adaptive coefficient, and a problem is divided based on a preset tracking problem, and a search window optimization adjustment strategy is generated by the problem division result;
[0038] S32, the search window adaptive adjustment strategy and the search window optimization adjustment strategy are integrated, to obtain a search window dynamic adjustment strategy;
[0039] S33, the continuous adaptive mean shift algorithm is improved based on the search window dynamic adjustment strategy, to obtain an improved continuous adaptive mean shift algorithm, and the tracking target is tracked based on the corrected trajectory prediction window by using the improved continuous adaptive mean shift algorithm, to obtain a tracking result.
[0040] Further, in order to determine the search window optimization adjustment strategy, the adaptive coefficient can be used to generate the search window adaptive adjustment strategy under the action of problem division of the preset tracking problem, and the search window optimization adjustment strategy can be generated through the problem division result based on the preset tracking problem.
[0041] S311, calculate the size ratio of the tracking target, and use the adaptive coefficient to generate a search window dynamic update algorithm in combination with the size ratio and the zeroth moment, and generate a search window adaptive adjustment strategy based on the search window dynamic update algorithm;
[0042] S312, problem division based on the preset tracking problem, and generate a problem determination threshold through the problem division result;
[0043] S313, generate a search window optimization adjustment strategy according to the problem determination threshold combined with the preset optimization adjustment rule.
[0044] Further, in order to improve the identification accuracy of the tracking problem, the identification accuracy of the fast movement, mutation and occlusion of the tracking target can be improved under the generation of the determination threshold, and the problem division result includes: tracking target fast movement problem, tracking target search window occlusion problem and tracking target search window background recognition problem.
[0045] Generating a problem determination threshold includes:
[0046] According to the moving distance between adjacent image frames of the tracking target, a determination threshold of the tracking target fast movement problem is generated;
[0047] The ratio of the area of the initial frame window of the tracking target to the search window is taken as the occlusion coefficient, and according to the size of the occlusion coefficient, the determination threshold of the tracking target search window occlusion problem and the determination threshold of the tracking target search window background recognition problem are generated.
[0048] Further, in order to avoid tracking problems, the capture probability of the tracking target in a complex dynamic environment can be improved under the adjustment of the preset optimization adjustment rule, and the preset optimization adjustment rule includes:
[0049] When it is determined that the tracking target is fast moving, the next frame image search window of the tracking target is enlarged according to the preset expansion value;
[0050] When it is determined that the tracking target search window is occluded, the center of mass coordinates obtained by the continuous adaptive mean shift algorithm are taken as the center of gravity coordinates of the search window, and the size of the initial tracking target search window is taken as the size of the search window for iterative calculation;
[0051] When it is determined that the tracking target search window background recognition problem is tracked, the trajectory prediction window is used to construct a search window, and the color probability graph is combined with the continuous adaptive mean shift algorithm to locate the tracking target.
[0052] Further, in order to realize trajectory tracking, the improved continuous adaptive mean shift algorithm can be used to obtain the tracking target component, accurate positioning can be realized, the stability and robustness of tracking under the condition of target rapid motion or occlusion are improved, the continuous adaptive mean shift algorithm is improved based on the search window dynamic adjustment strategy, the improved continuous adaptive mean shift algorithm is obtained, and the tracking target is tracked by using the improved continuous adaptive mean shift algorithm according to the corrected trajectory prediction window, and the tracking result includes:
[0053] S331, the continuous adaptive mean shift algorithm is improved based on the search window dynamic adjustment strategy, and the improved continuous adaptive mean shift algorithm is obtained;
[0054] S331, the search window size is initialized by using the improved continuous adaptive mean shift algorithm, the initial search window is obtained, the tracking target component is extracted according to the initial search window combined with the corrected trajectory prediction window, and the color probability distribution graph of the tracking target component is calculated;
[0055] S331, the centroid coordinates are output through the color probability distribution graph, and trajectory tracking is performed according to the centroid coordinates, and the tracking result is obtained.
[0056] The beneficial effects of the present application are:
[0057] 1, the present application constructs a one-dimensional interpolation polynomial by using the Lagrange interpolation method, which can predict the position of the tracking target at the next time; the Lagrange interpolation method has stronger nonlinear fitting ability, which is suitable for the scene where the tracking target has acceleration, curve and other non-uniform motion trend, and can effectively improve the tracking performance of the continuous adaptive mean shift algorithm for high-speed or nonlinear target.
[0058] 2, the present application improves the continuous adaptive mean shift algorithm, which can realize the tracking robustness in complex background and motion uncertainty scene, so as to improve the target capture probability in complex dynamic environment; effectively solve the problems such as re-identification after tracking target rapid motion, mutation and occlusion, and enhance the stability and robustness of tracking. BRIEF DESCRIPTION OF DRAWINGS
[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0060] Figure 1 is a target tracking method based on improved CamShift algorithm according to an embodiment of the present application;
[0061] Figure 2 is a system overall framework diagram in a target tracking method based on improved CamShift algorithm according to an embodiment of the present application;
[0062] Figure 3 is a Lagrange interpolation and CamShift tracking fusion algorithm flowchart in a target tracking method based on improved CamShift algorithm according to an embodiment of the present application. DETAILED DESCRIPTION
[0063] To further explain the embodiments, the present application provides drawings which are part of the disclosure of the present application, mainly used to illustrate the embodiments, and can explain the operating principle of the embodiments in conjunction with the related description of the specification. Those skilled in the art should understand other possible implementations and advantages of the present application by referring to these contents.
[0064] According to an embodiment of the present application, a target tracking method based on improved CamShift algorithm is provided.
[0065] The present application will be further described in conjunction with the drawings and specific embodiments, as shown, a target tracking method based on improved CamShift algorithm according to an embodiment of the present application, the method comprises the following steps: Figure 1
[0066] S1, obtaining image data, and pre-processing the image data to obtain pre-processed image data, using a target detection algorithm to detect the pre-processed image data to obtain a tracking target.
[0067] Specifically, obtaining image data, and pre-processing the image data to obtain pre-processed image data, using a target detection algorithm to detect the pre-processed image data to obtain a tracking target comprises:
[0068] S11, obtaining image data, and scaling and normalizing the image data to obtain pre-processed image data;
[0069] S12, training a target detection algorithm based on pre-acquired image data to obtain a target detection model;
[0070] S13, using the target detection model to detect the pre-processed image data to obtain a tracking target; capable of realizing detection and recognition of the tracking target under the detection of the target detection algorithm.
[0071] S2, historical trajectory tracking is performed on the tracking target, and a trajectory prediction window is generated by using Lagrange interpolation method according to the tracked historical trajectory, and the trajectory prediction window is corrected by using Kalman filtering algorithm to obtain a corrected trajectory prediction window.
[0072] Specifically, the historical trajectory tracking is performed on the tracking target, and the trajectory prediction window is generated by using Lagrange interpolation method according to the tracked historical trajectory, and the trajectory prediction window is corrected by using Kalman filtering algorithm to obtain a corrected trajectory prediction window, which comprises:
[0073] S21, historical trajectory tracking is performed on the tracking target, and a one-dimensional interpolation polynomial is constructed by using Lagrange interpolation method according to the tracked historical trajectory.
[0074] Specifically, the historical trajectory tracking is performed on the tracking target, and a one-dimensional interpolation polynomial is constructed by using Lagrange interpolation method according to the tracked historical trajectory, which comprises:
[0075] S211, historical trajectory tracking is performed on the tracking target, and a center coordinate set of the target trajectory is obtained based on the tracked historical trajectory;
[0076] S212, time stamp setting is performed according to the center coordinate set, and the center coordinate set is divided into a horizontal coordinate set and a vertical coordinate set to obtain the horizontal coordinate set and the vertical coordinate set;
[0077] S213, a one-dimensional interpolation polynomial is constructed for the horizontal coordinate set and the vertical coordinate set by using Lagrange interpolation method combined with the time stamp setting result, to obtain a Lagrange interpolation polynomial of the horizontal coordinate and a Lagrange interpolation polynomial of the vertical coordinate; the predicted position can be obtained under the construction of the one-dimensional interpolation polynomial to realize trajectory prediction.
[0078] S22, trajectory position prediction is performed by using the one-dimensional interpolation polynomial, and a trajectory prediction window is generated based on the trajectory position prediction result.
[0079] S23, the trajectory prediction window is corrected by using Kalman filtering algorithm combined with the tracking target to obtain a corrected trajectory prediction window; under the action of the trajectory prediction window generated by using Lagrange interpolation method, the capture probability of the tracking target in a complex dynamic environment can be improved.
[0080] Specifically, the trajectory prediction window is corrected by using Kalman filtering algorithm to obtain a corrected trajectory prediction window, which comprises:
[0081] S231, position prediction is performed based on Kalman filtering algorithm combined with the tracking target to obtain a predicted position, and a prior error covariance matrix of the predicted position is calculated;
[0082] S232: Using the trajectory prediction window as the actual observation value, calculating the residual between the actual observation value and the predicted position, and using the prior error covariance matrix combined with the preset observation noise to calculate the Kalman gain, and generating the update weight for each point in the prediction window based on the Kalman gain;
[0083] S233. Adjust each trajectory point of the prediction window by combining the updated weight of each point with the residual to obtain a corrected trajectory prediction window; and enhance the capture probability of the prediction window for the tracked target under the correction effect of the Kalman filter algorithm.
[0084] Specifically, the Kalman filter algorithm uses the current state and the estimated value of the previous state to update the current state estimate. The present invention uses the Kalman filter algorithm to predict target motion and establishes a mathematical model based on the application of the target tracking system.
[0085] The system state equation is as follows:
[0086] X n =AX n-1 +BU n-1 +W n ;
[0087] This formula shows that the state at time n is derived from the state at time n-1, where X n is the system state at time n, U n-1 is the control quantity at time n-1; A and B are transfer matrices set based on empirical control coefficients; W n is the process noise of the system, which is obtained from the Gaussian distribution N(0,Qn). The measurement equation gives the system observation value Z n :
[0088] Z n =HX n - +V n ;
[0089] Among them, Z n is the measured value of the target at time n, V n is the error caused by observation, V n Satisfies Gaussian distribution N(0,R n ), H is the system measurement parameter matrix, which transforms the state vector X n Convert to observation value Z n , which is determined based on factors such as the physical characteristics of the system and the configuration of the sensor.
[0090] Rewrite the Kalman filter algorithm state prediction equation:
[0091]
[0092] Error covariance equation:
[0093]
[0094] where X n-1 is the state correction value at time n-1, P n-1 is the error correction value, the result is the predicted value of the state at time n-1, is the error prediction value. Q n-1 is the process noise covariance matrix, which is a symmetric matrix, representing the uncertainty of the process noise, reflecting the influence of the model error or noise on the state estimation in the state prediction process from time n-1 to time n. The greater the value of Q n-1 , the greater the uncertainty of the process noise, the less reliable the state prediction; on the contrary, if Q n-1 is small, it means that the prediction accuracy of the state is high, and the system state changes are relatively stable. In practical applications, the process noise covariance matrix needs to be adjusted through experiments.
[0095] K Kalman gain equation at time K n :
[0096]
[0097] where K n determines the weighting proportion between the predicted state and the actual observation value in each filtering update. If the predicted value is more reliable (small prediction error), the Kalman gain will be smaller, and the filter will rely more on the predicted value. If the observation value is more reliable (small measurement error), the Kalman gain will be larger, and the filter will rely more on the observation value to adjust the state estimation. R is the measurement noise covariance matrix, which describes the uncertainty of the observation result due to the error of the sensor or external noise in each observation process, that is:
[0098] v k ~ N(0, R);
[0099] That is, the measurement noise is a Gaussian distribution with mean zero and variance R.
[0100] State correction equation:
[0101]
[0102] Covariance:
[0103]
[0104] The complete iteration process of Kalman filter can be summarized as: time update process and state update process.
[0105] The time update process includes computing the predicted state and computing the predicted covariance.
[0106] Compute the predicted state: X k = AX k-1 + BU k-1 + Q k-1 .
[0107] Compute the predicted covariance:
[0108] The state update process includes the Kalman gain, the state correction, and the error correction.
[0109] The Kalman gain:
[0110] The state correction:
[0111] The error correction:
[0112] The Kalman initialization step: define the state vector, which contains the position and velocity information of the target.
[0113] Initializing the Kalman filter includes state estimation and initial covariance matrix; the state estimation is to initialize the state vector X0 of the Kalman filter according to the target detection result. The initial covariance matrix is the initialized state covariance matrix P0, which represents the uncertainty of the initial state.
[0114]
[0115] wherein, and represent the uncertainty of the position, and represent the uncertainty of the velocity.
[0116] Setting the process noise and measurement noise covariance includes the process noise covariance matrix, the measurement noise covariance matrix, and the state transition matrix. The process noise covariance matrix Q represents the error when the model is predicted, which is usually set based on the dynamic model of the system (such as the motion model of the object) and can be estimated through experiments or prior knowledge; the measurement noise covariance matrix R represents the inaccuracy of the sensor measurement value, which can be estimated through the error model of the sensor; the state transition matrix F describes the state change from the last time to the current time, and the state transition matrix can be derived based on the velocity of the target and the time step. The calculation formula of the state transition matrix is:
[0117]
[0118] wherein, v is the target velocity vector, and Δt is the time interval.
[0119] S3, improve the continuous adaptive mean shift algorithm by the search window dynamic adjustment strategy, obtain an improved continuous adaptive mean shift algorithm, and track the tracking target based on the corrected trajectory prediction window using the improved continuous adaptive mean shift algorithm to obtain a tracking result.
[0120] Specifically, the continuous adaptive mean shift algorithm is improved by the search window dynamic adjustment strategy to obtain an improved continuous adaptive mean shift algorithm, and the tracking target is tracked based on the corrected trajectory prediction window using the improved continuous adaptive mean shift algorithm to obtain a tracking result, which includes:
[0121] S31, generate a search window adaptive adjustment strategy using an adaptive coefficient, and perform problem division based on a preset tracking problem to generate a search window optimization adjustment strategy through the problem division result.
[0122] Specifically, the search window adaptive adjustment strategy is generated using an adaptive coefficient, and problem division is performed based on a preset tracking problem to generate a search window optimization adjustment strategy through the problem division result, which includes:
[0123] S311, calculate the size ratio of the tracking target, and generate a search window dynamic update algorithm using an adaptive coefficient in combination with the size ratio and the zeroth moment, and generate a search window adaptive adjustment strategy based on the search window dynamic update algorithm;
[0124] S312, perform problem division based on a preset tracking problem, and generate a problem determination threshold through the problem division result;
[0125] S313, generate a search window optimization adjustment strategy according to the problem determination threshold in combination with a preset optimization adjustment rule; the search window optimization adjustment strategy can help subsequent problem identification and adjustment under the action of problem division on the preset tracking problem.
[0126] S32, integrate the search window adaptive adjustment strategy and the search window optimization adjustment strategy to obtain a search window dynamic adjustment strategy.
[0127] Specifically, the problem division result includes: a tracking target fast movement problem, a tracking target search window occlusion problem, and a tracking target search window background recognition problem.
[0128] The problem determination threshold is generated, which includes:
[0129] According to the movement distance between adjacent image frames of the tracking target, a determination threshold of the tracking target fast movement problem is generated.
[0130] The ratio of the initial frame window of the tracking target to the area of the search window is taken as an occlusion coefficient, and according to the size of the occlusion coefficient, a determination threshold of the occlusion problem of the search window of the tracking target and a determination threshold of the background recognition problem of the search window of the tracking target are generated; under the generation of the determination threshold, the identification accuracy of the fast movement, mutation and occlusion of the tracking target can be improved.
[0131] Specifically, the preset optimization adjustment rule includes:
[0132] When it is determined that the tracking target is fast moving, the search window of the next frame image of the tracking target is enlarged by a preset expansion value;
[0133] When it is determined that the tracking target is the occlusion problem of the search window, the center of mass coordinates obtained by the continuous adaptive mean shift algorithm are taken as the center of gravity coordinates of the search window, and the size of the initial search window of the tracking target is taken as the size of the search window for iterative calculation;
[0134] When it is determined that the tracking target is the background recognition problem of the search window, the search window is constructed by using the trajectory prediction window, and the tracking target is positioned by combining the color probability graph and the continuous adaptive mean shift algorithm; under the adjustment of the preset optimization adjustment rule, the capture probability of the tracking target in a complex dynamic environment can be improved.
[0135] Specifically, four improvements are made to the deficiencies of the traditional CamShift tracking algorithm (i.e. the continuous adaptive mean shift algorithm).
[0136] The first aspect (search window adaptive adjustment strategy) is to use an adaptive coefficient. The zeroth moment and the second moment in the mathematical model of the CamShift target tracking algorithm require a large amount of computation, so a simplified search window updating algorithm is introduced, and W and L are defined:
[0137]
[0138] L = 1.5 * W;
[0139] Wherein, W represents the width of the search window of the next frame image; L represents the length of the search window of the image; M 00 is a moment, which represents the zeroth moment of the image, that is, the total quality of the image, that is, the sum of the gray values of all pixels in the image. The zeroth moment calculation formula is:
[0140]
[0141] In the formula, the length-width ratio of the adaptive search window is 1.5:1, the fixed length-width ratio cannot adapt to the different changes of the target appearance in different scenes, and the length-width ratio coefficient needs to be improved; considering the balance between reducing the operation amount of the CamShift algorithm and the influence of the fixed length-width ratio on the tracking effect, the size of the search window is dynamically adjusted according to the size ratio of the target in the initial frame.
[0142] Suppose that the length of the initial frame tracking window of the target (i.e. the tracking target) is L i , the width is W i , and the ratio μ thereof is:
[0143]
[0144] Suppose that the adaptive change coefficient of the search window size is ε, then the updated width W n and length L n of the search window are respectively:
[0145]
[0146] Let the size of the search window be constant, then the product of the updated width and length is constant:
[0147]
[0148] The adaptive change coefficient ε can be calculated as:
[0149]
[0150] The updated width and length of the search window are:
[0151]
[0152] The width W and length L of the search window are adjusted according to the length-width ratio μ of the target window in the initial frame, so that the adaptive change of the tracking window (i.e. the search window) is realized and the complexity of the algorithm is reduced.
[0153] The second aspect (i.e. the problem of fast movement of the tracking target) improves the problem of fast movement of the target. The fast movement of the target in the video image will cause the distance between the target positions in adjacent image frames to be far apart, and the search window is difficult to capture the target position in time, and the tracking fails. To this end, the application proposes a search window expansion strategy. When it is determined that the tracking target moves fast, the algorithm needs to expand the search window. Suppose that the positions of the target in the i-1th frame and the i-th frame image are (x i-1 , y i-1 ) and (x i , y i ) respectively, and the movement distance of the target between the two frames is:
[0154]
[0155] where x i-1 represents the horizontal coordinate of the i-1th frame; y i-1 represents the vertical coordinate of the i-1th frame; x i represents the horizontal coordinate of the ith frame; y i represents the vertical coordinate of the ith frame; L(i) represents the moving distance of the target between two frames; a threshold value D is set, and when L(i) > D, the target is moving fast. After the size and position information of the search window of the next frame is obtained by the CamShift algorithm, it is determined whether the target is moving fast, and if so, the size of the search window of the next frame is enlarged by 5*D pixel units in length and width, and if not, the search is performed according to the original size. Through comparison of simulation results, when D is set to 20 pixels, the tracking accuracy and speed of the CamShift algorithm can be balanced.
[0156] The third aspect (i.e., the problem of the occlusion of the search window of the tracked target) improves the problem of the occlusion of the search window of the target. When a large area of the target is occluded during the target tracking process using the CamShift tracking algorithm, only a small part of the target is present in the search window, which will cause the zeroth moment of the target image in the search window to be small, and the CamShift tracking algorithm will reduce the size of the search window through adaptive adjustment. When the tracked target appears in the field of view again, the part that was previously occluded does not exist in the search window, resulting in tracking failure. Through the occlusion judgment strategy, because the image frames before and after differ by a very short time, and the target motion is generally considered to be continuous, when the target is occluded by a large area, the target should be near the search window, and enlarging the range of the search window can include the tracked target in the search window. The initial frame image of the target contains comprehensive feature images, has good discrimination, and does not have problems such as occlusion and deformation. The initial frame window Init_Window of the tracked target is selected as the reference window, the search window Search_Window obtained by the CamShift tracking algorithm is selected as the comparison window, and the area ratio K of the two is selected as the occlusion coefficient:
[0157]
[0158] where S Search_Window represents the area of the search window of the current frame, S Init_Window represents the area of the initial tracking target window. Through simulation calculation, the threshold value of K is obtained, and when K < 0.3, it indicates that the tracked target is occluded by a large area. The centroid coordinates obtained by the CamShift tracking algorithm are taken as the center of gravity coordinates of the search window, the length and width dimensions of the initial target tracking window Init_Window are taken as the dimensions of the search window, and iterative calculation is performed.
[0159] The fourth aspect (i.e., the tracking target search window background identification problem) optimizes the background approximation problem; when the color texture of the background in the target motion environment is similar to the tracking target, the zeroth moment of the image search frame will be large, resulting in that the tracking window obtained by the adaptive adjustment mode of the algorithm is large, and the tracking effect is affected.
[0160] In view of this problem, the target prediction and tracking method based on Lagrange interpolation is used, the Lagrange interpolation model is constructed by using the historical centroid coordinates of the target to predict the position of the target in the next frame, a search window is constructed with the predicted position as the center, the color probability graph and the CamShift algorithm are combined to realize accurate positioning, and the stability and robustness of the tracking algorithm under the condition of severe target motion or occlusion are improved.
[0161] S33, based on the search window dynamic adjustment strategy, the continuous adaptive mean shift algorithm is improved to obtain an improved continuous adaptive mean shift algorithm, and the tracking target is tracked by using the improved continuous adaptive mean shift algorithm according to the corrected trajectory prediction window to obtain a tracking result; the continuous adaptive mean shift algorithm can be improved under the adjustment of the search window optimization adjustment strategy, and then the identification problem in target tracking can be solved.
[0162] Specifically, based on the search window dynamic adjustment strategy, the continuous adaptive mean shift algorithm is improved to obtain an improved continuous adaptive mean shift algorithm, and the tracking target is tracked by using the improved continuous adaptive mean shift algorithm according to the corrected trajectory prediction window to obtain a tracking result, including:
[0163] S331, based on the search window dynamic adjustment strategy, the continuous adaptive mean shift algorithm is improved to obtain an improved continuous adaptive mean shift algorithm;
[0164] S331, the search window size is initialized by using the improved continuous adaptive mean shift algorithm to obtain an initial search window, and the tracking target component is extracted according to the initial search window combined with the corrected trajectory prediction window, and the color probability distribution graph of the tracking target component is calculated;
[0165] S331, the centroid coordinates are output through the color probability distribution graph, and the trajectory tracking is performed according to the centroid coordinates to obtain a tracking result; accurate positioning can be realized under the action of the improved continuous adaptive mean shift algorithm to obtain the tracking target component, and the stability and robustness of tracking under the condition of severe target motion or occlusion are improved.
[0166] Specifically, the RGB image is converted into an HSV image, and the search window size is initialized, which is preparation for the improved CamShift tracking algorithm.
[0167] RGB image can be converted to HSV image by the following method:
[0168] Normalize the RGB values to the range [0, 1]:
[0169]
[0170] where R is the value of the red color channel; G is the value of the green color channel; B is the value of the blue color channel; R' is the normalized value of the red color channel; G' is the normalized value of the green color channel; B' is the normalized value of the blue color channel.
[0171] Calculate the maximum and minimum values:
[0172] C max = max(R', G', B');
[0173] C min = min(R', G', B');
[0174] where C max is the maximum value, representing the lightness of the color, and C min is the minimum value, representing the depth of the color.
[0175] Calculate the hue H (i.e., the target component), if C max = R', i.e., red is the dominant color:
[0176]
[0177] if C max = G', i.e., green is the dominant color:
[0178]
[0179] if C max = B', i.e., blue is the dominant color:
[0180]
[0181] The calculated H may be negative, and needs to be added to 360° to make it within the range [0°, 360°]:
[0182] H + = (H + 360°) mod 360°.
[0183] where H + represents the normalized hue.
[0184] Calculate the saturation S:
[0185]
[0186] Calculate the lightness V: V = C max .
[0187] Then the steps of the CamShift tracking algorithm are performed, the color probability distribution map of the target H component is calculated, and the calculation method is as follows: the target region is extracted, the H component of the target region is extracted, and the histogram of the H component of the target region is calculated; the histogram of the H component of the target region is drawn on the vertical axis, the horizontal axis [0, 179] is drawn, and the horizontal axis is divided into 180 boxes, and each H is put into the corresponding box according to the size of its value.
[0188] The normalized histogram, that is, the centroid of the search window is calculated, and the specific method is as follows:
[0189] 1. The image is binarized, that is, the pixel value of is set to white, and the pixel value of is set to black.
[0190] 2. Take all black points and record them as I(x,y)=1, take all white points and record them as I(x,y)=0.
[0191] The horizontal coordinate of the centroid is:
[0192] The vertical coordinate of the centroid is:
[0193] Move the search window to the position of the centroid, and then iterate to convergence, and the convergence condition is as follows:
[0194] 1. Record the coordinates of the previous centroid as C prev =(x prev ,y prev ), and the current centroid coordinates are C=(x,y).
[0195] 2. Set the Euclidean distance between C prev and C as d.
[0196] Wherein, the calculation formula of the Euclidean distance is:
[0197]
[0198] 3. If , then d converges to d'. Specific embodiments:
[0200] In actual application, for example, the FPGA platform of MZ7XA7020 is adopted, the Zynq7020 SoC chip is carried, and the OV7725 CMOS camera is used.
[0201] The camera obtains image video information from the outside and transmits the information into a video input and output logic module, and transmits the information to a tracking algorithm and storage controller module through a bus.
[0202] In the tracking algorithm module, target detection and trajectory prediction are first performed to determine a tracking target and a starting coordinate of CamShift.
[0203] The target detection step includes data preprocessing, selection of YOLO as a target detection model, training of the target detection model, and target detection. The data preprocessing includes image scaling, i.e., adjusting the input image to the size required by the neural network; and normalization processing of image pixels, so that the data is distributed in the range of [-1, 1].
[0204] The trajectory prediction step includes Lagrange interpolation, window construction, back projection, and density tracking of CamShift on a probability graph. In the Lagrange interpolation, n frames of a continuously tracked target have center coordinates (x1, y1), (x2, y2), …, (x n ,y n ). Assuming that the time stamps are t1, t2, t3, …, t n , the corresponding horizontal coordinates are x1, x2, x3, …, x n , and the corresponding vertical coordinates are y1, y2, y3, …, y n , the Lagrange interpolation polynomial of the horizontal coordinates is:
[0205]
[0206] The vertical coordinate position is:
[0207]
[0208] The calculation formula of the Lagrange basis function l i (t) is:
[0209]
[0210] The window construction is a rectangular window constructed with the predicted position (L x (t), L y (t)) as the center:
[0211]
[0212] In the formula, W and h are the sizes of the window of the previous frame.
[0213] The back projection is to perform statistics on the hue value H(x, y) of the pixels in the target region window n+1 .
[0214]
[0215] The histogram can be normalized:
[0216]
[0217] This forms a color probability distribution model, and we can consider the color feature of the target as a discrete distribution P H .
[0218] Then traverse each pixel point (x, y) in the image, take its hue value H(x, y), and get its probability value:
[0219]
[0220] CamShift does density tracking on the probability map, that is, use the CamShift algorithm to calculate the image centroid position on this B(x, y) map:
[0221]
[0222] Where h H (i) represents the histogram value of the target area in the H channel, the i-th bin (total N bins); δ(·) is the indicator function, which takes 1 when the bracket is true, and 0 otherwise; p H is a discrete distribution of the target color feature; B(x, y) is the back projection map, and each pixel value represents the probability [0, 1] of similar color to the target color.
[0223] After the tracking algorithm module is processed, the real-time image information and tracking information are sent to the external VGA image display through the video input and output logic module to display the real-time tracking results.
[0224] As shown in Figure 3 , the flow of the tracking algorithm is as follows: start target detection, then calculate the centroid of the search window, move the search window to the centroid position, output the centroid coordinates, judge whether the number of coordinates is less than n, if so, return to target detection, re-output the centroid coordinates, if not, perform trajectory prediction, get the HSV image, and initialize the search window, then calculate the color probability distribution map of the target H component, output the centroid coordinates, perform trajectory prediction again, get the next frame of image, then set the size and position of the search window, and return to calculate the centroid of the search window, and perform an iterative loop.
[0225] Specifically, the rapid development of integrated circuits makes the method of using hardware processors to process images recognized. Because hardware processors have the characteristics of fast processing speed, parallel computing, high integration, etc., it will be the development trend of future visual target tracking processors. The common hardware processors on the market are integrated image processing chips, field programmable logic gate arrays (FPGA) and digital signal processors (DSP). Among them, although the integrated image processing chip is professional, the cost is high, and the versatility and portability are poor, and the DSP processor has powerful operation speed and can complete complex tracking algorithm, but the underlying structure leads to poor reconfigurability and is difficult to design widely. In comparison, FPGA has the advantages of reconfigurability, parallel processing, small size, low power consumption and pipeline operation, is suitable for hardware platform to realize image processing algorithm, and improves the algorithm performance, and FPGA also has good compatibility, adapts to various working scenes, so that the system has the characteristics of low cost, low energy consumption, high flexibility, small size and good compatibility, etc., therefore, the present application provides a Kalman filtering visual tracking method and system based on FPGA.
[0226] In order to further improve the robustness of the CamShift algorithm in the scene of complex background and motion uncertainty, the present application is based on the dynamic region prediction mechanism of multiple frames of historical trajectory, and the current frame is used as the basis, the motion path of several frames of target is traced back, the motion direction and speed change trend are calculated, a prediction window is formed, and the prediction center is corrected through a weighted average filtering algorithm. The window is used as an auxiliary search area in the subsequent frame image, and the initial search window position of CamShift is constrained by the Kalman prediction result, so that the capture probability of the target in the complex dynamic environment is improved. This strategy effectively solves the problems of target fast motion, mutation, occlusion and re-identification, and enhances the stability and robustness of the system.
[0227] The present application is used for real-time monitoring of targets, and provides services for various practical applications such as workshop production lines, unmanned aerial vehicle systems, traffic monitoring systems and automatic driving cars, and solves the problems of high system power consumption, high hardware cost and poor real-time performance caused by the traditional visual tracking system relying on the von Neumann processor.
[0228] Wherein the application is to fuse the Kalman filter algorithm and the improved CamShift tracking algorithm fusion target tracking algorithm as the core. In the target tracking process, the interval time between the front and rear adjacent image frames is very short, and the movement of the tracked target during this period can be regarded as uniform motion, which meets the application assumption of Kalman filter algorithm. Considering the characteristics of Kalman filter algorithm and CamShift tracking algorithm, in order to improve the performance of the tracking algorithm, the application adopts a target tracking algorithm fusing Kalman filter algorithm and improved CamShift tracking algorithm, which is referred to as fusion algorithm. The algorithm first uses the CamShift target tracking algorithm to obtain the current frame target position information, then the position information is fed back to the Kalman filter algorithm to predict the possible position of the target in the next frame image, and the position is fed back to the CamShift tracking algorithm as the starting position of the search window in the next frame image.
[0229] In the fusion algorithm tracking system, the output value of the CamShift target tracking algorithm module is the position information of the target observation, including the horizontal coordinate and the column coordinate, and the measurement value Z of the Kalman filter algorithm k Is in the form of a matrix, which needs to be calculated by matrix inversion, which will consume a lot of computing resources on the FPGA hardware platform, so it needs to be optimized. Two identical Kalman filters are used, one for predicting the horizontal coordinate of the target position, and the other for predicting the vertical coordinate. The combination of the two reduces the difficulty of implementing the prediction algorithm on the FPGA platform, while also ensuring the calculation accuracy.
[0230] As shown in Figure 2 The overall framework diagram of the system includes external circuit design including image sensor, image display and DDR3 memory; internal logic design including FPGA, tracking algorithm module, video input and output logic module, internal bus and storage controller module.
[0231] Firstly, the external image sensor such as camera collects image information from the outside and transmits it to the internal video input and output logic module buffer. Then, the video input and output logic module enters the storage controller module and the tracking algorithm module through the internal bus, generally AXI and AHB bus. The storage controller module caches the image information and the color probability distribution map to the external DDR3 memory. Then, the tracking algorithm module calls the AXIDMAIP core to read the image frame information and the color probability distribution map of the DDR3 memory through the storage controller module, and carries the data to the Kalman filter module and the improved CamShift target tracking algorithm module for processing. Finally, after the tracking algorithm module is processed, the real-time image information and the final tracking result will be transmitted to the external VGA graphic display through the video input and output logic module again to display the real-time image and the tracking result.
[0232] In summary, the application can be based on the dynamic area prediction mechanism of multi-frame target historical trajectory. In the application, the standard Kalman filter algorithm is not directly used, but a Lagrange interpolation method based on multi-frame target historical trajectory is introduced. Taking the current frame as the reference, the position coordinates of the previous several frames (such as 3 frames) are traced back, and the position of the target at the next time is predicted by constructing a one-dimensional interpolation polynomial. The interpolation model has stronger nonlinear fitting capability, is suitable for scenes where the target has acceleration, curve and other non-uniform motion trends, can effectively improve the tracking performance of the CamShift algorithm for high-speed or nonlinear targets, simplifies the state modeling and covariance calculation process, has the advantages of small calculation amount and strong real-time performance, and is suitable for resource-limited platforms.
[0233] In summary, by means of the above technical solutions of the application, the one-dimensional interpolation polynomial is constructed by the Lagrange interpolation method, so that the position of the tracking target at the next time can be predicted. The Lagrange interpolation method has stronger nonlinear fitting capability, is suitable for scenes where the tracking target has acceleration, curve and other non-uniform motion trends, and can effectively improve the tracking performance of the continuous adaptive mean shift algorithm for high-speed or nonlinear targets. The application improves the tracking robustness in complex background and motion uncertainty scenes by improving the continuous adaptive mean shift algorithm, thereby improving the target capture probability in a complex dynamic environment. The problems of re-identification after rapid motion, mutation and occlusion of the tracking target are effectively solved, and the stability and robustness of tracking are enhanced.
[0234] The above only describes the preferred embodiments of the application and is not intended to limit the application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the application shall be included in the protection scope of the application.
Claims
1. A target tracking method based on an improved CamShift algorithm, characterized in that: The method comprises the following steps: S1. Acquire image data, preprocess the image data to obtain preprocessed image data, and use a target detection algorithm to perform target detection on the preprocessed image data to obtain a tracking target; S2. Tracing the historical trajectory of the tracked target, generating a trajectory prediction window based on the traced historical trajectory using the Lagrange interpolation method, and correcting the trajectory prediction window using the Kalman filter algorithm to obtain a corrected trajectory prediction window; S3. The continuous adaptive mean shift algorithm is improved by dynamically adjusting the search window to obtain an improved continuous adaptive mean shift algorithm. The improved continuous adaptive mean shift algorithm is used to track the target based on the corrected trajectory prediction window to obtain a tracking result.
2. The target tracking method based on the improved CamShift algorithm according to claim 1, characterized in that: The acquiring of image data, preprocessing the image data to obtain preprocessed image data, and performing target detection on the preprocessed image data using a target detection algorithm to obtain a tracking target include: S11, acquiring image data, and performing scaling and normalization processing on the image data to obtain pre-processed image data; S12. Training the target detection algorithm based on the pre-acquired image data to obtain a target detection model; S13. Use the target detection model to perform target detection on the preprocessed image data to obtain the tracking target.
3. The target tracking method based on the improved CamShift algorithm according to claim 1, characterized in that: The historical trajectory of the tracked target is traced, and a trajectory prediction window is generated using the Lagrange interpolation method according to the traced historical trajectory. The trajectory prediction window is corrected using the Kalman filter algorithm to obtain the corrected trajectory prediction window, which includes: S21, tracing back the historical trajectory of the tracked target, and constructing a one-dimensional interpolation polynomial using the Lagrange interpolation method according to the traced historical trajectory; S22, using a one-dimensional interpolation polynomial to perform trajectory position prediction, and generating a trajectory prediction window based on the trajectory position prediction result; S23. Correcting the trajectory prediction window by combining the tracking target with the Kalman filter algorithm to obtain a corrected trajectory prediction window.
4. The target tracking method based on the improved CamShift algorithm according to claim 3, characterized in that: Tracing the historical trajectory of the tracked target and constructing a one-dimensional interpolation polynomial using the Lagrange interpolation method according to the traced historical trajectory includes: S211, tracing back the historical trajectory of the tracked target, and obtaining a center coordinate set of the target trajectory based on the traced historical trajectory; S212, setting a timestamp according to the central coordinate set, and dividing the central coordinate set into horizontal and vertical coordinate sets to obtain a horizontal coordinate set and a vertical coordinate set; S213 , constructing a one-dimensional interpolation polynomial for the abscissa set and the ordinate set using the Lagrange interpolation method in combination with the timestamp setting result, to obtain a Lagrange interpolation polynomial for the abscissa and a Lagrange interpolation polynomial for the ordinate.
5. The target tracking method based on the improved CamShift algorithm according to claim 3, characterized in that: The trajectory prediction window is corrected by the Kalman filter algorithm to obtain the corrected trajectory prediction window, which includes: S231. Perform position prediction based on the Kalman filter algorithm in combination with the tracked target to obtain a predicted position, and calculate a priori error covariance matrix of the predicted position; S232: Using the trajectory prediction window as the actual observation value, calculating the residual between the actual observation value and the predicted position, and using the prior error covariance matrix combined with the preset observation noise to calculate the Kalman gain, and generating the update weight for each point in the prediction window based on the Kalman gain; S233 , adjusting each trajectory point in the prediction window by combining the updated weight of each point with the residual to obtain a modified trajectory prediction window.
6. The target tracking method based on the improved CamShift algorithm according to claim 1, characterized in that: The continuous adaptive mean shift algorithm is improved by the dynamic adjustment strategy of the search window to obtain an improved continuous adaptive mean shift algorithm, and the improved continuous adaptive mean shift algorithm is used to track the tracking target based on the modified trajectory prediction window, and the tracking results obtained include: S31, using the adaptive coefficient to generate a search window adaptive adjustment strategy, and dividing the problem based on the preset tracking problem, and generating a search window optimization adjustment strategy based on the problem division result; S32, integrating the search window adaptive adjustment strategy and the search window optimization adjustment strategy to obtain a search window dynamic adjustment strategy; S33. Based on the search window dynamic adjustment strategy, the continuous adaptive mean shift algorithm is improved to obtain an improved continuous adaptive mean shift algorithm, and the improved continuous adaptive mean shift algorithm is used to track the tracking target according to the corrected trajectory prediction window to obtain a tracking result.
7. The target tracking method based on the improved CamShift algorithm according to claim 6, characterized in that: The method of generating a search window adaptive adjustment strategy by using an adaptive coefficient, dividing a problem based on a preset tracking problem, and generating a search window optimization adjustment strategy by using the problem division result includes: S311, calculating the size ratio of the tracked target, and generating a search window dynamic update algorithm using an adaptive coefficient combined with the size ratio and the zero-order moment, and generating a search window adaptive adjustment strategy based on the search window dynamic update algorithm; S312: Divide the problem based on the preset tracking problem, and generate a problem determination threshold based on the problem division result; S313: Generate a search window optimization adjustment strategy based on the problem determination threshold and preset optimization adjustment rules.
8. The target tracking method based on the improved CamShift algorithm according to claim 7, characterized in that: The problem division results include: tracking target fast movement problem, tracking target search window occlusion problem and tracking target search window background recognition problem; The generation problem determination threshold includes: According to the moving distance between adjacent image frames of the tracked target, a judgment threshold for the fast movement of the tracked target is generated; The area ratio of the tracking target initial frame window to the search window is used as the occlusion coefficient. According to the size of the occlusion coefficient, the judgment threshold of the tracking target search window occlusion problem and the judgment threshold of the tracking target search window background recognition problem are generated.
9. The target tracking method based on the improved CamShift algorithm according to claim 8, characterized in that: The preset optimization adjustment rules include: When it is determined that the tracking target is moving quickly, the search window of the next frame image of the tracking target is expanded according to the preset expansion value; When it is determined that the tracking target search window is blocked, the centroid coordinates obtained by the continuous adaptive mean shift algorithm are used as the centroid coordinates of the search window, and the size of the initial tracking target search window is used as the size of the search window for iterative calculation; When it is determined to be a background recognition problem of the tracking target search window, the trajectory prediction window is used to construct the search window, and the tracking target is located by combining the color probability map with the continuous adaptive mean shift algorithm.
10. The target tracking method based on the improved CamShift algorithm according to claim 6, characterized in that: The continuous adaptive mean shift algorithm is improved based on the dynamic adjustment strategy of the search window to obtain an improved continuous adaptive mean shift algorithm, and the improved continuous adaptive mean shift algorithm is used to track the tracking target according to the modified trajectory prediction window, and the tracking results obtained include: S331. Improving the continuous adaptive mean shift algorithm based on a search window dynamic adjustment strategy to obtain an improved continuous adaptive mean shift algorithm; S331. Initialize the search window size using an improved continuous adaptive mean shift algorithm to obtain an initial search window, extract the tracking target component based on the initial search window combined with the modified trajectory prediction window, and calculate a color probability distribution map of the tracking target component; S331. Output the center of mass coordinates through the color probability distribution map, and perform trajectory tracking based on the center of mass coordinates to obtain a tracking result.
Citation Information
Patent Citations
Line-of-sight shielding scene target position prediction method for vulnerable road users
CN117901853A
Automatic order supplementing method for abnormal parking order based on Lagrange interpolation
CN118968812A
Method and apparatus for tracking an object using a continuously adapting mean shift
US20020012449A1