A video condensation method based on target trajectory motion pattern

Through the video concentration method based on the target trajectory motion pattern, the problem of false collision and time-consuming rearrangement is solved, and more efficient video concentration and visual effect improvement are achieved. Through offline training and dynamic search space local optimization technology, smoother video is generated. and accurate condensed video.

CN115695949BActive Publication Date: 2024-10-18NORTHWESTERN POLYTECHNICAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211322752.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-27
Publication Date
2024-10-18
Estimated Expiration
2042-10-27

AI Technical Summary

Technical Problem

Existing video condensation technology has problems with false collisions, time-consuming rearrangement of target trajectories, and poor visual browsing effects. It is difficult to reduce false collisions and improve execution efficiency while increasing the compression rate.

Method used

A video condensation method based on target trajectory motion patterns is used to generate motion patterns and groups through offline training. It combines clustering algorithms and dynamic search space local optimization to perform trajectory rearrangement and image fusion to reduce false collisions and improve visual effects.

Benefits of technology

The execution efficiency and visual browsing effect of video condensation are improved, pseudo-collision between targets is reduced, and the generated condensed video is smoother and more accurate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115695949B_ABST
    Figure CN115695949B_ABST
Patent Text Reader

Abstract

The present invention provides a video concentration method based on target trajectory motion patterns, and relates to the technical fields of image processing and video surveillance. The method comprises the following steps: 1) target trajectory motion pattern generation and grouping; this stage comprises: video target motion trajectory extraction, trajectory motion pattern generation, and trajectory motion pattern grouping; 2) online video concentration based on trajectory motion patterns. This stage comprises: single target trajectory extraction, video background image generation, trajectory motion pattern matching, target trajectory rearrangement within the group, and generation of concentrated video. The present invention obtains target trajectory motion patterns and groupings in surveillance video scenes by training offline video data; based on the trained trajectory motion patterns and groupings, online video concentration is implemented for surveillance video streams, thereby improving the execution efficiency of video concentration and the visual effect of concentrated videos.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image processing and video monitoring, and more specifically, is a video concentration method based on a target trajectory motion pattern. Background Art

[0002] With the development of computer networks and video technology, a large number of surveillance cameras have been deployed in cities to meet public safety needs. The surveillance cameras work 24 hours a day, capturing and storing huge amounts of video data every day. However, browsing video data is time-consuming and labor-intensive. Human power alone cannot accurately and timely obtain massive amounts of data information. How to effectively use video data is a difficult problem. Video concentration technology is used to solve this problem. It has become a research hotspot in the field of surveillance video in recent years.

[0003] Video condensation technology is a target-based video summarization method that can compress long videos into short videos for quick retrieval and browsing of original surveillance data. It takes the target as the basic processing unit, extracts the background image of the surveillance video through background modeling, obtains the foreground target by using target detection and instance segmentation technology, and uses target tracking technology to match and associate continuous foreground targets to generate target trajectories (also called target tubes). Move the target trajectory on the time axis, rearrange the target trajectory, and perform image fusion processing on the rearranged target trajectory and the background image to generate a condensed video. Video condensation technology not only eliminates the temporal and spatial redundancy in the source video, but also well preserves the dynamic characteristics of the moving target.

[0004] However, the movement of video condensation technology also brings new problems: First, pseudo-collisions will occur between video targets. Two target trajectories that do not intersect in time in the source video cannot collide, but moving the target trajectories on the time axis during processing may cause the target trajectories that did not collide to collide, which is called pseudo-collision. Second, the target trajectory rearrangement process is very time-consuming. Target trajectory rearrangement is the most important link in video condensation. Generally, by setting the loss function, it is converted into a multi-objective optimization problem, and the optimal solution is searched globally by using simulated annealing, Markov chain Monte Carlo and other methods. Most of the time, the convergence speed is slow and very time-consuming. Third, the visual browsing effect of condensed video is not good. Condensed video usually displays more targets per frame. If multiple targets with different directions and speeds are gathered into one frame, and there are many pseudo-collisions between the targets, it will affect the user's visual browsing effect. How to minimize pseudo-collisions, improve execution efficiency, and enhance visual browsing effects while improving the compression rate of condensed videos is a problem that needs to be solved in the field of video condensation technology. Summary of the invention

