Motion target detection method and device based on global graph structure, and storage medium
By using a global graph-based moving target detection method, which constructs a global graph structure through superpixel segmentation and similar nodes, the problem of anti-interference in target detection in satellite video is solved, and the detection accuracy is improved.
Patent Information
- Application Number
- CN202510605181.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-12
- Publication Date
- 2026-11-20
AI Technical Summary
Existing satellite video moving vehicle detection methods have weak anti-interference capabilities when faced with factors such as small target size, complex scenes, background movement, and camera shake. Furthermore, they lack sufficient inter-frame motion pattern perception and target spatial context information mining, resulting in insufficient detection accuracy.
A motion target detection method based on a global graph structure is adopted. The global graph structure is constructed by superpixel segmentation and similar nodes, the difference change map is calculated, and the spatial context information of superpixels is used in combination with inter-frame abnormal change judgment and refinement to improve the detection accuracy.
It enhances the ability to resist interference from environmental changes such as lighting, improves the accuracy of moving target detection, and effectively resists the influence of interference factors such as image jitter caused by the video itself.
Smart Images

Figure CN123141501A_ABST
Abstract
Description
Technical Field
[0001] This invention pertains to target detection technology, and particularly relates to a method, device, and storage medium for detecting moving targets based on a global graph structure. Background Technology
[0002] Ground-based moving vehicle detection is of great significance for urban spatial planning and ground traffic monitoring. Currently, ground-based monitoring is the primary method for acquiring ground-based moving vehicle information, but remote sensing video offers significant advantages in terms of scale and efficiency. Satellite video-based moving vehicle detection methods can detect ground-based moving vehicles by acquiring large-scale satellite video footage. Current satellite video-based moving vehicle detection methods mainly rely on frame difference and background modeling, and face the following challenges:
[0003] (1) The target size is small. Since the spatial resolution of existing satellite video is generally around meters, vehicle targets often occupy only a small area in the video frame, which is easily confused with the complex background.
[0004] (2) Complex scenes. Satellite video has a wide coverage area, and a single satellite video often contains many scenes, such as docks, airports, cities, etc. This redundant information can interfere with the detection of vehicle targets.
[0005] (3) Background movement, lens shake, and other interference factors. Due to the inherent characteristics of video satellites, the image within the video will move to some extent during video capture, and background movement will affect the detection of moving vehicles. At the same time, due to hardware and other factors, lens shake and other phenomena in satellite video will also occur from time to time, interfering with the detection of moving vehicles. Moreover, because satellite video has a high temporal resolution, it is easily affected by changes in irrelevant factors such as lighting over time, affecting satellite video processing.
[0006] (4) Existing methods for detecting moving vehicles based on satellite video, such as inter-frame difference and background modeling, do not fully perceive inter-frame motion patterns and mine target spatial context information, resulting in weak anti-interference ability of these methods in the process of detecting moving vehicles. Summary of the Invention
[0007] The purpose of this invention is to provide a moving target detection method, device, and storage medium based on a global graph structure to solve the interference problems caused by various factors on moving target detection.
[0008] This invention solves the above-mentioned technical problems through the following technical solution: a moving target detection method based on a global graph structure, comprising:
[0009] Superpixel segmentation is performed on the previous frame of the moving target detection video to obtain the superpixels in the previous frame and their segmentation boundaries; wherein, the moving target detection video is satellite video;
[0010] Using each superpixel in the previous frame as the center node, search for similar nodes of each center node, and construct a global graph structure for each superpixel in the previous frame based on the center node and its similar nodes.
[0011] The current frame of the moving target detection video is segmented into superpixels based on the segmentation boundaries of each superpixel in the previous frame, thus obtaining the superpixels in the current frame.
[0012] Map the global graph structure of each superpixel in the previous frame to the current frame to obtain the global graph structure of each superpixel in the current frame;
[0013] The difference change value of each superpixel in the current frame is calculated based on the global graph structure of each superpixel in the current frame and the previous frame, and then the difference change map of the current frame is obtained.
[0014] The system determines whether there are any abnormal changes between frames based on the difference map between the current frame and the previous frame. If so, it re-matches the target and its position in the current frame based on the target in the previous frame. If not, it refines the difference map of the current frame and then detects the target and its position based on the refined difference map.
[0015] Furthermore, the SLIC superpixel segmentation method is used to perform superpixel segmentation on the previous frame in the moving target detection video.
[0016] Furthermore, using each superpixel in the previous frame as the center node, we search for similar nodes for each center node, specifically including:
[0017] Construct the feature vector for each superpixel, the expression for which is:
[0018]
[0019] Diff i (x ik ,y ik =abs(Frame) T (x ik ,y ik )-Frame T-1 (x ik ,y ik ));
[0020] in, This represents the feature vector of the i-th superpixel in the previous frame; This represents the standard deviation of each pixel within the i-th superpixel in the previous frame; This represents the average value of all pixels within the i-th superpixel in the previous frame; This represents the average motion characteristics of each pixel within the i-th superpixel in the previous frame; N represents the binarized result of the i-th superpixel in the previous frame; i Represents the number of pixels within the i-th superpixel; (x ik ,y ik () represents the coordinates of the k-th pixel within the i-th superpixel; Diff i (x ik ,y ik ) represents the difference between the k-th pixel within the i-th superpixel in two adjacent frames; Th represents the pixel difference threshold; abs represents the absolute value function; Frame T (x ik ,y ik ) represents the k-th pixel within the i-th superpixel in the current frame; Frame T-1 (x ik ,y ik () represents the k-th pixel within the i-th superpixel in the previous frame;
[0021] Calculate the similarity between two superpixels based on the feature vector of each superpixel;
[0022] The similar nodes of each superpixel are determined based on the similarity between each superpixel and other superpixels, the similarity threshold, and the node number threshold, thus obtaining the similar nodes of each center node.
[0023] Preferably, the formula for calculating the similarity between two superpixels is:
[0024]
[0025]
[0026] in, This represents the similarity between the i-th superpixel and the q-th superpixel in the previous frame; a, b, and c all represent intermediate values. Let represent the standard deviations of each pixel within the i-th superpixel and the q-th superpixel in the previous frame, respectively. These represent the average values of each pixel within the i-th superpixel and the q-th superpixel in the previous frame, respectively. These represent the average motion features of each pixel within the i-th superpixel and the q-th superpixel in the previous frame, respectively.
[0027] Furthermore, the specific calculation process for the difference change value of each superpixel in the current frame includes:
[0028] The differences between each superpixel and its similar nodes are calculated based on the global graph structure of each superpixel in the current frame, and the differences between each superpixel and its similar nodes are also calculated based on the global graph structure of each superpixel in the previous frame. The specific calculation formula is as follows:
[0029]
[0030] in, This represents the difference between the i-th superpixel and its j-th similar node in the current frame;
[0031] This represents the difference between the i-th superpixel and its j-th similar node in the previous frame; These represent the standard deviations of each pixel within the i-th superpixel and the j-th similar node in the current frame, respectively. These represent the mean values of each pixel within the i-th superpixel and the j-th similar node in the current frame, respectively. This represents the center coordinates of the i-th superpixel in the current frame; This represents the center coordinates of the j-th similar node in the current frame; Let represent the standard deviations of each pixel within the i-th superpixel and the j-th similar node in the previous frame, respectively. These represent the mean values of each pixel within the i-th superpixel and the j-th similar node in the previous frame, respectively. This represents the center coordinates of the i-th superpixel in the previous frame; This represents the center coordinates of the j-th similar node in the previous frame;
[0032] A weighted degree matrix is constructed based on the differences between each superpixel and its similar nodes in the current frame, and also based on the differences between each superpixel and its similar nodes in the previous frame. The specific construction formula is as follows:
[0033]
[0034] in, M represents the weighted degree matrix of the i-th superpixel in the current frame and the previous frame, respectively; i This represents the number of similar nodes for the i-th superpixel;
[0035] The difference change value of each superpixel in the current frame is calculated based on the weighted degree matrix of each superpixel between the current frame and the previous frame. The specific calculation formula is as follows:
[0036]
[0037] in, This represents the difference change value of the i-th superpixel in the current frame; F This represents the F-norm.
[0038] Furthermore, based on the difference map between the current frame and the previous frame, it is determined whether there are any abnormal changes between frames, specifically including:
[0039] when At that time, there are abnormal changes between frames;
[0040] when At that time, there are no abnormal changes between frames;
[0041] Where, mean represents the mean function; CM T This represents the difference change graph of the current frame. CM represents the difference change value of the i-th superpixel in the current frame, where N represents the number of superpixels; T-1 This represents a graph showing the differences between the previous frame and the previous frame.
[0042] Furthermore, based on the target in the previous frame, the target and its position are re-matched in the current frame. The specific matching formula is as follows:
[0043]
[0044] Where R(x) r ,y r ) represents the matching result matrix R in which (x r ,y r The matching value at the position; Tem represents the target in the previous frame, Tem(x) t ,y t ) represents the pixel coordinates (x, y) of the target in the previous frame. t ,y t The pixel value at (x); A represents the region to be matched, which is the region obtained by expanding the target in the previous frame in the current frame; A(x) r +x t ,y r +y t ) represents the pixel coordinates (x) of the region to be matched. r +x t ,y r +y t The pixel value at ().
[0045] Furthermore, the difference change map of the current frame is refined, specifically including:
[0046] The pixel difference between the current frame and the previous frame is calculated using the following formula:
[0047] Diff(x k ,y k =abs(Frame) T (x k ,yk )-Frame T-1 (x k ,y k ));
[0048] Wherein, Diff(x) k ,y k ) represents the difference between the k-th pixel in the current frame and the previous frame; abs represents the absolute value function; Frame T (x k ,y k ) represents the k-th pixel in the current frame; Frame T-1 (x k ,y k () represents the k-th pixel in the previous frame;
[0049] The pixel difference between the current frame and the previous frame is standardized using the following formula:
[0050] normDiff(x k ,y k ) = min(CM T )+(max(CM T )-min(CM T ))×coeff;
[0051]
[0052] Wherein, normDiff(x) k ,y k ) represents the pixel difference after standardization; min represents the minimum value function; max represents the maximum value function; CM T This represents the difference graph of the current frame; coeff represents the intermediate coefficients; Diff represents the pixel difference matrix between the current frame and the previous frame, Diff = {Diff(x...} k ,y k ), k = 1, 2, ..., N i ×N},N i This represents the number of pixels within the i-th superpixel, and N represents the total number of superpixels.
[0053] Based on the standardized pixel differences, the difference change map of the current frame is refined using the following formula:
[0054]
[0055] RCM T ={RCM T (x k ,y k ), k = 1, 2, ..., N i×N};
[0056] Among them, CM T (x k ,y k () represents the difference change graph CM of the current frame. T Mid-pixel coordinates (x) k ,y k The pixel value at () is equal to the difference change value of the corresponding superpixel in the current frame; RCM T (x k ,y k ) represents CM T (x k ,y k The refined value; RCM T This represents the difference changes in the current frame after refinement.
[0057] Furthermore, based on the refined difference variation map, a threshold segmentation method is used to detect the target and its location, specifically including:
[0058] The adaptive threshold is calculated based on the refined difference change map. The specific calculation formula is as follows:
[0059]
[0060] Where, λ s Indicates an adaptive threshold; E nz RCM T The mean of the non-zero elements; std nz RCM T Standard deviation of non-zero elements; RCM T This is a graph showing the differences after refinement;
[0061] Extract the pixels in the current frame that are greater than the adaptive threshold as the target pixels;
[0062] The extracted target pixels are denoised to obtain the target and its location.
[0063] Based on the same concept, the present invention also provides an electronic device, including a memory, a processor, and a computer program / instructions stored in the memory, wherein the processor executes the computer program / instructions to implement the moving target detection method based on a global graph structure as described above.
[0064] Based on the same concept, the present invention also provides a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implements the moving target detection method based on a global graph structure as described above.
[0065] Compared with the prior art, the advantages of the present invention are as follows:
[0066] This invention constructs a global graph structure based on superpixels and their similar nodes, and performs difference calculations based on this global graph structure. Compared with traditional difference calculations based on single pixels, the global graph structure of this invention can fully utilize the spatial context information of the moving target detection video, effectively mining spatial features while further enhancing the anti-interference ability against environmental changes such as lighting, thus improving detection accuracy. When there are abnormal changes between frames, this invention employs a forward re-matching technique, which can effectively judge and resist the influence of other interference factors such as image jitter caused by the video itself on moving target detection, further improving detection accuracy.
[0067] This invention improves the anti-interference capability and detection accuracy in the moving target detection process. Attached Figure Description
[0068] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only one embodiment of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0069] Figure 1 This is a flowchart of the moving vehicle detection method based on a global graph structure in an embodiment of the present invention;
[0070] Figure 2 This is a schematic diagram of the image change process of the moving vehicle detection method in an embodiment of the present invention;
[0071] Figure 3 This is a schematic diagram of the global graph structure mapping in an embodiment of the present invention;
[0072] Figure 4 These are the ground truth values and qualitative experimental results of GMM and ViBe in the embodiments of this invention;
[0073] Figure 5 These are the qualitative experimental results of AMS-DAT and SGIM in the embodiments of this invention. Detailed Implementation
[0074] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0075] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0076] Example 1
[0077] This embodiment uses a moving vehicle as an example. Figure 1 and Figure 2 As shown, the moving vehicle detection method based on a global graph structure provided in this embodiment includes the following steps:
[0078] Step S1: Perform superpixel segmentation on the previous frame of the moving vehicle detection video to obtain the superpixels in the previous frame and their segmentation boundaries.
[0079] Because acquiring ground-based moving vehicle information via remote sensing video offers greater advantages in terms of scale and efficiency, this embodiment utilizes satellites to acquire moving vehicle detection video. Specifically, the moving vehicle detection video is satellite video, and the SLIC (Simple Linear Iterative Clustering) superpixel segmentation method is used to segment the previous frame of the moving vehicle detection video into superpixels. This yields each superpixel in the previous frame and its segmentation boundary. Each superpixel is a set of pixels with high similarity, while each pixel represents a pixel within the image itself.
[0080] Step S2: Using each superpixel in the previous frame as the center node, search for similar nodes of each center node, and construct a global graph structure for each superpixel in the previous frame based on the center node and its similar nodes.
[0081] To ensure detection efficiency and fully utilize the spatial context information of the image, a global graph structure is constructed for each superpixel based on each superpixel in the previous frame and its similar nodes. In a specific embodiment of the invention, each superpixel in the previous frame is used as a central node, and similar nodes of each central node are searched, specifically including:
[0082] Step S2.1: Construct the feature vector for each superpixel. The expression for the feature vector is:
[0083]
[0084] Diffi i (x ik ,y ik =abs(Frame) T (x ik ,y ik )-Frame T-1 (x ik ,yik (4)
[0085] in, This represents the feature vector of the i-th superpixel in the previous frame; This represents the standard deviation of each pixel within the i-th superpixel in the previous frame; This represents the average value of all pixels within the i-th superpixel in the previous frame; This represents the average motion characteristics of each pixel within the i-th superpixel in the previous frame; N represents the binarized result of the i-th superpixel in the previous frame; i Represents the number of pixels within the i-th superpixel; (x ik ,y ik ) represents the coordinates of the k-th pixel within the i-th superpixel; Diffi i (x ik ,y ik ) represents the difference between the k-th pixel within the i-th superpixel in two adjacent frames (i.e., the current frame and the previous frame); Th represents the pixel difference threshold; abs represents the absolute value function; Frame T (x ik ,y ik ) represents the k-th pixel within the i-th superpixel in the current frame; Frame T-1 (x ik ,y ik ) represents the k-th pixel within the i-th superpixel in the previous frame.
[0086] The pixel difference threshold can be preset or calculated. In this embodiment, the specific calculation formula for the pixel difference threshold is as follows:
[0087] Th=mean(Diff)+3×std(Diff) (5)
[0088] Where Diff represents the pixel difference matrix between the current frame and the previous frame, Diff = {Diff(x...} k ,y k ), k = 1, 2, ..., N i ×N}, where N represents the number of superpixels, Diff(x k ,y k =abs(Frame) T (x k ,y k )-Frame T-1 (x k ,y k Diff(x) k ,y k ) represents the pixel coordinates (x, y) of the current frame and the previous frame. k ,yk The pixel difference at position ) , Frame T (x k ,y l ) represents the pixel coordinates (x, y) in the current frame. k ,y k The pixel at ); Frame T-1 (x l ,y k ) represents the pixel coordinates (x, y) in the previous frame. k ,y k The pixel at () represents the mean function; std represents the standard deviation function.
[0089] Each superpixel's feature vector consists of the mean, standard deviation, and average motion feature, which respectively reflect the average gray intensity, uniformity, and motion properties within the superpixel. By fusing semantic and motion information, not only can similar nodes be extracted based on semantic attributes, but the addition of motion attributes further restricts the connections between moving and non-moving nodes, strengthening the attribute uniformity among nodes in the global graph structure. Introducing motion information during the construction of the global graph structure increases the correlation between moving target nodes, effectively distinguishing nodes with different attributes while enhancing the stability of the global graph structure.
[0090] Step S2.2: Calculate the similarity between two superpixels based on the feature vector of each superpixel.
[0091] After defining the feature vectors, in order to construct the global graph structure, it is necessary to determine the similarity between two superpixels based on the feature vectors; therefore, a similarity metric is defined. In this embodiment, the formula for calculating the similarity between two superpixels is:
[0092]
[0093] in, This represents the similarity between the i-th superpixel and the q-th superpixel in the previous frame; a, b, and c all represent intermediate values. Let represent the standard deviations of each pixel within the i-th superpixel and the q-th superpixel in the previous frame, respectively. These represent the average values of each pixel within the i-th superpixel and the q-th superpixel in the previous frame, respectively. These represent the average motion features of each pixel within the i-th superpixel and the q-th superpixel in the previous frame, respectively.
[0094] After defining the similarity metric, a global search for similar nodes is needed. The large global search scope results in high computational costs; therefore, employing a suitable search strategy is crucial for improving the efficiency and stability of graph structure construction. Sequential traversal performs a global traversal according to the segmentation order. This method consumes significant computational resources, and for the background, regions near segmented blocks exhibit high similarity, potentially leading to nodes clustering around the target node, affecting subsequent graph structure transformation calculations. Random search randomly searches the entire graph. This method not only reduces computational costs but also ensures a more even distribution of nodes, significantly decreasing the probability of local graph construction where nodes are concentrated near the central node. Therefore, this embodiment uses random search to find other superpixels q, and then calculates the similarity between the current superpixel i and other superpixels q. Other superpixels refer to all superpixels in the current frame except for the current superpixel i.
[0095] Step S2.3: Determine the similar nodes of each superpixel based on the similarity between each superpixel and other superpixels, the similarity threshold, and the node number threshold, that is, obtain the similar nodes of each center node.
[0096] To further reduce computational costs, similarity thresholds and node count thresholds are set. When the similarity between each superpixel and other superpixels is... When the similarity exceeds the threshold, the other superpixels... As this superpixel Similar nodes are added to the global graph structure of the superpixel, until the number of nodes in the global graph structure reaches a node count threshold or the search for all other superpixels in the previous frame is completed. Each superpixel constructed in this way... global graph structure It can be represented as:
[0097]
[0098] in, This represents the i-th superpixel in the previous frame. A global graph structure with a central node; Representing the global graph structure All vertices in; Indicates the central node The j-th similar node; Representing the global graph structure All edges in; Representing the global graph structure The edge in The weight is the similarity between the central node and its similar nodes.
[0099] In the previous frame, a random search method is used to search for similar nodes for each superpixel and construct a global graph structure.
[0100] Step S3: Perform superpixel segmentation on the current frame of the moving vehicle detection video based on the segmentation boundary of each superpixel in the previous frame to obtain the superpixels in the current frame.
[0101] To ensure that change perception is performed under the same standard, this invention uses the segmentation boundaries of superpixels in the previous frame to perform superpixel segmentation on the current frame, thereby obtaining multiple superpixels in the current frame.
[0102] Step S4: Map the global graph structure of each superpixel in the previous frame to the current frame to obtain the global graph structure of each superpixel in the current frame.
[0103] To calculate the differences in the changes of each global graph structure between the current frame and the previous frame, the similarity relationships between the central nodes and their similar nodes in each global graph structure in the previous frame are mapped to the current frame (e.g., ...). Figure 3 As shown), the nodes in each global graph structure before and after mapping have the same positional relationship. Therefore, the global graph structure of each superpixel in the current frame is... It can be represented as:
[0104]
[0105] in, Represents the i-th superpixel in the current frame. The global graph structure; Representing the global graph structure All vertices in; Indicates the central node The j-th similar node; Representing the global graph structure All edges in; Representing the global graph structure The edge in The weight is the difference between the central node and its similar nodes; This represents the difference between the i-th superpixel and its j-th similar node in the current frame; These represent the standard deviations of each pixel within the i-th superpixel and the j-th similar node in the current frame, respectively. These represent the mean values of each pixel within the i-th superpixel and the j-th similar node in the current frame, respectively. This represents the center coordinates of the i-th superpixel in the current frame; This represents the center coordinates of the j-th similar node in the current frame. The formula for calculating the center coordinates is:
[0106]
[0107] Among them, (x ik ,y ik ) represents the coordinates of the k-th pixel within the i-th superpixel; N i Represents the number of pixels within the i-th superpixel; (x jk ,y jk ) represents the coordinates of the k-th pixel within the j-th similar node; N j This represents the number of pixels within the j-th similar node.
[0108] Step S5: Calculate the difference change value of each superpixel in the current frame based on the global graph structure of each superpixel in the current frame and the previous frame, and then obtain the difference change map of the current frame.
[0109] To measure the difference in changes between two global graph structures before and after mapping, this invention uses difference change values to quantify the changes between the two global graph structures in the preceding and following frames. A difference change map between the preceding and following frames is obtained from all difference change values. In a specific embodiment of this invention, the specific calculation process for the difference change value of each superpixel in the current frame includes:
[0110] Step S5.1: Calculate the difference between each superpixel and its similar nodes based on the global graph structure of each superpixel in the current frame. Calculate the differences between each superpixel and its similar nodes based on the global graph structure of each superpixel in the previous frame. The specific calculation formula is as follows:
[0111]
[0112] in, This represents the difference between the i-th superpixel and its j-th similar node in the previous frame;
[0113] This represents the standard deviation of each pixel within the j-th similar node in the previous frame; This represents the average value of each pixel within the j-th similar node in the previous frame; This represents the center coordinates of the i-th superpixel in the previous frame; This represents the center coordinates of the j-th similar node in the previous frame.
[0114] Step S5.2: Construct a weighted degree matrix based on the differences between each superpixel and its similar nodes in the current frame, and construct a weighted degree matrix based on the differences between each superpixel and its similar nodes in the previous frame. The specific construction formula is as follows:
[0115]
[0116] in, M represents the weighted degree matrix of the i-th superpixel in the current frame and the previous frame, respectively; i This represents the number of similar nodes for the i-th superpixel.
[0117] Step S5.3: Calculate the difference change value of each superpixel in the current frame based on the weighted degree matrix of each superpixel between the current frame and the previous frame. The specific calculation formula is as follows:
[0118]
[0119] in, This represents the difference change value of the i-th superpixel in the current frame; F Represents the F-norm. Difference variation graph for the current frame. N represents the number of superpixels.
[0120] This method of measuring variation can integrate the local changes generated by a single node in the global graph structure with the global changes generated by all nodes, thus better realizing the measurement of variation in the global graph structure.
[0121] Step S6: Determine whether there are any abnormal changes between frames based on the difference change map between the current frame and the previous frame. If there are, rematch the target and its position in the current frame based on the target in the previous frame. If there are no abnormal changes, refine the difference change map of the current frame, and then detect the target and its position based on the refined difference change map.
[0122] Due to the influence of satellite imagery, anomalies may occur in the video of moving vehicles, such as unclear target motion between some frames, leading to a decrease in detection quality. To avoid these phenomena affecting the detection results, this invention first determines whether the following phenomena exist:
[0123] when At that time, there are abnormal changes between frames;
[0124] when At that time, there are no abnormal changes between frames;
[0125] Where, mean represents the mean function; CM T-1 This represents a graph showing the differences between the previous frame and the previous frame.
[0126] When inter-frame anomalies occur, a forward re-matching strategy is employed for target detection. This involves using the target from the previous frame as a basis and re-matching the target and its position in the current frame. This forward re-matching strategy effectively avoids the impact of inter-frame motion on the detection results. Based on the target from the previous frame, re-matching is performed in the current frame using the same position as the center. The specific matching formula is as follows:
[0127]
[0128] Where R(x) r ,y r ) represents the matching result matrix R in which (x r ,y r The matching value at the position; Tem represents the target (i.e., template) in the previous frame, Tem(x t ,y t ) represents the pixel coordinates (x, y) of the target in the previous frame. t ,y t The pixel value at (x); A represents the region to be matched, which is the region obtained by expanding the target in the previous frame in the current frame; A(x) r +x t ,y r +y t ) represents the pixel coordinates (x) of the region to be matched. r +x t ,y r +y t The pixel value at position (). For the matching result matrix, the position corresponding to the minimum value is the best match, but if the minimum value is still large (e.g., the minimum value is greater than 0.05), it is considered an unsuccessful match.
[0129] When no inter-frame anomalies are present, the detection results need further refinement. This is because nodes in the global graph structure are based on superpixels, and the detection results also use superpixels as the basic extraction unit. To extract targets more precisely, the detection results need further refinement. This refinement is achieved by fusing the difference between two previously acquired frames, Diff(x). k ,y k ), Diff(x) k ,y k While quickly calculating the difference between two frames, it can also obtain the contour of the moving target, thereby strengthening the weight of the edge and further refining the target extraction.
[0130] Before fusing the difference transformation maps, it is necessary to unify the dimensions by adjusting Diff(x). k ,y k Standardization processing:
[0131] normDiff(x k ,y k ) = min(CM T )+(max(CM T )-min(CM T ))×coeff (28)
[0132]
[0133] Diff(x k ,y k =abs(Frame) T (x k ,y k )-Frame T-1 (x k ,y k (30)
[0134] Wherein, normDiff(x) k ,y k ) represents the standardized pixel difference; min represents the minimum value function; max represents the maximum value function; coeff represents the intermediate coefficients; Diff represents the pixel difference matrix between the current frame and the previous frame, Diff={Diff(x k ,y k ), k = 1, 2, ..., N i ×N}.
[0135] Based on the standardized pixel differences, the difference change map of the current frame is refined using the following formula:
[0136]
[0137] RCM T ={RCM T (x k ,y k ), k = 1, 2, ..., N i ×N} (32)
[0138] Among them, CM T (x k ,y k () represents the difference change graph CM of the current frame. T Mid-pixel coordinates (x) k ,y k The pixel value at () is equal to the difference change value of the corresponding superpixel in the current frame; RCM T (x k ,y k ) represents CM T (x k ,y k The refined value; RCM T This represents the difference changes in the current frame after refinement.
[0139] After refinement, not only can more detailed detection results be obtained, but the extraction of moving targets can also be enhanced, and noise from non-moving areas can be suppressed.
[0140] After obtaining the refined difference map, this embodiment uses a threshold segmentation method to detect the target and its location, specifically including:
[0141] Step S6.1: Calculate the adaptive threshold based on the refined difference change map. The specific calculation formula is as follows:
[0142]
[0143] Where, λ s Indicates an adaptive threshold; E nz RCM T The mean of the non-zero elements; std nz RCM T Standard deviation of non-zero elements; RCM T This is a graph showing the differences after refinement.
[0144] Step S6.2: Extract the pixels λ in the current frame that are greater than the adaptive threshold. s As the target pixel.
[0145] Step S6.3: Extract the target pixel λ s Denoising is performed to obtain the target and its location.
[0146] In this embodiment, for noise regions with excessively large or small connected area, morphological judgment is used for noise reduction; for sticky target pixels, the OTSU method (maximum inter-class variance method) is used to separate sticky target pixels, and aspect ratio judgment is used to remove some abnormal regions such as roads generated after separation.
[0147] To verify the effectiveness of the moving vehicle detection method (hereinafter referred to as the SGIM algorithm) proposed in this invention, the SGIM algorithm of this invention was applied to satellite video data.
[0148] Since the SGIM algorithm requires superpixel segmentation as the basis for constructing the global graph structure, this embodiment takes into account the structural differences between different ground targets and detects vehicle targets, which occupy a large number of satellite videos and are difficult to detect. To verify the effectiveness of the SGIM algorithm in exploring the global graph structure of fused motion information in satellite video target detection, the SGIM algorithm was tested against GMM (reference: Zivkovic Z, Van Der Heijden F. Efficient adaptive density estimation per image pixel for the task of background subtraction[J]. Pattern Recognition Letters, 2006, 27(7): 773-780.; Zivkovic Z. Improved adaptive Gaussian mixture model for background subtraction[C] / / Proceedings of the 17th International Conference on Pattern Recognition, 2004. ICPR 2004. Cambridge, UK: IEEE, 2004: 28-31 Vol. 2.) and ViBE (reference: Barnich O, Van Droogenbroeck M. ViBE: A powerful random technique to estimate the background in video sequences[C] / / 2009 IEEE International Conference on Acoustics, Speech and Signal). Comparative analysis of Processing.Taipei,Taiwan,China:IEEE,2009:945-948.) and AMS-DAT (Reference: Chen X,Sui H,Fang J,et al.A Novel AMS-DAT Algorithmfor Moving Vehicle Detection in a Satellite Video[J].IEEE Geoscience andRemote Sensing Letters,2022,19:1-5.).
[0149] For quantitative evaluation of moving target detection in satellite video, this embodiment selects precision, recall, and F1 score as evaluation metrics. To balance method efficiency and structural stability, this embodiment sets a similarity threshold τ. sim and the threshold number of nodes τ vn 5×10 -2 The Intersection over Union (IoU) is currently widely used as an indicator of successful object detection. Since most targets in satellite video are small, typically occupying only a few pixels, even small offsets in the object detection bounding box can significantly impact the IoU. Considering this, the IoU was set to 0.01 as the metric for successful object detection. All experiments were run on a computer with an Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz and 32GB RAM.
[0150] Experiments were conducted on satellite video data captured by a specific satellite using various methods (SGIM, GMM, ViBe, and AMS-DAT). Four different sequences (Seq) were selected for the experiments, with experimental regions designated as Seq1, Seq2, Seq3, and Seq4. The qualitative results obtained from the experiments are as follows: Figure 4 and Figure 5 As shown.
[0151] Depend on Figure 4 and Figure 5 As can be seen, these sequences contain different challenges: the background in Seq1 is moving; the scene in Seq2 is complex, containing various features such as woodlands, houses, and driveways; vehicle shadows in Seq3 interfere with object detection; and Seq4 has strong lighting variations. Overall, these video sequences contain challenges that are encountered in practical applications. Therefore, these sequences can effectively evaluate the anti-interference ability and robustness of the method of this invention in dealing with different challenges.
[0152] To compare the detection performance of different object detection methods at different times within the same video, this embodiment selects the preceding frames (Seq1) of a portion of the video and subsequent frames (Seq2-Seq4) of other videos. The SGIM algorithm maintains a stable detection level across all sequences without significant fluctuations, while effectively controlling the number of false positives and false negatives. Despite varying levels of interference across different data sets, the SGIM algorithm effectively resists these interferences through global graph structure modeling. Among all detection methods, the ViBe, GMM, and AMS-DAT algorithms exhibit significant fluctuations in detection performance at different stages of the video. ViBe's performance is particularly affected by insufficient consideration of spatial information, leading to an unstable background model and impacting subsequent detection results. GMM, being a pixel-level detection method, is ill-suited to handling changes in scene or lighting conditions, resulting in significant discrepancies between initial and subsequent detection results and a higher number of false positives in later detections. For AMS-DAT, its detection results in the first few frames are better than in subsequent frames. This is because it uses a differential accumulation strategy for noise removal. However, this denoising method depends on the detection performance. When the detection performance is poor, this strategy will negatively affect the trajectory generation of the target motion, thus affecting subsequent detection. AMS-DAT has more obvious missed detections because its detection threshold is set based on the size of the vehicle target. Therefore, when there is a large detection box, the threshold for threshold segmentation will increase, leading to missed detections. The SGIM algorithm constructs a global graph structure, which not only has a global view in graph structure construction but also makes the graph structure more stable. It can effectively capture changing information while being resistant to interference such as environmental changes. The quantitative results of the experiments for all methods are shown in Tables 1 and 2.
[0153] Table 1 Quantitative experimental results of different methods
[0154]
[0155] Table 2. Quantitative experimental results using different methods (continued)
[0156]
[0157]
[0158] From a quantitative perspective, SGIM achieved the highest F1 score across the four sequences tested, exceeding the second-highest score by at least 25.2%. In terms of average accuracy across the four datasets, SGIM performed best in Precision (P), exceeding the second-highest score by 33.7%, indicating its robustness against interference in challenging satellite video scenarios. Furthermore, SGIM maintained relatively stable Precision across all four sequences, demonstrating its ability to achieve stable and reliable detection results across diverse scenarios. GMM had the highest Recall (R) among all algorithms, but the lowest Precision and F1 scores, suggesting that its pixel-level detection approach, particularly in challenging satellite video data, cannot effectively distinguish between real moving targets and interference from background movement or environmental changes. In terms of the F1 score, SGIM performed exceptionally well, achieving the highest value by 33.5%, demonstrating a good balance between Precision and Recall. This indicates that SGIM effectively captures motion information while minimizing false detections, resulting in stable detection results.
[0159] Example 2
[0160] This invention also provides an electronic device, which includes a memory, a processor, and a computer program / instructions stored in the memory. The processor executes the computer program / instructions to implement the moving vehicle detection method based on a global graph structure according to this invention.
[0161] Although not shown, the electronic device includes a processor that can perform various appropriate operations and processes based on programs and / or data stored in read-only memory (ROM) or loaded from a storage portion into random access memory (RAM). The processor can be a multi-core processor or may contain multiple processors. In some embodiments, the processor may include a general-purpose main processor and one or more specialized coprocessors, such as a central processing unit, graphics processing unit (GPU), neural network processor (NPU), digital signal processor (DSP), etc. Various programs and data required for device operation are also stored in RAM. The processor, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0162] The processor and memory described above are used together to execute programs / instructions stored in the memory. When the program / instructions are executed by the computer, they can implement the methods, steps, or functions described in the above embodiments.
[0163] Although not shown, embodiments of the present invention also provide a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implements the moving vehicle detection method based on a global graph structure in embodiments of the present invention.
[0164] Readable storage media include both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient media, such as modulated data signals and carrier waves.
[0165] The above description only discloses specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or modifications that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A moving target detection method based on a global graph structure, characterized in that, The detection method includes: Superpixel segmentation is performed on the previous frame of the moving target detection video to obtain the superpixels in the previous frame and their segmentation boundaries; wherein, the moving target detection video is satellite video; Using each superpixel in the previous frame as the center node, search for similar nodes of each center node, and construct a global graph structure for each superpixel in the previous frame based on the center node and its similar nodes. The current frame of the moving target detection video is segmented into superpixels based on the segmentation boundaries of each superpixel in the previous frame, thus obtaining the superpixels in the current frame. Map the global graph structure of each superpixel in the previous frame to the current frame to obtain the global graph structure of each superpixel in the current frame; The difference change value of each superpixel in the current frame is calculated based on the global graph structure of each superpixel in the current frame and the previous frame, and then the difference change map of the current frame is obtained. The system determines whether there are any abnormal changes between frames based on the difference map between the current frame and the previous frame. If so, it re-matches the target and its position in the current frame based on the target in the previous frame. If not, it refines the difference map of the current frame and then detects the target and its position based on the refined difference map.
2. The moving target detection method based on global graph structure according to claim 1, characterized in that, The SLIC superpixel segmentation method is used to perform superpixel segmentation on the previous frame in the moving target detection video.
3. The moving target detection method based on a global graph structure according to claim 1, characterized in that, Using each superpixel in the previous frame as the center node, search for similar nodes for each center node, specifically including: Construct the feature vector for each superpixel, the expression for which is: in, This represents the feature vector of the i-th superpixel in the previous frame; This represents the standard deviation of each pixel within the i-th superpixel in the previous frame; This represents the average value of all pixels within the i-th superpixel in the previous frame; This represents the average motion characteristics of each pixel within the i-th superpixel in the previous frame; N represents the binarized result of the i-th superpixel in the previous frame; i Represents the number of pixels within the i-th superpixel; (x ik ,y ik () represents the coordinates of the k-th pixel within the i-th superpixel; Diff i (x ik ,y ik ) represents the difference between the k-th pixel within the i-th superpixel in two adjacent frames; Th represents the pixel difference threshold; abs represents the absolute value function; Frame T (x ik ,y ik ) represents the k-th pixel within the i-th superpixel in the current frame; Frame T-1 (x ik ,y ik () represents the k-th pixel within the i-th superpixel in the previous frame; Calculate the similarity between two superpixels based on the feature vector of each superpixel; The similar nodes of each superpixel are determined based on the similarity between each superpixel and other superpixels, the similarity threshold, and the node number threshold, thus obtaining the similar nodes of each center node. Preferably, the formula for calculating the similarity between two superpixels is: in, This represents the similarity between the i-th superpixel and the q-th superpixel in the previous frame; a, b, and c all represent intermediate values. Let represent the standard deviations of each pixel within the i-th superpixel and the q-th superpixel in the previous frame, respectively. These represent the average values of each pixel within the i-th superpixel and the q-th superpixel in the previous frame, respectively. These represent the average motion features of each pixel within the i-th superpixel and the q-th superpixel in the previous frame, respectively.
4. The moving target detection method based on global graph structure according to claim 1, characterized in that, The specific calculation process for the difference change value of each superpixel in the current frame includes: The differences between each superpixel and its similar nodes are calculated based on the global graph structure of each superpixel in the current frame, and the differences between each superpixel and its similar nodes are also calculated based on the global graph structure of each superpixel in the previous frame. The specific calculation formula is as follows: in, This represents the difference between the i-th superpixel and its j-th similar node in the current frame; This represents the difference between the i-th superpixel and its j-th similar node in the previous frame; These represent the standard deviations of each pixel within the i-th superpixel and the j-th similar node in the current frame, respectively. These represent the mean values of each pixel within the i-th superpixel and the j-th similar node in the current frame, respectively. This represents the center coordinates of the i-th superpixel in the current frame; This represents the center coordinates of the j-th similar node in the current frame; Let represent the standard deviations of each pixel within the i-th superpixel and the j-th similar node in the previous frame, respectively. These represent the mean values of each pixel within the i-th superpixel and the j-th similar node in the previous frame, respectively. This represents the center coordinates of the i-th superpixel in the previous frame; This represents the center coordinates of the j-th similar node in the previous frame; A weighted degree matrix is constructed based on the differences between each superpixel and its similar nodes in the current frame, and also based on the differences between each superpixel and its similar nodes in the previous frame. The specific construction formula is as follows: in, M represents the weighted degree matrix of the i-th superpixel in the current frame and the previous frame, respectively; i This represents the number of similar nodes for the i-th superpixel; The difference change value of each superpixel in the current frame is calculated based on the weighted degree matrix of each superpixel between the current frame and the previous frame. The specific calculation formula is as follows: in, This represents the difference change value of the i-th superpixel in the current frame; F This represents the F-norm.
5. The moving target detection method based on a global graph structure according to claim 1, characterized in that, Determine if there are any abnormal changes between frames based on the difference between the current frame and the previous frame, specifically including: when At that time, there are abnormal changes between frames; when At that time, there are no abnormal changes between frames; Where mean represents the mean function; CM T This represents the difference change graph of the current frame. CM represents the difference change value of the i-th superpixel in the current frame, where N represents the number of superpixels; T-1 This represents a graph showing the differences between the previous frame and the previous frame.
6. The moving target detection method based on a global graph structure according to claim 1, characterized in that, Based on the target in the previous frame, the target and its position are rematched in the current frame. The specific matching formula is as follows: Where R(x) r ,y r ) represents the matching result matrix R in which (x r ,y r The matching value at the position; Tem represents the target in the previous frame, Tem(x) t ,y t ) represents the pixel coordinates (x, y) of the target in the previous frame. t ,y t The pixel value at (x); A represents the region to be matched, which is the region obtained by expanding the target in the previous frame in the current frame; A(x) r +x t ,y r +y t ) represents the pixel coordinates (x) of the region to be matched. r +x t ,y r +y t The pixel value at ().
7. The moving target detection method based on global graph structure according to claim 1, characterized in that, The difference change map of the current frame is refined, specifically including: The pixel difference between the current frame and the previous frame is calculated using the following formula: Diff(x k ,y k )=abs(Frame T (x k ,y k )-Frame T-1 (x k ,y k )); Wherein, Diff(x) k ,y k ) represents the difference between the k-th pixel in the current frame and the previous frame; abs represents the absolute value function; Frame T (x k ,y k ) represents the k-th pixel in the current frame; Frame T-1 (x k ,y k () represents the k-th pixel in the previous frame; The pixel difference between the current frame and the previous frame is standardized using the following formula: normDiff(x k ,y k )=min(CM T )+(max(CM T )-min(CM T ))×coeff; Wherein, normDiff(x) k ,y k ) represents the pixel difference after standardization; min represents the minimum value function; max represents the maximum value function; CM T This represents the difference graph of the current frame; coeff represents the intermediate coefficients; Diff represents the pixel difference matrix between the current frame and the previous frame, Diff = {Diff(x...} k ,y k ), k = 1, 2, ..., N i ×N},N i This represents the number of pixels within the i-th superpixel, and N represents the total number of superpixels. Based on the standardized pixel differences, the difference change map of the current frame is refined using the following formula: RCM T ={RCM T (x k ,y k ),k=1,2,…,N i ×N}; Among them, CM T (x k ,y k () represents the difference change graph CM of the current frame. T Mid-pixel coordinates (x k ,y k The pixel value at () is equal to the difference change value of the corresponding superpixel in the current frame; RCM T (x k ,y k ) represents CM T (x k ,y k The refined value; RCM T This represents a graph showing the differences in the current frame after refinement.
8. The moving target detection method based on a global graph structure according to any one of claims 1 to 7, characterized in that, Based on the refined difference map, a threshold segmentation method is used to detect the target and its location, specifically including: The adaptive threshold is calculated based on the refined difference change map. The specific calculation formula is as follows: Where, λ s Indicates an adaptive threshold; E nz RCM T The mean of the non-zero elements in the standard; std nz RCM T Standard deviation of non-zero elements; RCM T This is a graph showing the differences after refinement; Extract the pixels in the current frame that are greater than the adaptive threshold as the target pixels; The extracted target pixels are denoised to obtain the target and its location.
9. An electronic device comprising a memory, a processor, and a computer program / instructions stored in the memory, characterized in that, The processor executes the computer program / instructions to implement the moving target detection method based on a global graph structure as described in any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instruction is executed by the processor, it implements the moving target detection method based on the global graph structure as described in any one of claims 1 to 8.
