Method and system for segmenting moving object in video
By using area vector and frequency band division technology, the initial and final contours of moving objects in video are extracted, and the problems of low efficiency and low accuracy of moving objects segmentation in the prior art are solved, thereby achieving more efficient and more accurate moving objects segmentation.
Patent Information
- Application Number
- CN202510321781.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-18
- Publication Date
- 2025-06-17
AI Technical Summary
When using inter-frame difference to segment moving objects in existing videos, the segmentation efficiency is low, the segmentation quality is difficult to ensure, and the edge contour segmentation accuracy of moving objects is low, especially when the object speed changes violently in the sequence.
By initially determining the initial moving object area for adjacent frame images using area vectors, only the determined area is processed in the subsequent process to improve segmentation efficiency. At the same time, by band division of adjacent frames, the motion characteristics of the pixels are extracted, and the moving pixel map is obtained, and combined with the edge pixel point set, the initial first contour is obtained, and a more accurate second contour is obtained through correction compensation.
The segmentation accuracy of moving objects is improved, the segmentation efficiency is enhanced, and the segmentation quality is ensured when the object speed changes violently.
Smart Images

Figure CN120164146A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video processing, and particularly relates to a method and system for segmenting moving objects in a video. Background Art
[0002] The segmentation of moving objects in a video refers to separating the moving target objects from the video, which is an important part of video analysis, provides important information for establishing video summaries and performing video retrieval, and is widely applied in fields such as intelligent video surveillance, video retrieval, and video-based human-computer interaction.
[0003] Currently, various moving object segmentation algorithms have emerged. Generally speaking, they all utilize the temporal attributes and spatial attributes of moving objects. The temporal attributes reflect the motion attributes of moving objects, mainly manifested as frame differences, optical flow fields, or motion vectors. Based on this, the regions that change (move) between frames, as well as the direction and magnitude of the motion, can be detected.
[0004] Change detection based on frame differences is a relatively popular segmentation method. Since this method is relatively simple to implement, it is widely used in the development of fully automatic object-based video processing systems. However, video object segmentation based on frame differences has error regions caused by noise and uncovered regions caused by object motion. Moreover, since the frame difference values depend on the motion speed of the object, when the object speed changes drastically in the sequence, it is easy to cause the segmentation quality to decline, resulting in inaccurate edge contours of the moving object. Summary of the Invention
[0005] When using frame differences to segment moving objects in existing videos, the segmentation efficiency is low, it is difficult to guarantee the segmentation quality, and the segmentation accuracy of the edge contours of moving objects is low.
[0006] In view of the above problems, a method and system for segmenting moving objects in a video are proposed. By using region vectors, the initial moving object region is initially determined for adjacent frame images. Subsequently, only the determined moving object region needs to be processed, which is beneficial to improving the segmentation efficiency. By performing frequency band division on adjacent frames to extract the motion features of pixels and obtaining a motion pixel map, and combining it with the edge pixel point set, an initial first contour is obtained, which improves the segmentation accuracy of the moving object. By correcting and compensating the first contour, a second contour that is closer to and more accurate for the moving object can be obtained.
[0007] In a first aspect, a method for segmenting moving objects in a video includes: Step 100: Obtain the regional vectors of adjacent frames in the video, calculate the step change amount and angle change amount of the regional vectors, obtain the step change threshold and angle change threshold, and determine the initial moving object region of the current frame according to the step change amount and angle change amount. Use the Canny edge operator to perform edge detection on the initial moving object region to obtain the edge pixel point set; Step 200: Perform frequency band division on adjacent frame images, obtain multiple frequency components of the adjacent frame images and the current component coefficients of each frequency component corresponding to each pixel point. Use the current component coefficients to calculate and obtain the average component coefficients in the adjacent frame images. Calculate and obtain the sub-pixel vectors of the corresponding frequency components according to the current component coefficients and the average component coefficients. According to the sub-pixel vectors, obtain the pixel vectors of each pixel point with respect to all frequency components, and perform fuzzy clustering operations on the pixel vectors of all pixels to extract the moving pixels of the moving object; Step 300: Obtain the moving pixel map composed of all pixel points of the moving object, and obtain the first contour according to the moving pixel map and the edge pixel point set of the current frame; Step 400: Obtain the gradient smoothing function and gradient difference control function of the moving pixel map, use the gradient smoothing function and gradient difference control function to construct an energy field function, provide an external force for the first contour with the energy field function, and perform iterative operations to obtain the final second contour of the moving object.
[0008] Combined with the method for segmenting a moving object in a video according to the first aspect of the present invention, in a first possible implementation manner, the step 100 includes: Step 110: Obtain the average moving step of the adjacent regional vector of the current regional vector and the current moving step of the current regional vector; Step 120: Calculate the step change amount by using the current moving step of the current regional vector and the average moving step of the adjacent regional vector; Step 130: Obtain the average moving angle of the adjacent regional vector of the current regional vector and the current moving angle of the current regional vector; Step 140: Calculate the angle change amount by using the current moving angle of the current regional vector and the average moving angle of the adjacent regional vector.
[0009] Combined with the first possible implementation manner of the first aspect of the present invention, in a second possible implementation manner, the step 100 further includes: Step 150: Compare the step change amount and the angle change amount with the step change threshold and the angle change threshold respectively; Step 160: If both the step size change amount and the angle change amount are greater than the step size change threshold and the angle change threshold, then determine that the region vector is a background region; otherwise, it is a moving object region.
[0010] Combined with the second possible implementation manner of the first aspect of the present invention, in the third possible implementation manner, the step 200 includes: Step 210: Divide adjacent frame images into low-frequency components and high-frequency components respectively according to a specified value; Step 220: Calculate the first average component coefficient of the low-frequency component and the second average component coefficient of the high-frequency component for each pixel point in all adjacent frame images; Step 230: Respectively according to: The current component coefficient and the first average component coefficient of each pixel point of the low-frequency component of the current frame; The current component coefficient and the second average component coefficient of each pixel point of the high-frequency component of the current frame; Calculate the first sub-pixel vector and the second sub-pixel vector; Step 240: Obtain the pixel vector according to the first sub-pixel vector and the second sub-pixel vector.
[0011] Combined with the third possible implementation manner of the first aspect of the present invention, in the fourth possible implementation manner, the step 400 includes: Step 410: Obtain the first gradient component in the first direction and the second gradient component in the second direction of the moving pixel map, respectively obtain the first change rate parameter and the second change rate parameter of the first gradient component in the first direction and the second direction, and the third change rate parameter and the fourth change rate parameter of the second gradient component in the first direction and the second direction; Step 420: Construct and obtain the gradient smoothing function according to the first change rate parameter, the second change rate parameter, the third change rate parameter and the fourth change rate parameter.
[0012] In the second aspect, a moving object segmentation system in a video, adopting the moving object segmentation method described in the first aspect, includes: A first extraction module, configured to obtain the region vectors of adjacent frames in the video, calculate the step size change amount and the angle change amount of the region vectors, obtain the step size change threshold and the angle change threshold, and determine the initial moving object region of the current frame according to the step size change amount and the angle change amount, and perform edge detection on the initial moving object region by using the Canny edge operator to obtain an edge pixel point set; A second extraction module, configured to perform band division on adjacent frame images, obtain multiple frequency components of the adjacent frame images and the current component coefficients corresponding to each pixel point for each of the frequency components, calculate and obtain the average component coefficients in the adjacent frame images by using the current component coefficients, calculate and obtain sub-pixel vectors for the corresponding frequency components according to the current component coefficients and the average component coefficients, obtain pixel vectors of each pixel point with respect to all frequency components according to the sub-pixel vectors, perform fuzzy clustering operation on the pixel vectors of all pixels, and extract the pixels of the moving object; A segmentation module, configured to obtain a moving pixel map formed by all pixel points of the moving object, and obtain a first contour according to the moving pixel map and the edge pixel point set of the current frame; A correction module, configured to obtain the gradient smoothing function and the gradient difference control function of the moving pixel map, construct an energy field function by using the gradient smoothing function and the gradient difference control function, provide an external force for the first contour with the energy field function, perform iterative operation, and obtain the final second contour of the moving object.
[0013] Combined with the moving object segmentation system in the video according to the second aspect of the present invention, in a first possible implementation manner, the first extraction module includes: A first calculation unit and a second calculation unit; The first calculation unit is configured to obtain the average motion step length of the adjacent region vector of the current region vector and the current motion step length of the current region vector, and calculate the step change amount by using the current motion step length of the current region vector and the average motion step length of the adjacent region vector; The second calculation unit is configured to obtain the average motion angle of the adjacent region vector of the current region vector and the current motion angle of the current region vector, and calculate the angle change amount by using the current motion angle of the current region vector and the average motion angle of the adjacent region vector.
[0014] Combined with the first possible implementation manner of the second aspect of the present invention, in a second possible implementation manner, the second extraction module includes: A third calculation unit and a fourth calculation unit; The third calculation unit is configured to calculate a first average component coefficient of the low-frequency component and a second average component coefficient of the high-frequency component for each pixel point in all adjacent frame images; The fourth calculation unit is configured to calculate a first sub-pixel vector and a second sub-pixel vector respectively according to the current component coefficient and the first average component coefficient of each pixel point of the low-frequency component of the current frame, and the current component coefficient and the second average component coefficient of each pixel point of the high-frequency component of the current frame, and obtain the pixel vector according to the first sub-pixel vector and the second sub-pixel vector.
[0015] Combined with the first possible implementation manner of the second aspect of the present invention, in the second possible implementation manner, the correction module includes: An acquisition unit and a construction unit; The acquisition unit is configured to acquire a first gradient component of the motion pixel map in a first direction and a second gradient component in a second direction, and respectively acquire a first change rate parameter and a second change rate parameter of the first gradient component in the first direction and the second direction, and a third change rate parameter and a fourth change rate parameter of the second gradient component in the first direction and the second direction; The construction unit is configured to construct and acquire the gradient smoothing function according to the first change rate parameter, the second change rate parameter, the third change rate parameter, and the fourth change rate parameter.
[0016] Implementing the method and system for segmenting moving objects in a video according to the present invention, by initially determining an initial moving object region using the regional vector for adjacent frame images, subsequent processing can be performed only on the determined moving object region, which is beneficial to improving the segmentation efficiency. By performing band division on adjacent frames to extract the motion features of pixels and obtaining the motion pixel map, and combining it with the edge pixel point set, an initial first contour is obtained, improving the segmentation accuracy of the moving object. By performing correction and compensation on the first contour, a second contour closer to and more accurate for the moving object can be obtained. Description of the Drawings
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0018] Figure 1 It is a schematic flowchart of the steps of an embodiment of the method for segmenting moving objects in a video according to the present invention; Figure 2 For Figure 1 It is a schematic flowchart of the steps of a specific embodiment of step 100 in Figure 3 For Figure 2 It is a schematic flowchart of the steps of a specific embodiment after step 140 in Figure 4 For Figure 1 It is a schematic flowchart of the steps of a specific embodiment of step 200 in Figure 5 For Figure 1 It is a schematic flowchart of the steps of a specific embodiment of step 400 in Figure 6Schematic diagram of the module structure of an embodiment of the moving object segmentation system in the video of the present invention; The names of the parts referred to by the numbers in the drawings are: 501 - the first extraction module, 502 - the second extraction module, 503 - the segmentation module, 504 - the correction module. Detailed implementation manners
[0019] Next, the technical solutions in the present invention will be clearly and completely described in conjunction with the drawings in the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0020] When using the inter-frame difference to segment moving objects in existing videos, the segmentation efficiency is low, it is difficult to guarantee the segmentation quality, and the segmentation accuracy of the edge contours of moving objects is low.
[0021] In view of the above problems, a method and system for segmenting moving objects in videos are proposed.
[0022] The first embodiment In a first aspect, a method for segmenting moving objects in a video, as Figure 1 , Figure 1 is the schematic diagram of the step flow of an embodiment of the method for segmenting moving objects in the video of the present invention; it includes: Step 100: Obtain the regional vectors of adjacent frames in the video, calculate the step change amount and angle change amount of the regional vectors, obtain the step change threshold and angle change threshold, and determine the initial moving object region of the current frame according to the step change amount and angle change amount. Use the Canny edge operator to perform edge detection on the initial moving object region to obtain the edge pixel point set.
[0023] In this embodiment, the regional vector can be understood as the vector unit in the image frame, and there are multiple such vector units in an image frame. The regional vector reflects the time change attribute in adjacent frames, that is, the change attributes of the same regional vector at different times, while in the same frame image, it reflects the regional change attribute, that is, the change attributes of different regions.
[0024] In a preferred embodiment, as Figure 2 , Figure 2 is Figure 1 the schematic diagram of the step flow of a specific embodiment of step 100 in; step 100 includes: Step 110: Obtain the average motion step length of the adjacent region vectors of the current region vector and the current motion step length of the current region vector; Step 120: Calculate the step length change amount by using the current motion step length of the current region vector and the average motion step length of the adjacent region vectors; Step 130: Obtain the average motion angle of the adjacent region vectors of the current region vector and the current motion angle of the current region vector; Step 140: Calculate the angle change amount by using the current motion angle of the current region vector and the average motion angle of the adjacent region vectors.
[0025] In this embodiment, the difference degree between a single region vector and the surrounding region vectors is used to determine whether it is a background region or a moving object region. First, the step length change amount is calculated by using formula (1). : (1), where, is the current motion step length of the a-th region vector, is the average motion step length of the adjacent region vectors adjacent to the a-th region vector, is the adjacent region. Four adjacent regions can be selected for comparison.
[0026] Then, the angle change amount is calculated by using formula (2). : (2), where, is the current motion angle of the a-th region vector, is the average motion angle of the adjacent region vectors adjacent to the a-th region vector, is the adjacent region. Similarly, four adjacent regions can be selected for comparison.
[0027] In a preferred embodiment, as Figure 3 , Figure 3 is the schematic diagram of the step flow of a specific embodiment after Step 140 in Figure 2 ; Step 100 further includes: Step 150: Compare the step length change amount and the angle change amount with the step length change threshold and the angle change threshold respectively; Step 160: If both the step length change amount and the angle change amount are greater than the step length change threshold and the angle change threshold, then determine that the region vector is a background region, otherwise it is a moving object region.
[0028] In this embodiment, the area of the region vector can also be judged. When the area of a certain region vector is small, it is determined as a background region. The initial moving object region is formed by splicing the corresponding blocks of multiple moving region vectors.
[0029] Step 200: Perform band division on adjacent frame images to obtain multiple frequency components of the adjacent frame images and the current component coefficients corresponding to each pixel point for each frequency component. Calculate the average component coefficients in the adjacent frame images using the current component coefficients. Calculate the sub-pixel vectors for the corresponding frequency components based on the current component coefficients and the average component coefficients. Obtain the pixel vectors for each pixel point with respect to all frequency components according to the sub-pixel vectors, and perform fuzzy clustering operations on the pixel vectors of all pixels to extract the moving pixels of the moving object.
[0030] In this embodiment, the frame image is divided into multiple frequency components according to a division threshold. The multiple frequency components can be divided into frequency components or sub-bands of three frequency levels: high, medium, and low, or can be divided into multiple other frequency levels of frequency components or sub-bands. By performing band division, the local features and global features of pixels can be analyzed hierarchically.
[0031] In a preferred embodiment, as Figure 4 , Figure 4 is Figure 1 a schematic diagram of the step flow of a specific embodiment of step 200 in
[0032] In this embodiment, the frame image is divided into two sub-bands: a high-frequency component and a low-frequency component. The high-frequency component can obtain the detailed features of pixels, and the low-frequency component can obtain the similar features of pixels. The motion features of the moving object in the current frame of the video are reflected in the high-frequency component and the low-frequency component. When calculating the motion features of the pixels in the current frame, the image information of the previous frame needs to be used. Then, the first average component coefficient of the low-frequency component of the adjacent frames at pixel point x can be calculated by formula (3). , (3), where N is the number of previous frames, the h-th frame is the current frame, x is the pixel point, is the current component coefficient of the current frame h, and n is the total number of frames. Then, the first sub-pixel vector can be calculated by formula (4). : (4), Similarly, the second sub-pixel vector can be calculated and obtained. , using the above-mentioned first sub-pixel vector and the second sub-pixel vector , the pixel vector of each pixel can be obtained through Equation (5) : (5), where w is the position of pixel point x.
[0033] The motion changes of the moving object in the current frame of the video will be reflected in its high-frequency component and low-frequency component (sub-band). According to the motion characteristics of each corresponding pixel point in the two frequency bands with a specified division threshold in the current frame, a motion feature vector is constructed to reflect the change of the current frame image. The motion characteristics of the pixel points in the high-frequency component and the low-frequency component are used as an element of the image motion feature vector. If the single pixel vector is a 2D feature, then the pixel vector Y of all pixels in the current frame can be expressed as Equation (6): (6), Through fuzzy clustering, pixels with different pixel vectors (motion features) are classified into corresponding classes, and the pixel point set of the motion pixel map is obtained as: (7).
[0034] Step 300: Obtain the motion pixel map composed of all pixel points of the moving object, and obtain the first contour according to the motion pixel map and the edge pixel point set of the current frame.
[0035] If the contour of the moving object is inside and near the motion pixel map, then the first contour is: (8), where is to perform edge detection on the initial moving object area using the Canny operator to obtain the edge pixel point set, H is the distance threshold, and e is the pixel point in the first contour .
[0036] Step 400: Obtain the gradient smoothing function and the gradient difference control function of the motion pixel map, construct an energy field function using the gradient smoothing function and the gradient difference control function, provide an external force for the first contour with the energy field function, and perform iterative operations to obtain the final second contour of the moving object.
[0037] In a preferred embodiment, as Figure 5 , Figure 5 is Figure 1 the schematic diagram of the step flow of a specific embodiment of step 400 in Step 410: Obtain the first gradient component of the motion pixel map in the first direction and the second gradient component in the second direction, and respectively obtain the first change rate parameter and the second change rate parameter of the first gradient component in the first direction and the second direction, and the third change rate parameter and the fourth change rate parameter of the second gradient component in the first direction and the second direction; Step 420: Construct and obtain a gradient smoothing function according to the first change rate parameter, the second change rate parameter, the third change rate parameter, and the fourth change rate parameter.
[0038] Let the first change rate parameter, the second change rate parameter, the third change rate parameter, and the fourth change rate parameter be respectively Then the gradient smoothing function is: (9), where is a smoothness control parameter.
[0039] Let the gradient difference control function be , which is used to control the difference degree between the gradient vector flow and the image gradient, and take the minimum value of the difference degree between the gradient vector flow and the image gradient, so as to make the gradient vector flow match the edge gradient of the image.
[0040] Then the energy field function is: (10).
[0041] By adopting the energy field function, the concave contour part of the edge can be better tracked, the first contour is corrected and compensated, so that the obtained contour is closer to the edge of the real moving object. By using the regional vector to preliminarily determine the initial moving object region in adjacent frame images, subsequent processing can be performed only on the determined moving object region, which is beneficial to improving the segmentation efficiency. By performing band division on adjacent frames to extract the motion features of pixels and obtain the motion pixel map, and combining it with the edge pixel point set, the initial first contour is obtained, which improves the segmentation accuracy of the moving object. By correcting and compensating the first contour, a second contour closer and more accurate to the moving object can be obtained.
[0042] In the second aspect, a moving object segmentation system in a video, as Figure 6 , Figure 6 is a schematic diagram of the module structure of an embodiment of the moving object segmentation system in the video of the present invention; adopting the moving object segmentation method of the first aspect, including: The first extraction module 501 is configured to obtain the regional vectors of adjacent frames in a video, calculate the step change amount and the angle change amount of the regional vectors, obtain the step change threshold and the angle change threshold, and determine the initial moving object region of the current frame according to the step change amount and the angle change amount. Then, use the Canny edge operator to perform edge detection on the initial moving object region to obtain the edge pixel point set; The second extraction module 502 is configured to perform frequency band division on adjacent frame images, obtain multiple frequency components of the adjacent frame images and the current component coefficients of each frequency component corresponding to each pixel point, calculate and obtain the average component coefficient in the adjacent frame images by using the current component coefficients, calculate and obtain the sub-pixel vectors of the corresponding frequency components according to the current component coefficients and the average component coefficients, obtain the pixel vectors of each pixel point with respect to all frequency components according to the sub-pixel vectors, and perform fuzzy clustering operation on the pixel vectors to extract the pixels of the moving object; The segmentation module 503 is configured to obtain the moving pixel map composed of all pixel points of the moving object, and obtain the first contour according to the moving pixel map and the edge pixel point set of the current frame; The correction module 504 is configured to obtain the gradient smoothing function and the gradient difference control function of the moving pixel map, construct the energy field function by using the gradient smoothing function and the gradient difference control function, provide external force for the first contour with the energy field function, and perform iterative operation to obtain the final second contour of the moving object.
[0043] Further, the first extraction module 501 includes a first calculation unit and a second calculation unit; the first calculation unit is configured to obtain the average moving step of the adjacent regional vector of the current regional vector and the current moving step of the current regional vector, and calculate the step change amount by using the current moving step of the current regional vector and the average moving step of the adjacent regional vector; the second calculation unit is configured to obtain the average moving angle of the adjacent regional vector of the current regional vector and the current moving angle of the current regional vector, and calculate the angle change amount by using the current moving angle of the current regional vector and the average moving angle of the adjacent regional vector.
[0044] Further, the second extraction module 502 includes a third calculation unit and a fourth calculation unit; the third calculation unit is configured to calculate the first average component coefficient of the low-frequency component and the second average component coefficient of the high-frequency component of each pixel point in all adjacent frame images; the fourth calculation unit is configured to calculate the first sub-pixel vector and the second sub-pixel vector respectively according to the current component coefficient and the first average component coefficient of each pixel point of the low-frequency component of the current frame, and the current component coefficient and the second average component coefficient of each pixel point of the high-frequency component of the current frame, and obtain the pixel vector according to the first sub-pixel vector and the second sub-pixel vector.
[0045] Further, the correction module 504 includes an acquisition unit and a construction unit; the acquisition unit is configured to acquire a first gradient component of the motion pixel map in a first direction and a second gradient component in a second direction, and respectively acquire a first change rate parameter and a second change rate parameter of the first gradient component in the first direction and the second direction, and a third change rate parameter and a fourth change rate parameter of the second gradient component in the first direction and the second direction; the construction unit is configured to construct an acquisition gradient smoothing function according to the first change rate parameter, the second change rate parameter, the third change rate parameter, and the fourth change rate parameter.
[0046] Implementing a method and system for segmenting a moving object in a video according to the present invention, by using a regional vector to preliminarily determine an initial moving object region for adjacent frame images, subsequent processing can be performed only on the determined moving object region, which is beneficial to improving the segmentation efficiency. By performing band division on adjacent frames to extract the motion features of pixels and obtaining a motion pixel map, and combining it with the edge pixel point set, an initial first contour is obtained, improving the segmentation accuracy of the moving object. By correcting and compensating the first contour, a second contour closer to and more accurate for the moving object can be obtained.
[0047] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for segmenting moving objects in a video, characterized in that: include: Step 100, obtaining region vectors of adjacent frames in the video, calculating the step change amount and angle change amount of the region vector, obtaining a step change threshold and an angle change threshold, and determining the initial moving object region of the current frame according to the step change amount and the angle change amount, performing edge detection on the initial moving object region using the Canny edge operator, and obtaining an edge pixel point set; Step 200, performing frequency band division on adjacent frame images, obtaining multiple frequency components of the adjacent frame images and current component coefficients of each pixel corresponding to each frequency component, using the current component coefficients to calculate and obtain average component coefficients in the adjacent frame images, obtaining sub-pixel vectors of corresponding frequency components according to the current component coefficients and the average component coefficients, obtaining pixel vectors of each pixel with respect to all frequency components according to the sub-pixel vectors, performing fuzzy clustering operations on the pixel vectors of all pixels, and extracting motion pixels of the moving object; Step 300: Obtain a motion pixel map composed of all pixel points of the moving object, and obtain a first contour according to the motion pixel map and the edge pixel point set of the current frame; Step 400: obtain the gradient smoothing function and the gradient difference control function of the motion pixel map, use the gradient smoothing function and the gradient difference control function to construct an energy field function, use the energy field function to provide external force for the first contour, perform iterative operations, and obtain the final second contour of the moving object.
2. The method for segmenting moving objects in a video according to claim 1, characterized in that: The step 100 comprises: Step 110, obtaining the average motion step length of the adjacent region vectors of the current region vector and the current motion step length of the current region vector; Step 120, calculating the step length variation using the current motion step length of the current region vector and the average motion step length of the adjacent region vectors; Step 130, obtaining the average motion angle of the adjacent region vectors of the current region vector and the current motion angle of the current region vector; Step 140: Calculate the angle variation using the current movement angle of the current region vector and the average movement angle of the adjacent region vectors.
3. The method for segmenting moving objects in a video according to claim 2, characterized in that: The step 100 further includes: Step 150: Compare the step length change amount and the angle change amount with the step length change threshold and the angle change threshold respectively; Step 160: If the step length variation and the angle variation are both greater than the step length variation threshold and the angle variation threshold, the region vector is determined to be a background region, otherwise it is a moving object region.
4. The method for segmenting moving objects in a video according to claim 3, characterized in that: The step 200 comprises: Step 210, dividing adjacent frame images into low-frequency components and high-frequency components according to specified values; Step 220, calculating the first average component coefficient of the low-frequency component and the second average component coefficient of the high-frequency component for each pixel in all adjacent frame images; Step 230, respectively according to: The current component coefficient and the first average component coefficient of each pixel of the low-frequency component of the current frame; The current component coefficient and the second average component coefficient of each pixel of the high frequency component of the current frame; Calculating a first sub-pixel vector and a second sub-pixel vector; Step 240: Obtain the pixel vector according to the first sub-pixel vector and the second sub-pixel vector.
5. The method for segmenting moving objects in a video according to claim 1, characterized in that: The step 400 includes: Step 410: Obtain a first gradient component in the first direction and a second gradient component in the second direction of the motion pixel map, and respectively obtain a first change rate parameter and a second change rate parameter of the first gradient component in the first direction and the second direction, and a third change rate parameter and a fourth change rate parameter of the second gradient component in the first direction and the second direction; Step 420: construct and obtain the gradient smoothing function according to the first change rate parameter, the second change rate parameter, the third change rate parameter and the fourth change rate parameter.
6. A moving object segmentation system in a video, using the moving object segmentation method according to any one of claims 1 to 5, characterized in that: include: A first extraction module is used to obtain region vectors of adjacent frames in a video, calculate the step change amount and angle change amount of the region vector, obtain a step change threshold and an angle change threshold, and determine an initial moving object region of a current frame according to the step change amount and the angle change amount, and perform edge detection on the initial moving object region using a Canny edge operator to obtain an edge pixel point set; A second extraction module is used to divide the adjacent frame images into frequency bands, obtain multiple frequency components of the adjacent frame images and current component coefficients of each pixel corresponding to each frequency component, calculate and obtain average component coefficients in the adjacent frame images using the current component coefficients, calculate and obtain sub-pixel vectors of corresponding frequency components based on the current component coefficients and the average component coefficients, obtain pixel vectors of each pixel point with respect to all frequency components based on the sub-pixel vectors, perform fuzzy clustering operations on the pixel vectors of all pixels, and extract pixels of moving objects; A segmentation module, used for obtaining a motion pixel map composed of all pixel points of the moving object, and obtaining a first contour according to the motion pixel map and the edge pixel point set of the current frame; A correction module is used to obtain the gradient smoothing function and the gradient difference control function of the motion pixel map, use the gradient smoothing function and the gradient difference control function to construct an energy field function, use the energy field function to provide external force for the first contour, perform iterative operations, and obtain the final second contour of the moving object.
7. The moving object segmentation system in video according to claim 6, characterized in that: The first extraction module comprises: A first computing unit and a second computing unit; The first calculation unit is used to obtain an average motion step length of adjacent region vectors of the current region vector and a current motion step length of the current region vector, and calculate the step length variation by using the current motion step length of the current region vector and the average motion step length of the adjacent region vectors; The second calculation unit is used to obtain the average movement angle of the adjacent region vectors of the current region vector and the current movement angle of the current region vector, and calculate the angle change using the current movement angle of the current region vector and the average movement angle of the adjacent region vectors.
8. The method for segmenting moving objects in a video according to claim 6, characterized in that: The second extraction module comprises: A third computing unit and a fourth computing unit; The third calculation unit is used to calculate the first average component coefficient of the low-frequency component and the second average component coefficient of the high-frequency component of each pixel in all adjacent frame images; The fourth calculation unit is used to calculate the first sub-pixel vector and the second sub-pixel vector according to the current component coefficient and the first average component coefficient of each pixel point of the low-frequency component of the current frame, and the current component coefficient and the second average component coefficient of each pixel point of the high-frequency component of the current frame, and obtain the pixel vector according to the first sub-pixel vector and the second sub-pixel vector.
9. The method for segmenting moving objects in a video according to claim 6, characterized in that: The correction module comprises: Acquiring units and building units; The acquisition unit is used to acquire a first gradient component in a first direction and a second gradient component in a second direction of the motion pixel map, and respectively acquire a first change rate parameter and a second change rate parameter of the first gradient component in the first direction and the second direction, and a third change rate parameter and a fourth change rate parameter of the second gradient component in the first direction and the second direction; The construction unit is used to construct and obtain the gradient smoothing function according to the first change rate parameter, the second change rate parameter, the third change rate parameter and the fourth change rate parameter.