[0005] In order to solve the above technical problems existing in the background technology, the present invention provides a video condensation method based on target trajectory motion mode, which can improve the video condensation execution efficiency and visual browsing effect and reduce pseudo collisions between targets.

[0006] The technical solution of the present invention is: the present invention provides a video condensation method based on the target trajectory motion mode, the method comprising the following steps:

[0007] 1) Target trajectory motion pattern generation and grouping. Input surveillance video historical data, build a model to train the video data, generate target trajectory motion patterns and grouping;

[0008] 2) Online video concentration based on trajectory motion pattern: Input the surveillance video stream, extract the trajectory of the video motion target, and combine the trajectory motion pattern and grouping results in step 1) to perform online video concentration processing to generate a concentrated video.

[0009] The above step 1) includes the following steps:

[0010] 11) Input offline surveillance video data, use deep learning models to perform target detection, instance segmentation and target tracking, obtain instance mask sequences of each target in different video frames (this instance mask sequence is the target trajectory), and complete the extraction of all moving target trajectories in the video;

[0011] 12) Based on the target trajectory extraction, a clustering algorithm is used to cluster all target trajectories, cluster the target trajectories into different classes, and generate target trajectory motion patterns;

[0012] 13) Based on the target trajectory motion pattern generation, the target trajectory motion pattern is divided according to the principle of less collision and direction consistency to generate trajectory motion pattern groups.

[0013] The above step 2) includes the following steps:

[0014] 21) Input the surveillance video stream, use the Gaussian mixture model to model the background, extract the surveillance video background image, and set a certain time interval to update the background;

[0015] 22) Input the surveillance video stream, perform subtraction between the current frame of the video and the background, and obtain the foreground mask through dilation and erosion operations; then use Kalman filtering and Hungarian matching algorithm to track the target and extract the target motion trajectory;

[0016] 23) Matching the extracted target motion trajectory with the target trajectory motion pattern, if the match is successful, the target trajectory is automatically classified into the corresponding trajectory motion pattern group; if the match fails, the target trajectory is classified into the abnormal trajectory motion pattern group;

[0017] 24) For target motion trajectories belonging to the same trajectory motion mode group, a target trajectory rearrangement method based on local optimization of dynamic search space is used for video condensation processing; for target motion trajectories belonging to abnormal trajectory motion mode group, an energy loss function is defined to perform video condensation processing for target trajectory rearrangement;

[0018] 25) For each video concentration group, the rearranged target trajectory (target tube) and the extracted video background image are subjected to frame-by-frame image fusion processing using the Poisson fusion algorithm, and the fused continuous video frames are merged to generate a concentrated video.

[0019] The above step 12) further comprises the following steps:

[0020] 121) The target trajectory is represented by the equally spaced nearest neighbor sampling point method, and the target trajectory is represented as a coordinate vector in is the folding parameter used in the algorithm, (x i ,y i ) are the coordinates of trajectory sampling points;

[0021] 122) Determine the target trajectory similarity criterion, and use the Euclidean distance between the trajectory coordinate vectors as the distance between the two trajectories. The smaller the distance value, the higher the similarity. The distance between the i-th and j-th trajectories is D i,j , the calculation formula is:

[0022]

[0023] in, and They are respectively represented as the x and y coordinate values ​​of the kth sampling point of the ith trajectory, is the fold parameter.

[0024] 123) Calculate and generate the similarity measurement matrix of the distance between trajectories, use the DBSCAN clustering algorithm, set the neighboring point radius γ and the minimum number threshold of core points ω, and perform clustering operations on the target trajectory. Each cluster is identified as a target trajectory motion mode;

[0025] 124) Generate a representative trajectory for each target trajectory motion mode. Calculate the average value of the horizontal coordinate x and the average value of the vertical coordinate y of the coordinate vectors of all target trajectories belonging to the same cluster according to the sampling points to form the coordinate vector of the representative trajectory. Assuming there are n target trajectories in a cluster, is the folding parameter, then is the number of trajectory sampling points, and are the x and y coordinates of the kth sampling point of the trajectory, respectively, and the calculation formula is:

[0026]

[0027]

[0028] The vector coordinates representing the trajectory are:

[0029] The above step 13) further comprises the following steps:

[0030] 131) Counting the sizes (including height and width) of all target detection boxes in the current motion mode group in the video, and calculating the average size of all target detection boxes;

