A high-altitude projectile detection method based on incremental background modeling and multi-target tracking
By using incremental background modeling and multi-target tracking methods, the problems of anti-interference and small target detection in high-altitude object throwing detection are solved, achieving efficient and accurate detection and tracking results.
Patent Information
- Application Number
- CN202310422631.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-19
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2043-04-19
AI Technical Summary
Existing background modeling methods have poor anti-interference capabilities in high-altitude object throwing detection, making it difficult to handle complex scenes and small target detection. Furthermore, multi-target tracking suffers from confusion and missed detection issues, making it difficult to achieve efficient and accurate detection.
An incremental background modeling method combined with a multi-target tracking method is adopted. The background model is updated by adaptive learning rate and threshold. Target detection and tracking are performed by feature clustering and Kalman filtering to identify high-altitude projectile targets.
It enables rapid and accurate detection and tracking of small targets in complex scenes and under different lighting conditions, improving the real-time performance and robustness of high-altitude object throwing detection.
Smart Images

Figure CN116580055B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to an incremental background modeling method, and more particularly to a method for detecting high-altitude projectiles based on incremental background modeling and multi-target tracking. Background Technology
[0002] Background modeling is a fundamental task in computer vision. Its main purpose is to extract the static background from a video sequence and separate the dynamic elements (foreground) from the background to facilitate subsequent tasks such as object detection, tracking, and segmentation. Existing background modeling methods mainly include the following:
[0003] 1. Frame difference method: This method uses the difference in pixel values between adjacent frames as the basis for distinguishing between background and foreground. When an image...
[0004] When the difference between the pixels exceeds a threshold, the pixel is marked as foreground.
[0005] 2. Adaptive Background Modeling Method: Adaptively adjusts the background model of pixels based on the degree of change in pixel values.
[0006] This allows for background modeling to adapt to scenarios involving changes in lighting and camera movement.
[0007] 3. Background modeling method based on sparse coding: This method separates the background and foreground by representing each pixel as a sparse linear combination.
[0008] 4. Background modeling method based on principal component analysis: This method involves performing principal component analysis on the pixel data in the video sequence.
[0009] The analysis extracts key background information and models the background by reducing the number of principal components.
[0010] However, some of these methods cannot handle dynamic changes within a frame well and are easily affected by noise and lighting changes. When the scene changes drastically or contains a large number of dynamic objects, it is difficult to guarantee the accuracy of the background model. The computational complexity of model parameter selection and weight updates is also high. These shortcomings prevent these methods from being effectively applied to the specific scenario of objects being thrown from heights.
[0011] Existing object detection methods include traditional methods based on handcrafted features and methods based on deep learning:
[0012] 1. Methods based on handcrafted features:
[0013] a) Haar features + Adaboost: This method uses Haar wavelet features for object detection and employs the Adaboost algorithm to train the classifier. However, this method requires manual design of Haar features and cannot adaptively learn target features.
[0014] b) HOG features + SVM: This method uses HOG features to extract the edge information of the target and uses SVM for classification. However, this method is more sensitive to problems such as occlusion and changes in lighting.
[0015] 2. Deep learning-based methods:
[0016] a) R-CNN: This method extracts several candidate boxes through selective search, then performs feature extraction and classification on each candidate box, and finally uses a regression algorithm to fine-tune the target box. However, this method is computationally intensive and slow, and cannot be used for real-time detection.
[0017] b) YOLO (You Only Look Once): This method treats object detection as a regression problem, directly outputting the location and category information of the target box through a convolutional neural network. This method is fast, but because it treats object detection as a regression problem, it performs poorly in detecting small and distant objects.
[0018] c) SSD (Single Shot MultiBox Detector): This method uses multiple convolutional kernels of different sizes to convolve the feature map, predicting multiple target boxes of different sizes and aspect ratios. Then, a non-maximum suppression algorithm is used to filter out the final target boxes. This method is relatively fast and has good detection performance for both small and large targets, but it is prone to missed detections when targets are densely packed.
[0019] Existing methods and systems for high-altitude object throwing have drawbacks such as poor anti-interference ability, difficulty in application in complex scenarios, difficulty in detecting small targets, and difficulty in tracking objects. It is difficult to overcome all these shortcomings to achieve efficient and accurate detection. Summary of the Invention
[0020] To address the above issues, this invention proposes combining an incremental background modeling method to improve background modeling speed while maintaining high accuracy. Furthermore, it applies a multi-target detection method to treat the tracking problem of parabolic objects as a multi-target tracking problem, considering multiple possible targets simultaneously. This further achieves the requirements for complex application scenarios of high-altitude parabolic object detection and rapid detection of small targets.
[0021] The technical solution of this invention is a method for detecting high-altitude projectiles based on incremental background modeling and multi-target tracking, which includes the following steps:
[0022] S1, Initialize the background model;
[0023] S2 uses the background model obtained in S1 to apply the new frame based on the adaptive learning rate, thereby updating the background model and using an adaptive threshold to distinguish between foreground pixels and background pixels.
[0024] S3: Using the foreground pixels obtained in S2, target detection is performed by feature clustering. The features of the foreground pixels are extracted and clustered. For each cluster, its shape features and texture features are calculated, and the results are output as the target detection results.
[0025] S4. Using the detection results obtained in S3, target matching is performed using the Kalman filter method, and the target's state information is updated based on the target position information detected in the current frame and the matching results.
[0026] S5, based on the state information of the target object in multiple consecutive frames, determines whether the target object needs to be merged or split, and outputs the new state information of the target object after the merging or splitting operation.
[0027] S6. Save the motion video of the target object obtained in step S5, estimate the acceleration of the target based on the motion trajectory generated by the detection, confirm the high-altitude object throwing target, and eliminate non-high-altitude object throwing targets.
[0028] Furthermore, in step S2, historical frames are first cleared every 10 seconds, or the first 15 historical frames are cleared when the number of historical frames exceeds 100, and then the background model is updated.
[0029] Furthermore, the specific implementation of step S2 is as follows:
[0030] S201, before reading a new frame, the historical frames are cleared using a method that periodically clears historical frames, and then the new video frame I is read and inserted. t And convert it to a grayscale image G t :
[0031] Igray=0.299·Ir+0.587·Ig+0.114·Ib
[0032] Where I gray G represents the grayscale image after grayscale conversion. t The grayscale value of a pixel, I r I g I b These represent the values of the red, green, and blue channels of the original image pixels, respectively.
[0033] S202, for each pixel (i, j), calculate its relationship with the background model B. i,j Differences:
[0034] D i,j(t)=|G i,j (t)-B i,j (tk)|
[0035] Among them B i,j (t) represents the statistical results of pixel values in several frames before time t, B i,j (t) represents the statistical results of pixel values in several frames before time tk(s), G i,j (t) represents the grayscale image G. t The value of the middle pixel (i, j);
[0036] S203, based on the difference value D calculated in step S202 i,j (t) and an adaptive threshold T determine whether the pixel is a foreground pixel F. i,j (t), if D i,j If (t) > T, then the pixel is considered a foreground pixel;
[0037] S204, based on foreground pixel F i,j (t) and background model B i,j The update strategy for (t-1) updates the background model B. i,j (t), assuming that in the first N frames, pixel (i, j) is identified as a foreground pixel in n frames, then the proportion of foreground pixels is... Define adaptive learning rates α and β such that the foreground pixel ratio p is inversely proportional to the value of α and the background model update rate; and the foreground pixel ratio p is directly proportional to the value of β and the background model update rate.
[0038] Furthermore, the adaptive threshold formula is as follows:
[0039]
[0040] Where T0 is the initial threshold, k is the coefficient, μ(x,y) is the background model standard deviation of pixel (x,y), μ0 is the mean standard deviation, and W(x,y) represents the number of times pixel (x,y) is classified as foreground during the system's runtime.
[0041] Furthermore, the formulas for calculating the adaptive learning rates α and β are defined as follows;
[0042]
[0043]
[0044] Update background model B i,j (t) is:
[0045]
[0046] Where, αmin and α max The learning rate α at time t t The upper and lower limits, β min and β max The learning rate β at time t t The upper and lower limits, where p is the foreground pixel ratio, p min and p max These are the upper and lower limits of p.
[0047] Furthermore, the specific sub-steps of step S3 are as follows;
[0048] S301: Use the SIFT feature extraction algorithm to extract the pixel value, position, and texture features of each foreground pixel;
[0049] S302: Input the features of each foreground pixel into the clustering algorithm, execute the K-Means algorithm, and perform clustering;
[0050] S303: Use the elbow rule to determine the optimal number of clusters and determine the center of each cluster, using the position of the center point to represent the position of the target object corresponding to the cluster;
[0051] S304: Assign the foreground pixel to the cluster closest to it, and filter out invalid clusters after assignment to eliminate noise from non-target objects;
[0052] S305: Output target detection results.
[0053] Furthermore, the specific implementation of step S4 is as follows;
[0054] S401: For each target, initialize a Kalman filter and set the state vector, state transition matrix, observation matrix, process noise, and observation noise;
[0055] S402: For the current frame detection result output in step S3, construct the corresponding observation vector, input it into the Kalman filter for updating, and estimate the current target's state vector;
[0056] S403: Based on the output of step S402, obtain the target's state information and motion model;
[0057] S404: Based on the target's state information and motion model in the current frame, predict the target's position and match it with the detection results in the next frame to determine the target's next state.
[0058] S405: Based on the output of step S404, if the current processing result is synthesized from the M-frame result, then proceed to step S5; otherwise, proceed to step S401 again to receive a new frame.
[0059] Furthermore, in step S5, the calculation process of the target object's state information in multiple consecutive frames is as follows:
[0060] Suppose there are n targets at time t, where the state vector of target i is x. i (t), the measurement vector is z i (t), the state transition matrix of the Kalman filter is F i The measurement matrix is H i The covariance matrix of the state noise is Q. i The covariance matrix of the observation noise is R i Then the state update of target i is represented as:
[0061] Predicted status:
[0062] x i (t|t-1)=F i *x i (t-1|t-1)
[0063] Where t-1 represents the time of the previous frame, t represents the time of the current frame, and | represents the conditional probability; the above formula is used to predict the state of the target in the current frame, where F i Let x be the state transition matrix, representing the target's state change between two frames. In the above formula, x represents the target's state estimate in the previous frame. i (t-1|t-1) is taken as input, and processed by the state transition matrix F i After the action, the target's state prediction x in the current frame is obtained. i (t|t-1);
[0064] Prediction error covariance matrix:
[0065]
[0066] The above formula is used to calculate the uncertainty of the target's state prediction in the current frame, where P i (t|t-1) is the prediction error covariance matrix, representing the uncertainty in estimating the target state. In the above formula, the prediction error covariance matrix P of the target in the previous frame... i (t-1|t-1) is processed by the state transition matrix F i and state noise covariance matrix Q i The prediction error covariance matrix P of the target in the current frame is obtained by updating. i (t|t-1); Representing F i transpose;
[0067] Kalman gain:
[0068]
[0069] Kalman gain K i (t) is used to combine the predicted state and the actual measurement z. i (t) are fused to obtain a more accurate state estimate, which is calculated based on the prediction error covariance matrix P. i (t|t-1), measurement matrix H i and the observation noise covariance matrix R i ;
[0070] Measurement Update:
[0071] x i (t|t)=x i (t|t-1)+K i (t)*(z i (t)-H i *x i (t|t-1)
[0072] In the measurement update formula, K i (t) is the Kalman gain, which measures the uncertainty between the current measurement and the prediction, and is used to adjust the trade-off between the prediction and the measurement; specifically, the Kalman gain K... i (t) represents the prediction error covariance matrix P at the current time. i (t|t-1) and the measurement error covariance matrix The ratio between them, where H_i is the measurement matrix and R_i is the covariance matrix of the observation noise;
[0073] x i (t|t) represents the value of z at the current time t, based on the measured value z. i (t) is the updated state vector, which is equal to the predicted state x. i (t|t-1) plus the current measured value z i The correction obtained by (t), i.e., the Kalman gain K. i (t) is multiplied by the error between the measured and predicted values;
[0074] Update the error covariance matrix:
[0075] P i (t|t)=(IK i (t)*H i )*P i (t|t-1)
[0076] (IK i (t)*H i P is a matrix used to represent the update of the error covariance matrix of the state estimate after measurement correction; specifically, Pi (t|t) represents the value of z at the current time t, based on the measured value z. i (t) is the error covariance matrix after state update, which is equal to the prediction error covariance matrix P. i (t|t-1) minus the contribution of the correction obtained from the current measurement, i.e., the Kalman gain K. i (t) multiplied by the measurement matrix H i With the prediction error covariance matrix P i The product of (t|t-1).
[0077] Furthermore, the specific sub-steps of step S5 are as follows;
[0078] S501: Take the target matching results output after the analysis of M frames in step S4, and use the matching matrix to represent the matching situation of each target in adjacent frames;
[0079] S502: Based on the matching matrix in step S501, if a target has more than M matches in adjacent frames, it is merged into one target. Similarly, if a target in adjacent frames corresponds to multiple matching targets and the number of matches exceeds N, it is split into multiple targets.
[0080] S503: Save the status information of the results output in step S502.
[0081] Furthermore, the method for determining whether a target is an object thrown from a height is as follows;
[0082] Taking a target p0 as an example, based on its trajectory, let a certain segment of the trajectory s be taken. Let the time corresponding to the target being at the starting point of s be t0, and the time corresponding to the ending point be t1, with the difference between the two being t. Assuming the vertical motion of the parabola is uniformly accelerated linear motion, and u is the initial velocity of the target at time t0, then according to the formula:
[0083]
[0084] The acceleration 'a' of the target is calculated as follows:
[0085]
[0086] If the acceleration of the target is equal to the local gravitational acceleration g within the allowable error range, then the trajectory is considered to conform to the trajectory of a high-altitude projectile, and the target is a high-altitude projectile.
[0087] This technical solution has the following innovations compared to current mainstream high-altitude object throwing monitoring solutions:
[0088] 1. For incremental background modeling, traditional background modeling methods may suffer from background model drift when processing long videos, meaning the background model cannot adapt to changes in background pixels caused by factors such as lighting changes, camera movement, or scene changes. Incremental background modeling methods, on the other hand, can dynamically update the background model. By introducing a learning rate and adaptive threshold, they can better adapt to changes in the actual scene.
[0089] 2. For multi-target tracking, traditional tracking methods may encounter problems such as target confusion or missed detection when handling multiple targets, especially when the target is occluded or far from the camera. Multi-target tracking methods, however, can utilize advanced technologies such as deep learning to more accurately detect and track targets. Furthermore, when dealing with situations such as target splitting, merging, and occlusion, they can more accurately identify and process target state information, thereby improving the accuracy and efficiency of multi-target tracking.
[0090] 3. This invention provides a multi-target tracking method for tracking parabolic objects, effectively meeting the three key requirements of immediacy, accuracy, and robustness in the actual detection of objects thrown from heights. The method achieves real-time detection and tracking of parabolic objects by incrementally modeling the background and performing multi-target tracking, exhibiting high accuracy and robustness under varying lighting conditions and complex backgrounds. This invention has significant application and promotional value in the field of computer vision. Attached Figure Description
[0091] Figure 1 This is a flowchart of a high-altitude projectile detection method based on incremental background modeling and multi-target tracking, provided for embodiments of the present invention. Detailed Implementation
[0092] To make the objectives, technical solutions, and advantages of this invention clearer, the key steps of this invention will be further described in detail below with reference to actual calculation methods. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0093] The above are merely preferred embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0094] See Figure 1 The present invention provides a method for detecting high-altitude projectiles based on incremental background modeling and multi-target tracking, comprising the following steps:
[0095] S1: Initialize the background model. The surveillance video is segmented into frames. Based on the static extraction characteristics of background modeling, the first 10 seconds of the surveillance video are selected as the background frames. The images obtained from these frames are converted from RGB space to grayscale space to represent lighting and texture information. For each pixel, its grayscale value in the background frame is used to initialize its background model.
[0096] S2: Using the background model obtained in S1, update the background model and improve algorithm performance by periodically clearing historical frames. Adaptive learning rate is used to update the background model for new frames. Adaptive thresholding is used to distinguish foreground and background pixels.
[0097] Before reading a new frame, historical frames are cleared every 10 seconds, or the first 15 historical frames are cleared when the number of historical frames exceeds 100. Then, the new video frame I is read and inserted. t And convert it to a grayscale image G t :
[0098] Igray=0.299·Ir+0.587·Ig+0.114·Ib
[0099] Where I gray G represents the grayscale image after grayscale conversion. t The grayscale value of a pixel, I r I g I b These represent the values of the red, green, and blue channels of the original image pixels, respectively. The above values are preferred values according to the embodiments of the present invention; those skilled in the art may use other values instead.
[0100] For each pixel (i, j), calculate its relationship with the background model B. i,j Differences:
[0101] D i,j (t)=|G i,j (t)-B i,j (t-10)|.
[0102] Among them B i,j (t) represents the statistical results of pixel values in several frames before time t, B i,j (t) represents the statistical results of pixel values in several frames before time t-10(s), G i,j (t) represents the grayscale image G. t The value of the middle pixel (i, j).
[0103] Based on the calculated difference value D i,j (t) and an adaptive threshold T determine whether the pixel is a foreground pixel F.i,j (t)(For example, if D) i,j (t) > T, then the pixel is considered a foreground pixel.
[0104] The adaptive threshold formula is:
[0105]
[0106] Where T0 is the initial threshold, k is the coefficient, μ(x, y) is the standard deviation of the background model for pixel (x, y), μ0 is the mean standard deviation, and W(x, y) represents the number of times pixel (x, y) is classified as foreground during the system's runtime. When W(x, y) = 0, it means that pixel (x, y) is always classified as background, and the threshold is set to the initial value T0. When the pixel value changes little, i.e., μ(x, y) is small, the threshold is small, and more foreground pixels can be detected. Conversely, the threshold is large, and some falsely detected foreground pixels can be filtered out.
[0107] According to the foreground pixel F i,j (t) and background model B i,j The update strategy for (t-10) updates the background model B. i,j (t), assuming that in the first N frames, pixel (i, j) is identified as a foreground pixel in n frames, then the proportion of foreground pixels is... Define adaptive learning rates α and β such that the foreground pixel ratio p is inversely proportional to the value of α and the background model update rate; and the foreground pixel ratio p is directly proportional to the value of β and the background model update rate.
[0108] The updated formula is as follows:
[0109]
[0110]
[0111]
[0112] Where, α min and α max It is α t The upper and lower bounds of the learning rate at time t, β min and β max It is β t The upper and lower bounds of the learning rate at time t. p is the foreground pixel ratio, p min and p max These are the upper and lower limits of p.
[0113] S3: Using the foreground pixels obtained in S2, target detection is performed using a feature clustering method. The features of the foreground pixels are extracted and clustered, and the target detection results are output.
[0114] The specific sub-steps of step S3 are as follows;
[0115] S301: Use the SIFT feature extraction algorithm to extract the pixel value, position, and texture features of each foreground pixel;
[0116] S302: Input the features of each foreground pixel into the clustering algorithm, execute the K-Means algorithm, and perform clustering;
[0117] S303: Use the elbow rule to determine the optimal number of clusters and determine the center of each cluster, using the position of the center point to represent the position of the target object corresponding to the cluster;
[0118] S304: Assign the foreground pixel to the cluster closest to it, and filter out invalid clusters after assignment to eliminate noise from non-target objects;
[0119] S305: Output target detection results.
[0120] S4: Using the target detection results obtained in S3, the Kalman filter method is used for target matching, and the target's state information is updated based on the target position information detected in the current frame and the matching results.
[0121] The specific sub-steps of step S4 are as follows;
[0122] S401: For each target, initialize a Kalman filter and set the state vector, state transition matrix, observation matrix, process noise, and observation noise;
[0123] S402: For the current frame detection result output in step S3, construct the corresponding observation vector, input it into the Kalman filter for updating, and estimate the current target's state vector;
[0124] S403: Based on the output of step S402, obtain the target's state information and motion model;
[0125] S404: Based on the target's state information and motion model in the current frame, predict the target's position and match it with the detection results in the next frame to determine the target's next state.
[0126] S405: Based on the output of step S404, if the current processing result is synthesized from the M-frame result, then proceed to step S5; otherwise, proceed to step S401 again to receive a new frame.
[0127] S5: Based on the state information of the target object in multiple consecutive frames, determine whether the target object needs to be merged or split, and output the new state information of the target object after the merging or splitting operation.
[0128] Suppose there are n targets at time t, where the state vector of target i is x. i (t), the measurement vector is z i (t), the state transition matrix of the Kalman filter is F i The measurement matrix is H i The covariance matrix of the state noise is Q. i The covariance matrix of the observation noise is R i Then the state update of target i is represented as:
[0129] Predicted status:
[0130] x i (t|t-1)=F i *x i (t-1|t-1)
[0131] Where t-1 represents the time of the previous frame, t represents the time of the current frame, and | represents the conditional probability; the above formula is used to predict the state of the target in the current frame, where F i Let x be the state transition matrix, representing the target's state change between two frames. In the above formula, x represents the target's state estimate in the previous frame. i (t-1|t-1) is taken as input, and processed by the state transition matrix F i After the action, the target's state prediction x in the current frame is obtained. i (t|t-1);
[0132] Prediction error covariance matrix:
[0133]
[0134] The above formula is used to calculate the uncertainty of the target's state prediction in the current frame, where P i (t|t-1) is the prediction error covariance matrix, representing the uncertainty in estimating the target state. In the above formula, the prediction error covariance matrix P of the target in the previous frame... i (t-1|t-1) is processed by the state transition matrix F i and state noise covariance matrix Q i The prediction error covariance matrix P of the target in the current frame is obtained by updating. i (t|t-1); Representing F i transpose;
[0135] Kalman gain:
[0136]
[0137] Kalman gain K i (t) is used to combine the predicted state and the actual measurement z.i (t) are fused to obtain a more accurate state estimate, which is calculated based on the prediction error covariance matrix P. i (t|t-1), measurement matrix H i and the observation noise covariance matrix R i ;
[0138] Measurement Update:
[0139] x i (t|t)=x i (t|t-1)+K i (t)*(z i (t)-H i *x i (t|t-1)
[0140] In the measurement update formula, K i (t) is the Kalman gain, which measures the uncertainty between the current measurement and the prediction, and is used to adjust the trade-off between the prediction and the measurement; specifically, the Kalman gain K... i (t) represents the prediction error covariance matrix P at the current time. i (t|t-1) and the measurement error covariance matrix The ratio between them, where H_i is the measurement matrix and R_i is the covariance matrix of the observation noise;
[0141] x i (t|t) represents the value of z at the current time t, based on the measured value z. i (t) is the updated state vector, which is equal to the predicted state x. i (t|t-1) plus the current measured value z i The correction obtained by (t), i.e., the Kalman gain K. i (t) is multiplied by the error between the measured and predicted values;
[0142] Update the error covariance matrix:
[0143] P i (t|t)=(IK i (t)*H i )*P i (t|t-1)
[0144] (IK i (t)*H i P is a matrix used to represent the update of the error covariance matrix of the state estimate after measurement correction; specifically, P i (t|t) represents the value of z at the current time t, based on the measured value z. i(t) is the error covariance matrix after state update, which is equal to the prediction error covariance matrix P. i (t|t-1) minus the contribution of the correction obtained from the current measurement, i.e., the Kalman gain K. i (t) multiplied by the measurement matrix H i With the prediction error covariance matrix P i The product of (t|t-1).
[0145] For target merging and splitting operations, it is necessary to merge or split the state vectors and measurement vectors of multiple targets, and then update the state of the new target. Specifically, the state vectors and measurement vectors of multiple targets can be weighted and averaged to obtain new state vectors and measurement vectors, and then the Kalman filter algorithm is used for state update. Assume targets i and j need to be merged, and the new state vector is x. k The measurement vector is z k The weights during the merging process are w i and w j Then the merged state vector and measurement vector can be expressed as:
[0146] State vector:
[0147] x k =w i *x i +w j *x j
[0148] Measurement vector:
[0149] z k =w i *z i +w j *z j
[0150] The weights can be calculated based on the number of matches of the target in adjacent frames. For the target splitting operation, the original state vector and measurement vector can be split into multiple sub-vectors, and then the Kalman filter algorithm can be used to update the state of each sub-vector separately.
[0151] S6: Save the motion video of the target object obtained in step S5, estimate the acceleration of the target based on the motion trajectory generated by detection, confirm the high-altitude projectile target, and eliminate non-high-altitude projectile targets. The judgment method is as follows:
[0152] Taking a target p0 as an example, based on its trajectory, let a certain segment of the trajectory s be taken. Let the time corresponding to the target being at the starting point of s be t0, and the time corresponding to the ending point be t1, with the difference between the two being t. Assuming the vertical motion of the parabola is uniformly accelerated linear motion, and u is the initial velocity of the target at time t0, then according to the formula:
[0153]
[0154] The acceleration 'a' of the target is calculated as follows:
[0155]
[0156] If the acceleration of the target is equal to the local gravitational acceleration g within the allowable error range, then the trajectory is considered to conform to the trajectory of a high-altitude projectile, and the target is a high-altitude projectile.
[0157] The above are merely preferred embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for detecting high-altitude projectiles based on incremental background modeling and multi-target tracking, characterized in that, The method includes the following steps: S1, Initialize the background model; S2 uses the background model obtained in S1 to apply the new frame based on the adaptive learning rate, thereby updating the background model and using an adaptive threshold to distinguish between foreground pixels and background pixels. The specific implementation method of step S2 is as follows: S201: Before reading a new frame, historical frames are cleared periodically using a method that periodically clears historical frames. Then, the new video frame is read and inserted. and convert it to a grayscale image. : in Represents the grayscale image after grayscale conversion The grayscale value of a pixel, , , These represent the values of the red, green, and blue channels of the original image pixels, respectively. S202, for each pixel Calculate its relationship with the background model Differences: in This represents the statistical results of pixel values in several frames prior to time t. This represents the statistical results of pixel values in several frames prior to time tk(s). Represents a grayscale image medium pixel The value; S203, based on the difference value calculated in step S202 and adaptive threshold This determines whether a pixel is a foreground pixel. ,if If so, then the pixel is considered a foreground pixel; S204, based on foreground pixels and background model Update strategy, update background model Assuming in the first In a frame, pixels exist If a pixel in a frame is identified as a foreground pixel, then the proportion of foreground pixels is... Define adaptive learning rate and This makes the foreground pixel ratio and The value of the background model is inversely proportional to the update speed of the background model; this makes the foreground pixel ratio... and The value is directly proportional to the update speed of the background model; S3, using the foreground pixels obtained in S2, performs target detection using feature clustering to extract the foreground pixels. The features of scene pixels are analyzed and clustered. For each cluster, its shape and texture features are calculated. And output the results as object detection results; S4, using the detection results obtained in S3, performs target matching using the Kalman filter method, and based on... The target's location information and matching results detected in the current frame are used to update the target's state information; S5, based on the state information of the target object in multiple consecutive frames, determines whether the target object needs to be combined. Merge or split, and output the state information of the new target object after the merge or split operation; The specific sub-steps of step S5 are as follows; S501, Take the target matching result output after the analysis of M frames in step S4, and use the matching matrix to represent the matching situation of each target in adjacent frames; S502, based on the matching matrix in step S501, if a target has more than M matches in adjacent frames, it is merged into one target. Similarly, if a target in adjacent frames corresponds to multiple matching targets and the number of matches exceeds N, it is split into multiple targets. S503, For the results output in step S502, save their status information; S6, save the motion video of the target object obtained in step S5 based on the detected state information. The trajectory of the object is determined, its acceleration is estimated, and high-altitude objects are identified, while non-high-altitude objects are eliminated.
2. The method for detecting high-altitude projectiles based on incremental background modeling and multi-target tracking as described in claim 1, characterized in that: In step S2, historical frames are first cleared every K1 seconds, or the number of historical frames exceeds K2 frames, and then the previous K3 frames are cleared before the historical frames are updated.
3. The method for detecting high-altitude projectiles based on incremental background modeling and multi-target tracking as described in claim 1, characterized in that: The adaptive threshold formula is: in, It is the initial threshold. It is a coefficient. It is a pixel Background model standard deviation, It is the mean standard deviation. Represents pixels The number of times this pixel is classified as foreground during system runtime.
4. The method for detecting high-altitude projectiles based on incremental background modeling and multi-target tracking as described in claim 1, characterized in that: Define adaptive learning rate and The calculation formula is as follows; Update background model for: in, and The learning rate at time t The upper and lower limits, and The learning rate at time t The upper and lower limits, where p is the proportion of foreground pixels. and These are the upper and lower limits of p.
5. The method for detecting high-altitude projectiles based on incremental background modeling and multi-target tracking as described in claim 1, characterized in that: The specific sub-steps of step S3 are as follows; S301 uses the SIFT feature extraction algorithm to extract the pixel value, position, and texture features of each foreground pixel; S302, input the features of each foreground pixel into the clustering algorithm, execute the K-Means algorithm, and perform clustering; S303, use the elbow rule to determine the optimal number of clusters and determine the center of each cluster, using the position of the center point to represent the position of the target object corresponding to the cluster; S304 assigns the foreground pixel to the cluster closest to it, and filters invalid clusters after assignment to eliminate noise from non-target objects; S305: Output target detection results.
6. The method for detecting high-altitude projectiles based on incremental background modeling and multi-target tracking as described in claim 1, characterized in that: The specific implementation method of step S4 is as follows; S401, for each target, initialize a Kalman filter, set the state vector, state transition matrix, observation matrix, process noise and observation noise; S402, For the current frame detection result output in step S3, construct the corresponding observation vector, input it into the Kalman filter for updating, and estimate the current target's state vector; S403, based on the output of step S402, obtain the target's state information and motion model; S404: Based on the target's state information and motion model in the current frame, predict the target's position and match it with the detection results in the next frame to determine the target's next state; S405, based on the output of step S404, if the current processing result is synthesized from the M-frame result, then proceed to step S5; otherwise, proceed to step S401 again to receive a new frame.
7. The method for detecting high-altitude projectiles based on incremental background modeling and multi-target tracking as described in claim 1, characterized in that: In step S5, the calculation process of the target object's state information in multiple consecutive frames is as follows: Assuming in Always One goal, among which the goal The state vector is The measurement vector is The state transition matrix of the Kalman filter is The measurement matrix is The covariance matrix of the state noise is The covariance matrix of the observation noise is Then the target The state update is represented as: Predicted status: in, Indicates the time of the previous frame. Indicates the time of the current frame. The above formula represents the conditional probability; it is used to predict the target's state in the current frame, where... Let be the state transition matrix, representing the target's state changes between two frames. In the above formula, the target's state estimate in the previous frame is... As input, it passes through the state transition matrix After the action, the target's state prediction in the current frame is obtained. ; Prediction error covariance matrix: The above formula is used to calculate the uncertainty of the target's state prediction in the current frame, where The prediction error covariance matrix represents the uncertainty in estimating the target state. In the formula above, the prediction error covariance matrix of the target in the previous frame is... Through the state transition matrix and state noise covariance matrix The prediction error covariance matrix of the target in the current frame is obtained by updating the data. ; represent transpose; Kalman gain: Kalman gain Used to compare predicted state with actual measurement The fusion process yields a more accurate state estimate, calculated based on the prediction error covariance matrix. Measurement matrix and observation noise covariance matrix ; Measurement Update: In the measurement update formula, It is the Kalman gain, which measures the uncertainty between the current measurement and the predicted value, and is used to adjust the trade-off between the predicted and measured values; specifically, the Kalman gain... Represents the prediction error covariance matrix at the current time. With measurement error covariance matrix The ratio between them, of which It is a measurement matrix. It is the covariance matrix of the observation noise; Indicates the current moment According to the measured value The updated state vector is equal to the predicted state. Add based on current measurement values The obtained correction amount, i.e., Kalman gain Multiply by the error between the measured and predicted values; Update the error covariance matrix: It is a matrix used to represent the update of the error covariance matrix of the state estimate after measurement correction; specifically, Indicates the current moment According to the measured value The error covariance matrix after state update is equal to the prediction error covariance matrix. Subtract the contribution of the correction obtained from the current measurement, i.e., the Kalman gain. Multiply by the measurement matrix With the prediction error covariance matrix The product of.
8. The method for detecting high-altitude projectiles based on incremental background modeling and multi-target tracking as described in claim 1, characterized in that: The methods for determining whether a target is an object thrown from a height are as follows; With a certain goal For example, based on its motion trajectory, a certain segment of the motion trajectory is selected. Assume the target is located at The time corresponding to the starting point is The time corresponding to the finish line is The difference between the two is Assuming the vertical motion of the parabola is uniformly accelerated linear motion, and u is the velocity of the target in the vertical direction... The initial velocity at time t is determined by the formula: The acceleration 'a' of the target is calculated as follows: If the target's acceleration is equal to the local gravitational acceleration If the trajectories are equal within the allowable error range, then the trajectory is considered to conform to the trajectory of a high-altitude projectile, and the target is a high-altitude projectile.
Citation Information
Patent Citations
High-altitude parabolic detection method and device, and computer readable storage medium
CN111382692A
Long-time multi-target prawn tracking method based on boundary constraint Kalman filtering
CN111724405A