[0031] 132) Superimpose the average values ​​of the height and width of the detection box onto the representative track so that the representative track has a detection box in each frame, and then calculate the collision value between the representative tracks by summing the number of pixels where all the detection boxes in the two tracks intersect.

[0032] 133) In a rectangular coordinate system, 360 degrees are divided into θ equal parts, which represent θ-type directions respectively, and then the direction of the representative trajectory is represented by the direction of the line from the starting point to the end point of the representative trajectory, and the representative trajectory directions are classified, and the relationship between different representative trajectory directions is determined by whether they belong to the same direction category;

[0033] 134) The representative trajectories are grouped according to the collision relationship and direction relationship between the representative trajectories, and each group is a target trajectory motion mode group. By setting the collision threshold, there is no collision or very little collision between the representative trajectories in a group; at the same time, considering the direction relationship, the motion mode that can form a circular flow is preferentially grouped into one group, so that the subsequent condensed video in the group maintains fluency.

[0034] The above step 23) further comprises the following steps:

[0035] 231) The extracted target motion trajectory is represented by an equally spaced nearest neighbor sampling point representation method, and the target motion trajectory is represented as a coordinate vector in is the folding parameter used in the algorithm, (x i ,y i ) are the coordinates of trajectory sampling points;

[0036] 232) Calculate the distances of all sampling points between the target trajectory and the representative trajectories of each motion mode as a basis for determining the similarity between the trajectories. The smaller the distance value, the higher the similarity.

[0037] 233) Find the target trajectory motion mode with the shortest distance and record the shortest distance as d min, and compare the distance with the set threshold α. If d min If it is less than or equal to α, the target trajectory is classified into the target trajectory motion mode and belongs to the corresponding trajectory motion mode group;

[0038] 234) If d min If it is greater than the threshold α, the target trajectory is classified as an abnormal trajectory motion mode.

[0039] The above step 24) further comprises the following steps:

[0040] 241) Define the energy loss function, the loss terms include the concentration length loss term, the pseudo collision loss term and the timing disorder loss term; the energy loss function formula is:

[0041]

[0042] Among them, l i represents the starting position of track i in the condensed video, P g represents all trajectories that belong to a motion mode group and trajectory i, P c represents all trajectories that belong to the same motion mode as trajectory i. r represents the condensed video length loss term, E c represents the pseudo collision loss term of the concentrated video, E t represents the temporal chaos loss term of the condensed video trajectory. r , α c , α t They are the weights of different loss items to balance the effects of different loss items;

[0043] 242) A dynamic search space method is used to determine the range of the target trajectory rearrangement position; the target trajectory O i At the beginning of the condensed video i The value range is a dynamically changing value. i The minimum value is recorded as l min , the maximum value is recorded as l max , the minimum value is the maximum value of the starting positions of all the trajectories arranged in the group, and the maximum value is the maximum value of the ending positions of all the trajectories arranged in the group. The calculation formula is:

[0044]

[0045]

[0046] P c represents all trajectories that belong to the same motion mode as trajectory i, len(O k ) represents the frame length of the i-th trajectory;

[0047] 243) The energy loss function and the starting position search space range are used, and the local optimization greedy algorithm is adopted to condense and rearrange the target trajectories within the group.

[0048] The above step 121) further comprises the following steps:

[0049] 1211) mark the starting point and end point coordinates of the target trajectory, and draw a straight line from the starting point to the end point;

[0050] 1212) Divide the straight line into equal parts according to the distance interval , of which Represents the number of folds, usually in the range of Then add Split points;

[0051] 1213) Taking the segmentation point on the straight line as the center of the circle, find the point on the target trajectory that is closest to the segmentation distance, and use the point as the sampling point of the target trajectory;

[0052] 1214) with the starting point and end point of the target trajectory, and (2 ω -1) sampling points to represent the target trajectory. The coordinate vector is in the form of

[0053] The beneficial effects of the present invention are:

[0054] (1) The target trajectory is represented by the equally spaced nearest neighbor sampling point method, which more accurately represents the position and position change information of the target trajectory. The length of trajectories of different lengths is unified to facilitate the distance calculation between trajectories, thereby improving the efficiency and accuracy of trajectory clustering algorithm and trajectory matching.

[0055] (2) A two-stage processing method is adopted, which is to generate motion patterns through offline video data training and to condense video streams online. In the training stage, historical data is fully utilized to make the generated trajectory motion patterns more complete and accurate. In the online stage, existing trajectory motion patterns are used for matching, and the local optimization target trajectory is rearranged in the dynamic search space to improve the execution efficiency of video condensation.

[0056] (3) According to the principle of less collision and direction consistency, the trajectory motion mode is grouped. In the online stage, the detected target trajectories are classified into different motion mode groups, and the target trajectories are rearranged within the group. This reduces the number of pseudo-collisions between targets in the condensed video, and the condensed video contains target trajectories in the same circular flow, which improves the visual browsing effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 This is a schematic diagram of the steps of the video concentration method provided by the present invention.

[0058] Figure 2 It is a schematic diagram of the equally spaced nearest neighbor sampling point method of the present invention.

[0059] Figure 3 Schematic diagram of the similarity measurement method between target trajectories of the present invention.

[0060] Figure 4 Schematic diagram of target trajectory motion mode grouping according to the present invention. DETAILED DESCRIPTION

[0061] See also Figure 2 , the target trajectory equally spaced nearest neighbor sampling point method, first connects the start and end points of the trajectory with a straight line, and selects 8, 16, 32 or 64 equal divisions of the line according to the resolution of the video image. Taking the 8-equal division of the line as an example, draw a circle with each division point on the line as the center, and find the nearest point on the trajectory as the sampling point of the target trajectory. The coordinates of the 8 sampling points on the trajectory together form a coordinate vector to represent the target trajectory.

[0062] See also Figure 3 ,The similarity measurement method between target trajectories,After the trajectories are represented by the equally spaced nearest neighbor sampling point method, the Euclidean distances of the 8 pairs of sampling points of the two trajectories are calculated in order, and all the distance values ​​are added up. The sum obtained is the distance between the two target trajectories. The smaller the distance value, the higher the similarity.

[0063] See also Figure 4 There are 6 groups of trajectory motion patterns, a and b, c and d, e and f are representative trajectories of three pairs of trajectory motion patterns with similar trajectories and opposite directions. There are large collisions between the three pairs of representative trajectories. The principle of motion pattern grouping is to group the representative trajectories with less collision into one group, and at the same time, multiple motion pattern groups in the group should be in the same circular flow direction as much as possible. After grouping, there are two groups in total, a, c and e are grouped into one group, and b, d and f are grouped into another group.

[0064] See also Figure 1 The present invention provides a video condensation method based on target trajectory motion mode grouping, the method comprising:

[0065] 1) Target trajectory motion pattern generation and grouping. Input surveillance video historical data, build a model to train the video data, and generate target trajectory motion patterns and grouping.

[0066] The specific process of the above step 1) is as follows:

[0067] 11) Input offline surveillance video data, use the Yolact++ model for target detection and instance segmentation, and then use the DeepSort model for target tracking to obtain the instance mask sequence of each target in different video frames. This instance mask sequence is the target trajectory, and the trajectory extraction of all moving targets in the video is completed;

[0068] 12) Based on the target trajectory extraction, the DBSCAN clustering algorithm is used to cluster all target trajectories, cluster the target trajectories into different classes, and generate the target trajectory motion pattern;

[0069] The specific process of the above step 12) is as follows:

[0070] 121) The target trajectory is represented by the equally spaced nearest neighbor sampling point algorithm, and the target trajectory is represented as a coordinate vector in is the folding parameter used in the algorithm, (x i ,y i ) are the coordinates of trajectory sampling points;

[0071] like Figure 2 As shown, the specific process of the above step 121) is as follows:

[0072] 1211) mark the starting point and end point coordinates of the target trajectory, and draw a straight line from the starting point to the end point;

[0073] 1212) Divide the straight line into equal parts according to the distance interval , of which Represents the number of folds, usually in the range of Then add Split points;

[0074] 1213) Taking the segmentation point on the straight line as the center of the circle, find the point on the target trajectory that is closest to the segmentation distance, and use the point as the sampling point of the target trajectory;

[0075] 1214) with the starting point and end point of the target trajectory, and (2 ω -1) sampling points to represent the target trajectory. The coordinate vector is in the form of

[0076] 122) Determine the target trajectory similarity criterion, and use the Euclidean distance between the trajectory coordinate vectors as the distance between the two trajectories. The smaller the distance value, the higher the similarity. Figure 3 As shown, the distance between the i-th and j-th trajectories is D i,j , and its calculation formula is:

[0077]

[0078] in, and They are respectively represented as the x and y coordinate values ​​of the kth sampling point of the ith trajectory, is the fold parameter.

[0079] 123) Calculate and generate the similarity measurement matrix of the distance between trajectories, use the DBSCAN clustering algorithm, set the neighboring point radius γ and the minimum number threshold of core points ω, and perform clustering operations on the target trajectory. Each cluster is identified as a target trajectory motion mode;

[0080] 124) Generate a representative trajectory for each target trajectory motion mode. Calculate the average value of the horizontal coordinate x and the average value of the vertical coordinate y of the coordinate vectors of all target trajectories belonging to the same cluster according to the sampling points to form the coordinate vector of the representative trajectory. Assuming there are n target trajectories in a cluster, is the folding parameter, then is the number of trajectory sampling points, and are the x and y coordinates of the kth sampling point of the trajectory, respectively, and the calculation formula is:

[0081]

[0082]

[0083] The vector coordinates representing the trajectory are:

[0084] 13) Based on the target trajectory motion pattern generation, the target trajectory motion pattern is divided according to the principle of less collision and direction consistency to generate trajectory motion pattern groups.

[0085] The specific process of the above step 13) is as follows:

[0086] 131) Counting the sizes (including height and width) of all target detection boxes in the current motion mode group in the video, and calculating the average size of all target detection boxes;

[0087] 132) Superimpose the average values ​​of the height and width of the detection box onto the representative track so that the representative track has a detection box in each frame, and then calculate the collision value between the representative tracks by summing the number of pixels where all the detection boxes in the two tracks intersect.

[0088] 133) In a rectangular coordinate system, 360 degrees is divided into 8 equal parts, each representing 8 directions. The direction of the representative trajectory is represented by the direction of the line from the starting point to the end point of the representative trajectory. The representative trajectory directions are classified, and the relationship between different representative trajectory directions is determined by whether they belong to the same category;

[0089] 134) Figure 4 As shown in the figure, the representative trajectories are grouped according to the collision relationship and direction relationship between the representative trajectories, and each group is the target trajectory motion mode group. By setting the collision threshold, there is no collision or very small collision between the representative trajectories in a group; at the same time, considering the direction relationship, the motion mode that can form a circular flow is preferentially grouped into one group, so that the subsequent condensed video in the group maintains fluency.

[0090] 2) Online video concentration based on trajectory motion pattern: Input the surveillance video stream, extract the trajectory of the video motion target, and combine the trajectory motion pattern and grouping results in step 1) to perform online video concentration processing to generate a concentrated video.

[0091] The specific process of step 2) is as follows:

[0092] 21) Input the surveillance video stream, use the Gaussian mixture model to model the background, extract the surveillance video background image, and set a certain time interval to update the background;

[0093] 22) Input the surveillance video stream, perform subtraction between the current frame and the background, and obtain the foreground mask through dilation and erosion operations; then use Kalman filtering and Hungarian matching algorithm to track the target and extract the target motion trajectory;

[0094] 23) Matching the extracted target motion trajectory with the target trajectory motion pattern, if the match is successful, the target trajectory is automatically classified into the corresponding trajectory motion pattern group; if the match fails, the target trajectory is classified into the abnormal trajectory motion pattern group;

[0095] The specific process of the above step 23) is as follows:

[0096] 231) The extracted target motion trajectory is represented by using the equally spaced nearest neighbor sampling point representation method. Figure 2 As shown, the target motion trajectory is represented by the coordinate vector in is the folding parameter used in the algorithm, (x i ,y i ) are the coordinates of trajectory sampling points;

[0097] 232) Calculate the distances of all sampling points between the target trajectory and the representative trajectories of each motion mode as a basis for determining the similarity between the trajectories. The smaller the distance value, the higher the similarity.

[0098] 233) Find the target trajectory motion mode with the shortest distance and record the shortest distance as d min , and compare the distance with the set threshold α. If d minIf it is less than or equal to α, the target trajectory is classified into the target trajectory motion mode and belongs to the corresponding trajectory motion mode group;

[0099] 234) If d min If it is greater than the threshold α, the target trajectory is classified as an abnormal trajectory motion mode.

[0100] 24) For target motion trajectories belonging to the same trajectory motion mode group, a target trajectory rearrangement method based on local optimization of dynamic search space is used for video concentration processing; for target motion trajectories belonging to abnormal trajectory motion mode group, a target trajectory rearrangement video concentration processing is directly performed based on the energy loss function;

[0101] The specific process of the above step 24) is as follows:

[0102] 241) Define the energy loss function, the loss terms include the concentration length loss term, the pseudo collision loss term and the timing disorder loss term; the energy loss function formula is:

[0103]

[0104] Among them, l i represents the starting position of track i in the condensed video, P g represents all trajectories that belong to a motion mode group and trajectory i, P c represents all trajectories that belong to the same motion mode as trajectory i. r represents the condensed video length loss term, E c represents the pseudo collision loss term of the concentrated video, E t represents the temporal chaos loss term of the condensed video trajectory. r , α c , α t They are the weights of different loss items to balance the effects of different loss items;

[0105] 242) A dynamic search space method is used to determine the range of the target trajectory rearrangement position; the target trajectory O i At the beginning of the condensed video i The value range is a dynamically changing value. i The minimum value is recorded as l min , the maximum value is recorded as l max , the minimum value is the maximum value of the starting positions of all the trajectories arranged in the group, and the maximum value is the maximum value of the ending positions of all the trajectories arranged in the group. The calculation formula is:

[0106]

[0107]

[0108] P c represents all trajectories that belong to the same motion mode as trajectory i, len(O k ) represents the frame length of the i-th trajectory;

[0109] 243) The energy loss function and the starting position search space range are used, and the local optimization greedy algorithm is adopted to condense and rearrange the target trajectories within the group.

[0110] 25) For each video concentration group, the rearranged target trajectory (target tube) and the extracted video background image are subjected to frame-by-frame image fusion processing using the Poisson fusion algorithm, and the fused continuous video frames are merged to generate a concentrated video.

Claims

1. A video condensation method based on target trajectory motion pattern, characterized in that: The specific process of this method is as follows: 1) Target trajectory motion pattern generation and grouping: Input surveillance video historical data, build a model to train the video data, generate target trajectory motion pattern and grouping; 2) Online video condensation based on trajectory motion patterns; Input the surveillance video stream, extract the video moving target trajectory, combine the trajectory motion pattern and grouping results in step 1), perform online video condensation processing, and generate condensed video; The specific process of step 1) is as follows: 11) Input offline monitoring video data and complete the extraction of all moving target trajectories in the video; 12) Based on the target trajectory extraction, a clustering algorithm is used to cluster all target trajectories, cluster the target trajectories into different classes, and generate target trajectory motion patterns; 13) Based on the target trajectory motion pattern generation, the target trajectory motion pattern is divided according to the principle of less collision and direction consistency to generate trajectory motion pattern groups; The step 2) also includes the following: 22) Input surveillance video stream and extract target motion trajectory; 23) Matching the extracted target motion trajectory with the target trajectory motion pattern, if the match is successful, the target trajectory is automatically classified into the corresponding trajectory motion pattern group; if the match fails, the target trajectory is classified into the abnormal trajectory motion pattern group; 24) For target motion trajectories belonging to the same trajectory motion mode group, a target trajectory rearrangement method based on local optimization of dynamic search space is used to perform video condensation processing; For the target motion trajectories belonging to the abnormal trajectory motion pattern group, an energy loss function is defined to perform video condensation processing for rearranging the target trajectories; 25) For each video condensed group, the rearranged target trajectory and the extracted video background image are subjected to frame-by-frame image fusion processing using the Poisson fusion algorithm, and the fused continuous video frames are merged to generate a condensed video; The step 12) also includes the following: 124) After the target trajectory motion pattern is generated, a representative trajectory is generated for each target trajectory motion pattern; the coordinate vectors of all target trajectories belonging to the same cluster are respectively calculated according to the sampling points, and the average values ​​of the horizontal coordinates x and the vertical coordinates y are respectively calculated to form the coordinate vector of the representative trajectory; Step 13) The specific process is as follows: 131) Counting the sizes of all target detection frames in the current motion mode in the video, and calculating the average height and width of all target detection frames; 132) Superimpose the average values ​​of the height and width of the detection box onto the representative track so that the representative track has a detection box in each frame, and then calculate the collision value between the representative tracks by summing the number of pixels where all the detection boxes in the two tracks intersect. 133) In a rectangular coordinate system, 360 degrees are divided into θ equal parts, which represent θ-type directions respectively, and then the direction of the representative trajectory is represented by the direction of the line from the starting point to the end point of the representative trajectory, and the representative trajectory directions are classified, and the relationship between different representative trajectory directions is determined by whether they belong to the same direction category; 134) According to the collision relationship and direction relationship between the representative trajectories, the representative trajectories are grouped, and each group is a target trajectory motion mode group; by setting a collision threshold, there is no collision or very small collision between the representative trajectories in a group; at the same time, considering the direction relationship, the motion mode that can form a circular flow is preferentially grouped into one group, so that the subsequent condensed video in the group maintains fluency; Step 24) The specific process is as follows: 241) Define the energy loss function, the loss terms include the concentration length loss term, the pseudo collision loss term and the timing disorder loss term; the energy loss function formula is: Among them, l i represents the starting position of track i in the condensed video, P g represents all trajectories that belong to a motion mode group and trajectory i, P c represents all trajectories that belong to the same motion mode as trajectory i; E r represents the condensed video length loss term, E c represents the pseudo collision loss term of the concentrated video, E t represents the temporal chaos loss term of the condensed video trajectory; α r , α c , α t They are the weights of different loss items to balance the effects of different loss items; 242) A dynamic search space method is used to determine the range of the target trajectory rearrangement position; the target trajectory O i At the beginning of the condensed video i The value range is a dynamically changing value. i The minimum value is recorded as l min , the maximum value is recorded as l max , the minimum value is the maximum value of the starting positions of all the trajectories arranged in the group, and the maximum value is the maximum value of the ending positions of all the trajectories arranged in the group. The calculation formula is: P c represents all trajectories that belong to the same motion mode as trajectory i, len(O k ) represents the frame length of the k-th trajectory; 243) The energy loss function and the starting position search space range are used, and the local optimization greedy algorithm is adopted to condense and rearrange the target trajectories within the group.

2. The video condensation method based on target trajectory motion pattern according to claim 1, characterized in that: The specific process of step 12) is as follows: 121) The target trajectory is represented by an equally spaced nearest neighbor sampling point algorithm, where the target trajectory is represented by a coordinate vector, and the length of the coordinate vector is the number of sampling points; 122) Determine the target trajectory similarity criterion, using the Euclidean distance between the trajectory coordinate vectors as the distance between the two trajectories. The smaller the distance value, the higher the similarity. 123) The similarity measurement matrix of the distance between the generated trajectories is calculated, and the DBSCAN clustering algorithm is used to set the neighboring point radius γ and the minimum number threshold of core points ω to perform clustering operations on the target trajectory. Each cluster is identified as a target trajectory motion mode.

3. The video condensation method based on target trajectory motion pattern according to claim 1, characterized in that: Step 23) The specific process is as follows: 231) The extracted target motion trajectory is represented by an equally spaced nearest neighbor sampling point representation method, and the target motion trajectory is represented as a coordinate vector; 232) Calculate the distances of all sampling points between the target trajectory and the representative trajectories of each motion mode, and use this as the basis for determining the similarity between the trajectories. The smaller the distance value, the higher the similarity. 233) Find the target trajectory motion mode with the shortest distance, and record the shortest distance as d min , and compare the distance with the set threshold α. If d min If it is less than or equal to α, the target trajectory is classified into the target trajectory motion mode and belongs to the corresponding trajectory motion mode group; 234) If d min If it is greater than the threshold α, the target trajectory is classified as an abnormal trajectory motion mode.

4. The video condensation method based on target trajectory motion pattern according to claim 2, characterized in that: Step 121) The specific process is as follows: 1211) mark the starting point and end point coordinates of the target trajectory, and draw a straight line from the starting point to the end point; 1212) Divide the straight line into equal parts according to the distance interval , of which is the folding parameter, which represents the number of folds, and is usually in the range of Then add Split points; 1213) Taking the segmentation point on the straight line as the center of the circle, find the point on the target trajectory that is closest to the segmentation point, and use the point as the sampling point of the target trajectory; 1214) with the starting point and the end point of the target trajectory, and The target trajectory is represented by a coordinate vector composed of sampling points. The coordinate vector is in the form of

Citation Information

Patent Citations

  • Method for video abstract generation

    CN103246922A

  • Video data transmission method and device, equipment and storage medium

    CN110784672A