A dynamic perception-based video compression method, system, device and medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG ELECTRIC POWER SCI RES INST ENERGY TECH CO LTD
- Filing Date
- 2025-12-25
- Publication Date
- 2026-08-07
AI Technical Summary
[0003]然而,传统压缩算法主要依赖规则的运动补偿模型,难以精准捕捉复杂、非线性的人体动作、镜头切换或背景变动,且在低比特率下容易出现图像模糊、边缘伪影等还原失真问题
根据所述时间注意力权重、所述片段注意力权重、所述矩阵注意力权重及预设的压缩算法对所述待压缩视频进行重压缩,得到更新后的压缩视频。
Smart Images

Figure CN121691695B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent video compression technology, specifically to a video compression method, system, device, and medium based on dynamic perception. Background Technology
[0002] With the rapid development of digital media technology, video content is widely used in various fields such as surveillance, entertainment, education, and healthcare. Compared with still images, video data has greater redundancy and a significantly increased data volume, which places higher demands on the storage and transmission efficiency of video. Therefore, video compression technology has become an important research direction in the current multimedia field. Existing mainstream video compression standards mostly employ methods such as intra-frame prediction, motion estimation, and entropy coding to compress video sequences, reducing the storage of redundant data by predicting inter-frame changes.
[0003] However, traditional compression algorithms mainly rely on rule-based motion compensation models, which struggle to accurately capture complex and non-linear human movements, camera transitions, or background changes. Furthermore, they are prone to image blurring and edge artifacts at low bitrates. In addition, these algorithms typically treat the entire frame as the basic unit of compression, ignoring the structural differences in video content where "static areas remain unchanged over time while dynamic areas change drastically," thus wasting resources by repeatedly compressing static backgrounds.
[0004] Existing video compression technologies suffer from the following problems: insufficient utilization of video content structure, failing to effectively separate and compress static and dynamic components; difficulty in accurately modeling dynamic trajectories, especially in depicting continuous actions such as human behavior and target tracking; and uncontrollable and poorly interpretable restoration processes, making it difficult to dynamically adjust compression strategies to optimize the final result. Summary of the Invention
[0005] To address the aforementioned technical problems, this invention discloses a video compression method, system, device, and medium based on dynamic perception, which improves the accuracy of video compression.
[0006] To achieve the above objectives, in a first aspect, the present invention discloses a video compression method based on dynamic perception, comprising: Identify the static and dynamic regions of each frame in the video to be compressed, and construct a static matrix corresponding to the video to be compressed based on the pixel coordinates of the static regions; The video to be compressed is segmented based on the pixel content of the dynamic region and the running trajectory of the dynamic sensing points in the dynamic region to obtain multiple consecutive frame segments; Based on the running trajectory of each of the consecutive frame segments, obtain the simplified compressed segment and dynamic matrix corresponding to each of the consecutive frame segments; The video to be compressed is compressed using the static matrix, multiple dynamic matrices, and multiple simplified compression segments to obtain a compressed video.
[0007] This invention discloses a video compression method based on dynamic perception. By separating the static and dynamic characteristics of video content, targeted processing is performed to reduce redundant data. First, static and dynamic regions are identified and a static matrix is constructed, avoiding the repeated storage of static backgrounds in each frame and directly solving the resource waste problem of repeated compression of static regions. Second, the video is segmented into continuous frame segments based on the pixel content of dynamic regions and the trajectory of dynamic perception points, so that the dynamically changing parts are divided into logical units, which facilitates the accurate capture of nonlinear motion trajectories. Next, a simplified compression segment and a dynamic matrix are generated for each continuous frame segment. The simplified compression segment retains keyframe information, while the dynamic matrix quantifies trajectory changes, jointly reducing the amount of data in the dynamic parts. Finally, the static matrix, multiple dynamic matrices, and multiple simplified compression segments are integrated for overall compression. The static matrix provides a unified representation of the invariant background, while the dynamic matrix and simplified compression segments efficiently encode dynamic changes. The three work together to eliminate the redundancy of traditional whole-frame compression and achieve full utilization of structural differences. Each feature is interconnected: the static matrix lays the foundation for background compression, trajectory segmentation ensures accurate division of dynamic parts, and the simplified compression segments and dynamic matrix work together to simplify the expression of dynamic data. Finally, the compression efficiency is significantly improved through a joint compression strategy.
[0008] As a preferred example, the step of identifying static and dynamic regions in each frame of the video to be compressed, and constructing a static matrix corresponding to the video to be compressed based on the pixel coordinates of the static regions, includes: The acquired video to be compressed is broken down into multiple consecutive images; The images in multiple consecutive frames are sequentially input into a pre-built neural network model, so that the neural network model outputs the static pixel coordinates of static pixels and the dynamic pixel coordinates of dynamic pixels in each frame of the image. For any frame of the image, the pixel content of the static pixel is obtained from the image based on the static pixel coordinates; Construct a static matrix corresponding to the video to be compressed based on the pixel content and the static pixel coordinates.
[0009] The above scheme effectively solves the problem of redundant compression caused by misjudgment of static regions through a neural network-driven pixel-level recognition mechanism. First, the video to be compressed is decomposed into multiple consecutive frames, ensuring that the video content is completely parsed into operable units. Second, these multiple frames are input into a pre-built neural network model. This model adaptively captures complex scene features through deep learning, outputting the precise coordinates of static and dynamic pixels in each frame. This allows static region recognition to no longer rely on simple motion compensation, but rather achieves high-precision differentiation based on the inherent stability of pixel content. Next, for any given frame, the corresponding pixel content is extracted based on the static pixel coordinates output by the neural network. This coordinate localization method ensures that only the content of static regions is accurately captured, avoiding interference from dynamic regions, thus providing a clean data source for static matrix construction. Finally, a static matrix is constructed based on the extracted pixel content and coordinates. This matrix only integrates invariant background information, and its structured representation allows static regions to be stored once, significantly reducing the overhead of repeated processing in subsequent compression and providing core support for improving overall compression efficiency.
[0010] As a preferred example, the step of segmenting the video to be compressed based on the pixel content of the dynamic region and the trajectory of the dynamic sensing points in the dynamic region to obtain multiple consecutive frame segments includes: Based on the multiple dynamic pixel coordinates corresponding to each frame of the image, obtain the dynamic coordinate set corresponding to each frame of the image; The multiple consecutive images are divided into several static continuous frame segments with consistent dynamic coordinate sets and several initial dynamic continuous frame segments with inconsistent dynamic coordinate sets. For any initial dynamic continuous frame segment, the regions with the same pixel content between adjacent frames are identified as dynamic nodes corresponding to the initial dynamic continuous frame segment; Traverse every two adjacent images in the initial dynamic continuous frame segment, and perform vector encoding on the coordinate position change of the dynamic node between every two adjacent images to obtain the vectorized value of the segment running trajectory corresponding to the dynamic node; The vectorized values of the segment running trajectory of the dynamic node between all adjacent images in the initial dynamic continuous frame segment are accumulated to obtain the overall running trajectory vectorized value of the dynamic node in the initial dynamic continuous frame segment. Based on the vectorized value of the overall running trajectory, the duration corresponding to each frame of the image, and the preset constraints, multiple consecutive images are extracted from the initial dynamic continuous frame segment to obtain the dynamic continuous frame segment. Based on several static continuous frame segments and several dynamic continuous frame segments, multiple continuous frame segments corresponding to the video to be compressed are obtained.
[0011] The above solution addresses the compression redundancy issue caused by inaccurate trajectory modeling of dynamic regions through refined segmentation of dynamic areas. Its core lies in utilizing the trajectory change characteristics of dynamic sensing points to decompose the video into structured static and dynamic segment units, thereby avoiding the resource waste associated with processing the entire dynamic region as a whole.
[0012] As a preferred example, the step of obtaining the simplified compressed segment and dynamic matrix corresponding to each of the consecutive frame segments based on the running trajectory of each consecutive frame segment includes: For any given consecutive frame segment, the first frame image in the consecutive frame segment is taken as the simplified compressed segment corresponding to the consecutive frame segment; Obtain the node pixel coordinates of each dynamic node in each simplified compressed segment, and construct an initial matrix corresponding to each simplified compressed segment based on the multiple node pixel coordinates; The vectorized value of the overall running trajectory of each dynamic node is used as the matrix content of the initial matrix to obtain the dynamic matrix corresponding to each simplified compressed segment.
[0013] The above scheme utilizes a trajectory-driven compression mechanism to transform dynamic region changes into a lightweight data structure, effectively avoiding the redundancy problem of storing complete frames. Specifically, the first frame in a continuous frame segment is used as a simplified compressed segment. Leveraging the continuity of motion within the segment, pixel changes in subsequent frames can be reconstructed through trajectory derivation, avoiding the repeated storage of similar content. The pixel coordinates of dynamic nodes in the simplified compressed segment are obtained and an initial matrix is constructed. Based on this coordinate information, a spatial positioning framework is established, providing a precise geometric reference for trajectory vectorization and ensuring alignment between the motion representation and the original video structure. The vectorized values of the overall trajectory are used as the matrix content of the initial matrix to generate a dynamic matrix. By quantifying the motion amplitude and direction, complex dynamic behaviors are compressed into vector data, preserving key motion features while significantly reducing data volume, thereby improving compression efficiency while maintaining video restoration quality.
[0014] As a preferred example, the step of compressing the video to be compressed based on the static matrix, multiple dynamic matrices, and multiple simplified compression segments to obtain a compressed video further includes: Construct the target matrix based on the dimensions of the static matrix; Based on the static pixel coordinates in the static matrix, the pixel content corresponding to the static pixel coordinates is filled into the same coordinate of the target matrix to obtain a single-state matrix; Based on the node pixel coordinates in the dynamic matrix, the vectorized value of the overall running trajectory corresponding to the node pixel coordinates is filled into the same coordinate of the single-state matrix to obtain the dual-state matrix.
[0015] The above solution effectively overcomes the obstacle of integrating static and dynamic data by establishing a unified spatial coordinate framework, providing a structured foundation for subsequent compression processes. Specifically, the key to obtaining the static pixel coordinates in the static matrix and the node pixel coordinates in each dynamic matrix lies in accurately capturing the positional reference of the static background and dynamic targets. Because static areas remain unchanged over a long period while dynamic areas have constantly changing trajectories, if coordinate information is missing or misaligned, subsequent mapping will fail to accurately reflect the spatial relationships of the video content. By focusing on coordinate acquisition rather than directly processing pixel content, unnecessary data inflation is avoided in the pre-compression stage, while providing a quantifiable basis for cross-region alignment. Building upon this foundation, the pixel content in the static matrix and the vectorized values of the overall trajectory in the dynamic matrix are mapped to an initial matrix of the same size based on static pixel coordinates and node pixel coordinates. The core value of this step lies in using coordinates as a bridge to achieve the fusion of heterogeneous data—static pixel content represents the stability of background information, while the vectorized values of the overall trajectory encode the continuity of dynamic changes. Through a coordinate-driven mapping process, the two are strictly aligned in a matrix space of uniform size, eliminating redundancy caused by differences in size or reference system while preserving the complete semantic association between static and dynamic features. This coordinate-based mapping mechanism particularly emphasizes the priority of spatial consistency, enabling the compression algorithm to process mixed information with a more concise structure. Finally, a dual-state matrix corresponding to the video to be compressed is obtained. This matrix serves as an integration carrier, compressing static content and dynamic trajectory into a single data structure. This not only simplifies the input complexity of the compression process but also maintains the structural differences in video content through the dual-state design, creating the necessary conditions for efficient compression and high-quality restoration.
[0016] As a preferred example, the step of compressing the video to be compressed based on the static matrix, multiple dynamic matrices, and multiple simplified compression segments to obtain a compressed video includes: Obtain the start timestamp of each of the simplified compressed segments, and sort the multiple simplified compressed segments according to the start timestamps to obtain a segment sequence; The segment sequence is compressed according to the dual-state matrix and the preset compression algorithm to obtain the compressed video corresponding to the segment to be compressed.
[0017] The above scheme effectively solves the core problem of temporal order disorder in video compression through timestamp-driven sequence organization and structured compression. First, it obtains the starting timestamp of each simplified compressed segment. This step accurately captures the segment's starting position on the original video timeline, providing an immutable time reference for subsequent sorting. Since the temporal logic of video content highly depends on the continuous playback order of frames, the timestamp, as the original time identifier, avoids logical breaks caused by disordered segment arrangement during processing. Second, it sorts multiple simplified compressed segments according to their starting timestamps to obtain a segment sequence. This operation strictly arranges the segments in ascending order based on the value of the timestamps, ensuring that the segment sequence before compression is completely consistent with the playback order of the original video. The unique feature of this timestamp-based sorting mechanism is that it directly utilizes the inherent temporal attributes of the video, rather than relying on indicators such as frame content similarity that are easily affected by dynamic changes. This reliably maintains the temporal continuity of the video and prevents errors such as frame skipping, reverse playback, or content breaks during decoding. Next, the segment sequence is compressed based on the dual-state matrix and a preset compression algorithm. The dual-state matrix integrates the pixel content of static regions and the vectorized values of dynamic node trajectories, and the compression algorithm performs targeted processing on the ordered sequence. This compression method fully utilizes the structural difference between the stable static background and the changing dynamic regions in the video. Through the unified expression of the dual-state matrix, redundant storage of repetitive static data is reduced, while retaining the key information of the dynamic trajectories, making the compression process both efficient and faithful to the content. Finally, the compressed video corresponding to the segment to be compressed is obtained. This output not only preserves the temporal structure and spatial details of the original video, but also achieves complete decodeability of the compressed video through the synergistic effect of the ordered sequence and structured compression, ensuring smooth playback and content consistency of the restored video.
[0018] As a preferred example, the step of compressing the video to be compressed based on the static matrix, multiple dynamic matrices, and multiple simplified compression segments to obtain a compressed video further includes: The compressed video is restored according to a preset neural network model to obtain the restored video; Obtain the local similarity and overall similarity between the restored video and the compressed video; Based on the local similarity, the overall similarity, and the preset similarity threshold, the time attention weight of the timestamp in the simplified compressed segment, the segment attention weight of the simplified compressed segment, and the matrix attention weight of the dual-state matrix are adjusted respectively. The video to be compressed is recompressed based on the time attention weight, the segment attention weight, the matrix attention weight, and the preset compression algorithm to obtain the updated compressed video.
[0019] The above solution addresses the core flaw of uncontrollable quality in compressed video restoration by constructing a closed-loop feedback mechanism, achieving dynamic adaptive optimization of the compression strategy. Specifically, by restoring compressed video using a pre-set neural network model, the solution accurately simulates the decoding process and generates high-quality restored video, providing a reliable benchmark for subsequent evaluation. Its unique feature lies in the neural network model's ability to effectively capture the nonlinear characteristics of complex dynamic trajectories, avoiding edge artifacts caused by traditional linear models. It acquires the local and overall similarity between the restored and compressed videos, and comprehensively identifies compression distortion points by quantitatively analyzing the matching degree between detailed regions and the overall structure. This dual-dimensional evaluation mechanism overcomes the limitation of a single indicator in simultaneously considering local sharpness and global consistency. Based on local similarity, overall similarity, and a pre-set similarity threshold, the temporal attention weight and segment attention weight are adjusted respectively. The matrix attention weights, a dynamic adjustment mechanism based on actual evaluation results, enable time-dimensional compression to focus on keyframes, segment compression to highlight high-value areas, and matrix representation to enhance the accuracy of dynamic trajectories. Its unique feature lies in using a similarity threshold as the decision-making basis, achieving precise matching between weight parameters and video content characteristics. Finally, recompression is performed based on the adjusted weights and compression algorithm, reprocessing the video using optimized parameters. Its unique feature is the synergistic effect of time attention weights, segment attention weights, and matrix attention weights, transforming the compression process from passive execution to active optimization. This significantly improves the detail restoration capability and structural integrity of the restored video, fundamentally overcoming the limitations of uncontrollable restoration processes in traditional compression.
[0020] In a second aspect, the present invention discloses a video compression system based on dynamic perception, including a static recognition module, a video segmentation module, a dynamic recognition module, and a video compression module; The static recognition module is used to identify the static and dynamic regions of each frame in the video to be compressed, so as to construct a static matrix corresponding to the video to be compressed based on the pixel coordinates of the static regions. The video segmentation module is used to segment the video to be compressed based on the pixel content of the dynamic region and the running trajectory of the dynamic sensing points in the dynamic region, so as to obtain multiple consecutive frame segments. The dynamic recognition module is used to obtain the simplified compressed segment and dynamic matrix corresponding to each of the consecutive frame segments based on the running trajectory of each of the consecutive frame segments. The video compression module is used to compress the video to be compressed based on the static matrix, multiple dynamic matrices, and multiple simplified compression segments to obtain a compressed video.
[0021] This invention discloses a video compression system based on dynamic perception. By separating the static and dynamic characteristics of video content, it reduces redundant data through targeted processing. First, static and dynamic regions are identified and a static matrix is constructed, avoiding the repeated storage of static backgrounds in each frame and directly solving the resource waste problem of repeated compression of static regions. Second, the video is segmented into continuous frame segments based on the pixel content of dynamic regions and the trajectory of dynamic perception points, dividing the dynamically changing parts into logical units, which facilitates the accurate capture of nonlinear motion trajectories. Next, a simplified compression segment and a dynamic matrix are generated for each continuous frame segment. The simplified compression segment retains keyframe information, while the dynamic matrix quantifies trajectory changes, jointly reducing the amount of data in the dynamic parts. Finally, the static matrix, multiple dynamic matrices, and multiple simplified compression segments are integrated for overall compression. The static matrix provides a unified representation of the invariant background, while the dynamic matrix and simplified compression segments efficiently encode dynamic changes. The three work together to eliminate the redundancy of traditional whole-frame compression and fully utilize structural differences. Each feature is interconnected: the static matrix lays the foundation for background compression, trajectory segmentation ensures accurate division of dynamic parts, and the simplified compression segments and dynamic matrix work together to simplify the expression of dynamic data. Finally, the compression efficiency is significantly improved through a joint compression strategy.
[0022] Thirdly, the present invention discloses a computer device, including a memory and a processor, wherein the memory stores a computer program; wherein, when the processor executes the computer program, it implements a video compression method based on dynamic perception as described in the first aspect.
[0023] Fourthly, the present invention discloses a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements a video compression method based on dynamic perception as described in the first aspect. Attached Figure Description
[0024] To more clearly illustrate the technical solutions of the embodiments 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 some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a flowchart illustrating a video compression method based on dynamic perception, as disclosed in an embodiment of the present invention.
[0026] Figure 2 This is a schematic diagram of the structure of a video compression system based on dynamic perception disclosed in an embodiment of the present invention.
[0027] Figure 3This is a flowchart illustrating a video compression method based on dynamic perception, disclosed in another embodiment of the present invention. Detailed Implementation
[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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.
[0029] Example 1 Reference Figure 1 To improve video compression performance, this embodiment discloses a video compression method based on dynamic perception, which mainly includes: Step 101: Identify the static and dynamic regions of each frame in the video to be compressed, and construct a static matrix corresponding to the video to be compressed based on the pixel coordinates of the static regions.
[0030] In this embodiment, the step mainly includes: decomposing the acquired video to be compressed into multiple consecutive images; sequentially inputting the multiple consecutive images into a pre-built neural network model, so as to output the static pixel coordinates of static pixels and the dynamic pixel coordinates of dynamic pixels in each frame of the image through the neural network model; for any frame of the image, obtaining the pixel content of the static pixel from the image based on the static pixel coordinates; and constructing a static matrix corresponding to the video to be compressed based on the pixel content and the static pixel coordinates.
[0031] In this embodiment, the above steps effectively solve the problem of redundant compression caused by misjudgment of static regions through a neural network-driven pixel-level recognition mechanism. First, the video to be compressed is decomposed into multiple consecutive frames of images to ensure that the video content is completely parsed into operable units. Second, the multiple frames of images are input into a pre-built neural network model. This model adaptively captures complex scene features through deep learning and outputs the precise coordinates of static and dynamic pixels in each frame. This makes static region recognition no longer dependent on simple motion compensation, but achieves high-precision differentiation based on the inherent stability of pixel content. Next, for any frame of image, the corresponding pixel content is extracted according to the static pixel coordinates output by the neural network. This coordinate positioning method ensures that only the content of static regions is accurately captured, avoiding interference from dynamic regions, thus providing a clean data source for the construction of the static matrix. Finally, a static matrix is constructed based on the extracted pixel content and coordinates. This matrix only integrates invariant background information. Its structured expression allows static regions to be stored at once, significantly reducing the overhead of repeated processing in subsequent compression and providing core support for improving overall compression efficiency.
[0032] Step 102: Segment the video to be compressed based on the pixel content of the dynamic region and the running trajectory of the dynamic sensing points in the dynamic region to obtain multiple consecutive frame segments.
[0033] In this embodiment, the step mainly includes: obtaining a dynamic coordinate set corresponding to each frame of the image based on the multiple dynamic pixel coordinates corresponding to each frame of the image; dividing the multiple consecutive images into several static continuous frame segments with consistent dynamic coordinate sets and several initial dynamic continuous frame segments with inconsistent dynamic coordinate sets; for any initial dynamic continuous frame segment, identifying regions with the same pixel content between adjacent frames of the image as dynamic nodes corresponding to the initial dynamic continuous frame segment; traversing every two adjacent images in the initial dynamic continuous frame segment, and changing the coordinate position of the dynamic node between every two adjacent images. Vector encoding is performed to obtain the vectorized value of the segment running trajectory corresponding to the dynamic node; the vectorized values of the segment running trajectory between all adjacent images of the dynamic node in the initial dynamic continuous frame segment are accumulated to obtain the vectorized value of the overall running trajectory of the dynamic node in the initial dynamic continuous frame segment; multiple consecutive images are extracted from the initial dynamic continuous frame segment according to the vectorized value of the overall running trajectory, the duration of each frame image, and preset constraints to obtain dynamic continuous frame segments; multiple continuous frame segments corresponding to the video to be compressed are obtained based on several static continuous frame segments and several dynamic continuous frame segments.
[0034] In this embodiment, the above steps solve the compression redundancy problem caused by inaccurate trajectory modeling of dynamic parts by finely segmenting the dynamic region. Its core lies in utilizing the trajectory change characteristics of dynamic sensing points to decompose the video into structured static and dynamic segment units, thereby avoiding the resource waste caused by processing the dynamic region as a whole.
[0035] Step 103: Based on the running trajectory of each of the consecutive frame segments, obtain the simplified compressed segment and dynamic matrix corresponding to each of the consecutive frame segments.
[0036] In this embodiment, the step mainly includes: for any one of the continuous frame segments, taking the first frame image in the continuous frame segment as the simplified compressed segment corresponding to the continuous frame segment; obtaining the node pixel coordinates of each dynamic node in each simplified compressed segment, so as to construct an initial matrix corresponding to each simplified compressed segment based on the multiple node pixel coordinates; taking the vectorized value of the overall running trajectory of each dynamic node as the matrix content of the initial matrix, so as to obtain the dynamic matrix corresponding to each simplified compressed segment.
[0037] In this embodiment, the above steps utilize a trajectory-driven compression mechanism to transform dynamic region changes into a lightweight data structure, effectively avoiding the redundancy problem of storing complete frames. Specifically, the first frame image in a continuous frame segment is used as a simplified compressed segment. Leveraging the continuity of motion within the segment, the pixel changes in subsequent frames can be reconstructed through trajectory derivation, avoiding the repeated storage of similar content. The node pixel coordinates of dynamic nodes in the simplified compressed segment are obtained and an initial matrix is constructed. A spatial position framework is established based on the coordinate information, providing a precise geometric reference for trajectory vectorization and ensuring that the motion representation is aligned with the original video structure. The vectorized values of the overall running trajectory are used as the matrix content of the initial matrix to generate a dynamic matrix. By quantifying the motion amplitude and direction, complex dynamic behaviors are compressed into vector data, preserving key motion features while significantly reducing the data volume, thereby improving compression efficiency while maintaining video restoration quality.
[0038] Step 104: Compress the video to be compressed according to the static matrix, multiple dynamic matrices and multiple simplified compression segments to obtain a compressed video.
[0039] In this embodiment, the steps mainly include: obtaining the static pixel coordinates in the static matrix and the node pixel coordinates in each of the dynamic matrices; mapping the pixel content in the static matrix and the vectorized value of the overall running trajectory in the dynamic matrix to an initial matrix of the same size according to the static pixel coordinates and the node pixel coordinates, to obtain a dual-state matrix corresponding to the video to be compressed; obtaining the start timestamp of each of the simplified compression segments, and sorting the multiple simplified compression segments according to the start timestamps to obtain a segment sequence; compressing the segment sequence according to the dual-state matrix and a preset compression algorithm to obtain the compressed video corresponding to the segment to be compressed.
[0040] In this embodiment, after obtaining the compressed video, to improve the accuracy of the compressed video, the following steps can be taken: The compressed video can be restored using a preset neural network model to obtain a restored video; the local similarity and overall similarity between the restored video and the compressed video can be obtained; based on the local similarity, the overall similarity, and a preset similarity threshold, the temporal attention weight of the timestamp in the simplified compressed segment, the segment attention weight of the simplified compressed segment, and the matrix attention weight of the dual-state matrix can be adjusted respectively; the video to be compressed can be recompressed based on the temporal attention weight, the segment attention weight, the matrix attention weight, and a preset compression algorithm to obtain an updated compressed video.
[0041] In this embodiment, the above steps effectively solve the core problem of temporal order disorder in video compression through timestamp-driven sequence organization and structured compression. Simultaneously, by constructing a closed-loop feedback mechanism, the core defect of uncontrollable compressed video restoration quality is addressed, achieving dynamic adaptive optimization of the compression strategy.
[0042] On the other hand, refer to Figure 2 This embodiment also discloses a video compression system based on dynamic perception, including a static recognition module 201, a video segmentation module 202, a dynamic recognition module 203, and a video compression module 204.
[0043] The static recognition module 201 is used to identify the static and dynamic regions of each frame of the video to be compressed, so as to construct a static matrix corresponding to the video to be compressed based on the pixel coordinates of the static regions.
[0044] The video segmentation module 202 is used to segment the video to be compressed based on the pixel content of the dynamic region and the running trajectory of the dynamic sensing points in the dynamic region, so as to obtain multiple continuous frame segments.
[0045] The dynamic recognition module 203 is used to obtain the simplified compressed segment and dynamic matrix corresponding to each of the consecutive frame segments based on the running trajectory of each of the consecutive frame segments.
[0046] The video compression module 204 is used to compress the video to be compressed based on the static matrix, multiple dynamic matrices, and multiple simplified compression segments to obtain a compressed video.
[0047] On the other hand, this embodiment also provides a computer device, including a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the video compression method based on dynamic perception as proposed in the above embodiment. The computer device can be a terminal, and includes a processor, memory, communication interface, display screen, and input device connected via a system bus. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for wired or wireless communication with external terminals. Wireless communication can be achieved through WIFI, carrier networks, NFC (Near Field Communication), or other technologies. The display screen of the computer device can be a liquid crystal display screen or an e-ink display screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, a trackball, or a touchpad provided on the casing of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0048] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the video compression method based on dynamic perception as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0049] This embodiment discloses a video compression method, system, device, and medium based on dynamic perception. By separating the static and dynamic characteristics of video content, targeted processing is performed to reduce redundant data. First, static and dynamic regions are identified and a static matrix is constructed, avoiding the repeated storage of static backgrounds in each frame and directly solving the resource waste problem of repeated compression of static regions. Second, the video is segmented into continuous frame segments based on the pixel content of dynamic regions and the trajectory of dynamic perception points, so that the dynamically changing parts are divided into logical units, which facilitates the accurate capture of nonlinear motion trajectories. Next, a simplified compression segment and a dynamic matrix are generated for each continuous frame segment. The simplified compression segment retains keyframe information, while the dynamic matrix quantifies trajectory changes, jointly reducing the amount of data in the dynamic part. Finally, the static matrix, multiple dynamic matrices, and multiple simplified compression segments are integrated for overall compression. The static matrix provides a unified representation of the invariant background, while the dynamic matrix and simplified compression segments efficiently encode dynamic changes. The three work together to eliminate the redundancy of traditional whole-frame compression and achieve full utilization of structural differences. Each feature is interconnected: the static matrix lays the foundation for background compression, trajectory segmentation ensures accurate division of dynamic parts, the simple compression segment works in conjunction with the dynamic matrix to simplify the expression of dynamic data, and finally the compression efficiency is significantly improved through a joint compression strategy.
[0050] Example 2 Reference Figure 3 To address the technical problems in existing technologies, such as the inability to effectively distinguish between static and dynamic regions, low compression efficiency of dynamic content, insufficient accuracy in motion trajectory modeling, and difficulty in controlling and restoring the quality of compressed images, this embodiment discloses a video compression method based on dynamic perception, including: Step 301: The video to be compressed is split into multiple consecutive images, and the content of each image is decomposed into static regions and dynamic regions, so as to construct a static matrix at coordinate positions based on the static regions.
[0051] In this embodiment, the step mainly includes: splitting the video to be compressed into multiple consecutive images, and then decomposing the content of each image into a static part and a dynamic part, so as to use the static part to construct a solid matrix at the coordinate position, that is, to obtain the static matrix corresponding to the video to be compressed.
[0052] In this first embodiment, the image content decomposition process includes a continuous frame analysis stage and an aggregation stage. Specifically, the continuous frame analysis stage includes analyzing each image in the video to be compressed using a pre-trained neural network model, such as a Transformer network model, and outputting the static and dynamic regions in each frame. It should be noted that the dynamic region is defined for each frame; however, the static region is often occluded by the dynamic region, so only a portion of the static region can be obtained in the analysis of a single frame. The structured representation of the static matrix is convenient as the encoding input basis for subsequent neural network processing, thereby allowing for further exploration of compression potential by combining attention mechanisms and achieving dynamic optimization between compression ratio and restoration accuracy.
[0053] In this first embodiment, when using a Transformer network model as a pre-trained neural network model to identify static and dynamic regions in each frame of an image, the training process of the Transformer network model is as follows: An encoder-decoder network model based on the Transformer architecture is constructed for static and dynamic region identification of video frames. The encoder uses a visual Transformer structure to extract deep feature representations of the input video frames. The decoder consists of multiple upsampling layers and Transformer decoding blocks, generating a classification probability map for each pixel belonging to a static region or a dynamic node based on the deep feature representations. The training data for the model comes from publicly available video segmentation datasets and a self-built video sequence dataset containing labeled static and dynamic pixels. The loss function used in model training is the sum of weighted cross-entropy loss and consistency constraint loss. The weighted cross-entropy loss is used to optimize pixel-level classification accuracy, and the consistency constraint loss is used to ensure the temporal stability of the region identification results for the same object in consecutive video frames. The Adam optimizer is used to train the model until the loss function converges, resulting in the pre-trained neural network model.
[0054] The aggregation step includes taking the intersection of the coordinate positions of static regions in all frame images to obtain a set of coordinates for the static regions; mapping the pixel content in the static regions to the corresponding coordinate positions in the set of coordinates to obtain the coordinate dimensions of the static matrix. Specifically, if there are multiple mapping results for the same coordinate position, the average of the parameters of the multiple mapping results is taken as the pixel content at the coordinate position; the parameters of the pixel content at each coordinate in the set of coordinates are smoothed to obtain the pixel content at the coordinate.
[0055] A matrix is constructed based on the coordinates of each static region, and the corresponding pixel content is positioned as an element in the matrix to obtain the static matrix; where each coordinate position of the non-static part is represented by 0. The static background typically remains unchanged across multiple consecutive frames; repeated encoding frame by frame would result in information redundancy. The purpose of the solid-state matrix is to express the static part with only a single structured result and solidify it as a compression benchmark, thereby significantly reducing the storage and transmission of repetitive information and improving compression efficiency. Prior extraction of the static region minimizes interference when performing vector modeling on the dynamic part, ensuring a stable comparison basis during dynamic trajectory extraction, which contributes to the stable expression and reversible reconstruction of action vectors. It is important to note that pixel content is not a single color value, but a composite data element carrying image semantics and structural information (color information, generally including numerical values in RGB (three-channel) or YUV / HSV (luminance and color separation) formats; luminance / grayscale values; texture features, such as the gradient of a local neighborhood of a point, LBP (Local Binary Pattern), or small-range statistical values, used to describe local changes in the image; transparency / occlusion information, such as transparency α=0.8 (partial occlusion), which can be used to determine whether the pixel participates in static region judgment; illumination estimation / reflectivity estimation (introduced in high-precision compression), for scenes that need to model illumination changes, the brightness change trend of the point in time frames can be added), which is a key foundation for realizing static region synthesis, dynamic trajectory modeling, and ensuring video compression accuracy.
[0056] Step 302: Segment the video to be compressed based on the motion state of the pixel content within the dynamic area and the vectorized value of the trajectory of each dynamic sensing point to obtain multiple consecutive frame segments.
[0057] In this embodiment, the main steps include: identifying consecutive images with identical pixel content in the dynamic region of the video to be compressed, and generating n consecutive frames representing a static state. Specifically, this involves extracting consecutive frames of arbitrary length from the video to be compressed for analysis. If the pixel content (including coordinates) of the dynamic region within the extracted length is completely identical, the extracted consecutive frames are determined to be static consecutive frame segments in a static state. After obtaining a static consecutive frame segment, one frame is extracted forward and backward from the video to be compressed for re-analysis until the number of frames in each static consecutive frame segment representing a static state is maximized. By analyzing the video to be compressed, the content of multiple consecutive images is decomposed into two categories: static and non-static states. The identification of static states is based on the complete consistency of pixel content in the dynamic parts, thereby extracting frames without motion changes and representing them with a single frame or a weighted composite frame. This design effectively removes large sections of redundant information from the video, making it particularly suitable for compression requirements in scenarios such as surveillance and meetings where there are many static images. It reduces data storage redundancy while preserving key visual details.
[0058] For the i-th static continuous frame segment representing a static state, it is represented as an image of a single frame (in this embodiment, each of the n continuous frames representing a static state is represented by the clearest frame in the continuous frame. In other optional embodiments, it can be obtained by averaging the pixel content of all frames in the same continuous frame at each position), to obtain the i-th first feature frame, and mark the starting timestamp.
[0059] In this first embodiment, the vectorized values of the running trajectories of key nodes are evaluated on the continuous frame segments representing non-static states, i.e., continuous frame segments other than the continuous frames representing static states, i.e., the initial dynamic continuous frame segments. The continuous frames whose evaluation results satisfy the constraints are extracted to obtain m continuous frames whose running trajectories can be vectorized, and the starting timestamp is marked. Here, n represents the number of continuous frames representing static states generated, i represents any continuous frame among the n continuous frames, and m represents the number of continuous frames whose running trajectories can be vectorized. Furthermore, identical pixel content across different frames is treated as the same dynamic node (meaning that in consecutive video frames, the visual features of a region or object are consistent or highly similar, such as shape, color, texture, and lighting response; although the position may change, the content itself does not change significantly. This does not refer to pixels with "same coordinates," but rather pixels with "consistent content" appearing in multiple frames. Such pixel regions with consistent content but changing positions across frames are considered the same "object" or "motion node," represented by a unified identifier, facilitating subsequent vector modeling of its trajectory in the time dimension). Between every two adjacent frames, the positional changes of each dynamic node in the dynamic portion are vector-encoded. In consecutive frames, the vector codes of each dynamic node between every two adjacent frames are added together to obtain the vectorized value of the motion trajectory of each dynamic node between consecutive frames.
[0060] Furthermore, when generating consecutive frames that can vectorize the running trajectory, the objective functions are min(m) and max(t). Intuitively, reducing the number of segments min(m) and extending the segment duration max(t) seem to be conflicting. However, in reality, the "vectorized value of the running trajectory" evaluates whether the dynamic nodes in the consecutive frames have an approximately linear and directionally stable trajectory pattern. If the trajectory shows a clear linear trend, multiple frames can be merged into one segment → simultaneously satisfying t↑ and m↓. With local consistency as a constraint, the objective is unified: when the changes of dynamic nodes in consecutive frames tend to be stable, the system can both merge frame segments (max(t)) and reduce the number of segments (min(m)). Essentially, the longer the frame segment with a low vectorized value, the better → "long segments + fewer segments" naturally hold true simultaneously. The algorithm sets two key constraints to ensure that the merged frame segments are "behavioral consistent," so extending the segment will not cause error accumulation and will not compromise compression accuracy.
[0061] The constraints of the evaluation results include: in a continuous frame, for any truncated interval, the vectorized value of each node in the continuous frame is less than a preset value of 1; the range of all vectorized values in the interval is less than a preset value of 2; where t represents the length (number of frames) of each continuous frame from which the running trajectory can be vectorized. It is important to note that for non-static frames, the "vectorized value of the running trajectory of key nodes" is introduced as an evaluation criterion, abstracting complex dynamic content into structured vector information. Trajectory vectors are constructed by accumulating the displacements of dynamic nodes between adjacent frames, and this is used to determine whether the action in the frame segment has a stable linear change trend. If the preset stability and range constraints are met, it is considered a compressible frame segment. Based on this, a joint objective function is set with a minimum number of segments min(m) and a maximum segment duration max(t). Using behavioral consistency as the basis for division, the two objectives not only do not conflict but are naturally unified in the trajectory stability region. The longer the frame segment, the more stable the dynamic behavior, which not only allows for frame merging to reduce the number of compression units but also helps maintain the semantic integrity and compression accuracy of the action.
[0062] It's also important to understand that by reasonably assessing the dynamic changes in content, we can achieve a semantic understanding and abstract modeling of the video content, laying the foundation for subsequent action vector matrix construction and solid matrix overlay. Simultaneously, it provides clear node descriptions and vector paths for the decompression and restoration process, ensuring that the compressed content maintains structural clarity while achieving high-quality content reconstruction.
[0063] Step 303: After vectorizing the motion trajectory of the dynamic node in each of the consecutive frame segments, obtain the simplified compressed segment and dynamic matrix corresponding to each of the consecutive frame segments.
[0064] In this embodiment, the main step is as follows: in each of the continuous frames that can vectorize the running trajectory and the continuous frames representing the static state, the first frame of each continuous frame is used as a simplified segment corresponding to the two types of continuous frames. Using the first frame of a continuous frame as a simplified segment is because it possesses complete scene context information, which can serve as a structural template in the subsequent restoration process. This design not only reduces data redundancy but also ensures the complete preservation of static information such as scene outlines and background textures. The dynamic behavior part is precisely modeled using an action vector matrix. This matrix uses the starting position of the dynamic node as coordinates and its displacement vector throughout the entire frame segment as matrix elements, achieving a compressed expression of the motion trajectory. This method avoids storing position data frame by frame, significantly reducing storage costs, while providing a standardized description for trajectory reconstruction during decoding.
[0065] A matrix is constructed based on the position of each dynamic node in the simplified segment. The vectorized value corresponding to each dynamic node is used as an element in the matrix (the matrix is constructed based on the coordinates of the starting point of the vector, and each element is the vector corresponding to the starting point), resulting in the motion vector matrix. Each coordinate position of the static area in the simplified segment is represented by 0. It should be noted that if a segment of the image only contains static parts, then in this solution, the static parts can be completely replaced by consecutive frames representing a static state, thus eliminating the need to re-extract the simplified segment. Similarly, if no dynamic elements exist, all elements in the dynamic matrix can be 0. In an optional implementation, the compression process can identify whether the image content belongs to a "static part." If multiple segments are "static parts," then only the timestamp and one simplified segment are compressed.
[0066] Furthermore, marking static regions with 0 in the matrix allows for rapid differentiation and ignoring of unchanged regions during subsequent action separation, feature extraction, or image reconstruction, further improving algorithm efficiency and compression ratio. The overall design prioritizes structural simplification, fusing static and dynamic information into a two-dimensional spatial matrix. This enables video content compression to not only reduce data load but also provide excellent behavioral interpretability and reversibility, offering significant advantages in intelligent video analytics and edge device deployment.
[0067] Step 304: Superimpose the static matrix and the state matrix to obtain a dual-state matrix of the video to be compressed.
[0068] In this embodiment, the main steps are as follows: In each of the continuous frames that can vectorize the running trajectory and the continuous frames representing the static state, for the action vector matrix and the solid matrix, the elements in the matrix are mapped to a new matrix of the same size (because the monitoring screen of the same device is fixed, the static part is also fixed. Moreover, the screen size is uniform, so the matrix size is also consistent when constructing the matrix based on the uniformity of size), so that the new matrix has two matrix features. Since the spatial structure of video frames has a uniform size under most fixed camera devices, and the static background has spatial consistency, this design maps the two matrices to the same new matrix at a uniform size, so that each coordinate position simultaneously retains static pixel values and dynamic behavior vectors. This design of integrating dual information at "each coordinate position" not only reduces redundant storage, but also allows the subsequent compression algorithm to avoid frequently switching between static and dynamic feature modes during processing, avoiding the fragmentation of the compression structure and improving the consistency and encoding / decoding stability of the overall compression algorithm.
[0069] Each element in the new matrix contains two elements from the action vector matrix and the solid matrix at the same row and column positions. The elements from the two matrices are integrated at each position according to a fixed arrangement order.
[0070] It's important to understand that compressing this matrix as a unified, fused structure not only maintains compression accuracy but also improves processing efficiency and decoding consistency, demonstrating both innovative and practical value. More importantly, this fused matrix can be compressed as a complete logical structure, providing a unified data carrier for compression algorithms when recognizing image structure and behavioral dynamics. This improves consistency and accuracy during model inference and structure reconstruction, reducing error accumulation caused by separating static and dynamic content. It also provides a clear spatial-motion correspondence for subsequent algorithms (such as attention-based decompression models), enhancing the interpretability of behavior recognition and frame prediction. Therefore, this fused dual-state matrix compression strategy not only has significant practical application value but also exhibits excellent scalability and innovativeness in its technical architecture.
[0071] Step 305: Based on the dual-state matrix and the simplified compression segment, perform video compression on the video to be compressed to obtain a compressed video.
[0072] In this embodiment, the main step is as follows: during video compression, each simplified compressed segment, the start timestamp of the corresponding consecutive frames of each simplified compressed segment, and the dual-state matrix corresponding to each simplified compressed segment are integrated to obtain each compression unit. Traditional video compression often uses fixed intervals or Group of coded frames (GOPs) as units, which is difficult to adapt to the non-uniform distribution of complex dynamic content. However, by dividing the video into logically meaningful compression units and encapsulating the representative frames of the image (simplified segments), temporal positioning (start timestamps), and dynamic-static graph information (dual-state matrix) into a unified whole, not only is the spatial and temporal semantics of the content preserved, but also a structural unit that is easy to store, retrieve, and decode is constructed. This provides good controllability and evaluability for subsequent compression optimization and reinforcement learning mechanisms. Each compression unit is a relatively independent entity, and different compression parameters or algorithm modules can be used for its content features (such as motion intensity and background repetition rate); at the same time, in the simulation restoration and optimization stage, reconstruction errors can be located unit by unit, thereby achieving local gain rather than global over-compression and improving the intelligence of the system. If some data is lost during transmission, it is only necessary to fall back to the previous compression unit for re-decompression without affecting the decoding of other units. Especially in edge devices or multi-threaded parallel scenarios, the structured encapsulation of compression units can effectively improve decoding efficiency and module parallelism.
[0073] After arranging each compression unit in chronological order, the sequence is compressed using a pre-defined compression algorithm. First, as temporal data, video content naturally possesses semantic dependencies based on temporal order. Disrupting the compression units can easily lead to distorted temporal information after decompression, affecting the logical coherence of the content and the reconstruction of dynamic trajectories. Therefore, organizing in chronological order is fundamental to ensuring accurate reconstruction of the original motion path after compression. Second, each compression unit contains a simplified segment (the first frame representing the image), a start timestamp, and a dual-state matrix, structurally encapsulating the spatial and motion information of the video segment. Arranging these in chronological order allows the compression algorithm to identify motion transition patterns or static continuation patterns between units, thereby improving the compression ratio. For example, if adjacent units have repeating backgrounds or similar motion trajectories, chronological compression can further remove redundancy through prediction or differential coding. Finally, using a pre-defined compression algorithm instead of frame-by-frame compression unifies the compression strategy, reduces encoding fluctuations, and is particularly suitable for deployment in low-latency, high-throughput video transmission or edge computing scenarios. More importantly, based on the aforementioned dual-state matrix structure compression foundation, the preset algorithm can optimize the encoding strategy for the information structure of different channels in the matrix (static vs. dynamic), making the overall compression more intelligent and efficient.
[0074] Step 306: Simulate decompression of the compressed video, and compare the decompressed restored video with the video to be compressed, so as to optimize the compressed video based on the comparison results and obtain the optimized compressed video.
[0075] In this embodiment, the main steps include: achieving a comprehensive evaluation of the compressed video by introducing a dual evaluation mechanism of overall similarity and local similarity. Overall similarity ensures the consistency of the overall video, while local similarity focuses on the accuracy of detail restoration. Traditional compression schemes are mostly guided by global errors, easily ignoring problems such as local abrupt changes, rapid motion, or blurred details. However, this embodiment can dynamically detect and repair these easily distorted segments.
[0076] Secondly, by utilizing an attention mechanism and a weight normalization strategy, the influence ratios of simplified segments, dual-state matrices, and start timestamps are dynamically adjusted during the compression optimization process. This approach simulates changes in the human visual focus area: when overall distortion is severe, the system tends to adjust the temporal positioning structure (start timestamp); while when only certain local areas are distorted, the system weights the local structure (compression unit) for targeted optimization, thereby avoiding unnecessary full reconstruction and improving computational efficiency. Thirdly, a re-splitting mechanism for compression units is introduced, enhancing the model's fine-grained processing capabilities while ensuring error localization accuracy. This mechanism, based on frame-by-frame error analysis, truncates the error-focused segment by moving it forward one time step, regenerates two new compression units, and restarts the compression and restoration process, thus achieving iterative error correction and preventing errors from propagating and spreading in the compressed sequence. Finally, characterized by the synergistic optimization of "target-driven + local feedback + dynamic weighting," a compression optimization closed loop that is both adaptively adjustable, interpretable, and highly robust is constructed. Compared to traditional fixed-strategy compression schemes, this mechanism demonstrates significant advantages in intelligence, accuracy, and system stability, and is a key supporting design for the advanced development of AI-driven compression systems.
[0077] Furthermore, the process of optimizing the compressed video includes using a pre-trained neural network to restore the video from the decompressed compressed unit sequence; comparing the local similarity and overall similarity between the restored video and the video to be compressed; if the overall similarity is lower than the corresponding preset value 1, then during the compression process, after increasing the attention weight of the starting timestamp by one unit, normalizing the weights of the simplified compressed segment, the weights of the dual-state matrix, and the weights after increasing the attention at the starting timestamp, to obtain the weight coefficients updated after the starting timestamp; (if the overall similarity is lower than the corresponding preset value 1, an error occurs). If the overall temporal sequence is not aligned, it indicates that the overall temporal sequence is not aligned. Due to the distorted temporal video, detailed analysis of local areas is not possible. Therefore, no local adjustments will be made when the overall similarity is lower than the corresponding preset value 1. If the overall similarity is not lower than the corresponding preset value 1, and the local similarity is lower than the corresponding preset value 2, then the corresponding time interval is obtained. In the sequence of compression units, the compression units corresponding to the time interval are marked (there can be one or more). The attention weight of the marked compression units is increased by one unit, and the attention weight of all compression units is normalized to obtain the updated weight coefficient of the compression units.
[0078] After updating the weight coefficients of the compression unit, for each part where the local similarity is lower than the corresponding preset value 2, the consecutive frames are further split. The restoration result corresponding to each marked compression unit is compared frame by frame with the corresponding video to be compressed. The moment before the small similarity frame is extracted as the splitting moment, and the compression unit is split into two compression units, and the compression and decompression process is repeated. The output constraints include that the overall similarity is not lower than the corresponding preset value 1, and the local similarity is not lower than the corresponding preset value 2.
[0079] This embodiment discloses a video compression method based on dynamic perception. By introducing a video frame content analysis mechanism based on a neural network model, it innovatively decomposes video image content into static and dynamic parts, and constructs a dual-state matrix structure that integrates a solid-state matrix and an action vector matrix. This overcomes the problems of traditional compression methods, such as difficulty in distinguishing content regions and uneven compression. A vectorized modeling strategy based on dynamic node trajectories is adopted to segment and compress continuous frames into controllable compression units, greatly reducing coding redundancy. Furthermore, by integrating the compression and simulated restoration processes and introducing an attention mechanism for compression optimization iteration, a dynamic trade-off between compression ratio and image quality is achieved. The method provided in this embodiment has advantages such as clear structure, high compression efficiency, and strong restoration accuracy. It is suitable for low-bitrate high-fidelity video transmission and edge computing scenarios, and has good practicality and promotional value.
[0080] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A video compression method based on dynamic perception, characterized in that, include: Identify the static and dynamic regions of each frame in the video to be compressed, and construct a static matrix corresponding to the video to be compressed based on the pixel coordinates of the static regions; The video to be compressed is segmented based on the pixel content of the dynamic region and the running trajectory of the dynamic sensing points in the dynamic region to obtain multiple consecutive frame segments; Based on the running trajectory of each of the consecutive frame segments, obtain the simplified compressed segment and dynamic matrix corresponding to each of the consecutive frame segments; wherein, for any one of the consecutive frame segments, the first frame image in the consecutive frame segment is taken as the simplified compressed segment corresponding to the consecutive frame segment. The video to be compressed is compressed using the static matrix, multiple dynamic matrices, and multiple simplified compression segments to obtain a compressed video. Specifically, a target matrix is constructed based on the size of the static matrix; a single-state matrix is obtained by filling the same coordinate in the target matrix with the pixel content corresponding to the static pixel coordinates in the static matrix; a dual-state matrix is obtained by filling the same coordinate in the single-state matrix with the vectorized value of the overall running trajectory corresponding to the node pixel coordinates in the dynamic matrix; the start timestamp of each simplified compression segment is obtained, and multiple simplified compression segments are sorted according to the start timestamps to obtain a segment sequence; the segment sequence is compressed using the dual-state matrix and a preset compression algorithm to obtain the compressed video corresponding to the video to be compressed.
2. The video compression method based on dynamic perception according to claim 1, characterized in that, The process of identifying static and dynamic regions in each frame of the video to be compressed, and constructing a static matrix corresponding to the video to be compressed based on the pixel coordinates of the static regions, includes: The acquired video to be compressed is broken down into multiple consecutive images; The images in multiple consecutive frames are sequentially input into a pre-built neural network model, so that the neural network model outputs the static pixel coordinates of static pixels and the dynamic pixel coordinates of dynamic pixels in each frame of the image. For any frame of the image, the pixel content of the static pixel is obtained from the image based on the static pixel coordinates; Construct a static matrix corresponding to the video to be compressed based on the pixel content and the static pixel coordinates.
3. The video compression method based on dynamic perception according to claim 2, characterized in that, The process of segmenting the video to be compressed based on the pixel content of the dynamic region and the trajectory of the dynamic sensing points in the dynamic region to obtain multiple consecutive frame segments includes: Based on the multiple dynamic pixel coordinates corresponding to each frame of the image, obtain the dynamic coordinate set corresponding to each frame of the image; The multiple consecutive images are divided into several static continuous frame segments with consistent dynamic coordinate sets and several initial dynamic continuous frame segments with inconsistent dynamic coordinate sets. For any initial dynamic continuous frame segment, the regions with the same pixel content between adjacent frames are identified as dynamic nodes corresponding to the initial dynamic continuous frame segment; Traverse every two adjacent images in the initial dynamic continuous frame segment, and perform vector encoding on the coordinate position change of the dynamic node between every two adjacent images to obtain the vectorized value of the segment running trajectory corresponding to the dynamic node; The vectorized values of the segment running trajectory of the dynamic node between all adjacent images in the initial dynamic continuous frame segment are accumulated to obtain the overall running trajectory vectorized value of the dynamic node in the initial dynamic continuous frame segment. Based on the vectorized value of the overall running trajectory, the duration corresponding to each frame of the image, and the preset constraints, multiple consecutive images are extracted from the initial dynamic continuous frame segment to obtain the dynamic continuous frame segment. Based on several static continuous frame segments and several dynamic continuous frame segments, multiple continuous frame segments corresponding to the video to be compressed are obtained.
4. The video compression method based on dynamic perception according to claim 3, characterized in that, The step of obtaining the simplified compressed segment and dynamic matrix corresponding to each of the consecutive frame segments based on the running trajectory of each consecutive frame segment includes: Obtain the node pixel coordinates of each dynamic node in each simplified compressed segment, and construct an initial matrix corresponding to each simplified compressed segment based on the multiple node pixel coordinates; The vectorized value of the overall running trajectory of each dynamic node is used as the matrix content of the initial matrix to obtain the dynamic matrix corresponding to each simplified compressed segment.
5. The video compression method based on dynamic perception according to claim 1, characterized in that, After compressing the video to be compressed based on the static matrix, multiple dynamic matrices, and multiple simplified compression segments to obtain the compressed video, the process further includes: The compressed video is restored according to a preset neural network model to obtain the restored video; Obtain the local similarity and overall similarity between the restored video and the compressed video; Based on the local similarity, the overall similarity, and the preset similarity threshold, the time attention weight of the timestamp in the simplified compressed segment, the segment attention weight of the simplified compressed segment, and the matrix attention weight of the dual-state matrix are adjusted respectively. The video to be compressed is recompressed based on the time attention weight, the segment attention weight, the matrix attention weight, and the preset compression algorithm to obtain the updated compressed video.
6. A video compression system based on dynamic perception, characterized in that, It includes a static recognition module, a video segmentation module, a dynamic recognition module, and a video compression module; The static recognition module is used to identify the static and dynamic regions of each frame in the video to be compressed, so as to construct a static matrix corresponding to the video to be compressed based on the pixel coordinates of the static regions. The video segmentation module is used to segment the video to be compressed based on the pixel content of the dynamic region and the running trajectory of the dynamic sensing points in the dynamic region, so as to obtain multiple consecutive frame segments. The dynamic recognition module is used to obtain a simplified compressed segment and a dynamic matrix corresponding to each of the consecutive frame segments based on the running trajectory of each of the consecutive frame segments; wherein, for any consecutive frame segment, the first frame image in the consecutive frame segment is used as the simplified compressed segment corresponding to the consecutive frame segment. The video compression module is used to compress the video to be compressed based on the static matrix, multiple dynamic matrices, and multiple simplified compression segments to obtain a compressed video. Specifically, a target matrix is constructed based on the size of the static matrix; a single-state matrix is obtained by filling the same coordinate in the target matrix with the pixel content corresponding to the static pixel coordinates in the static matrix; a dual-state matrix is obtained by filling the same coordinate in the single-state matrix with the vectorized value of the overall running trajectory corresponding to the node pixel coordinates in the dynamic matrix; the starting timestamp of each simplified compression segment is obtained, and multiple simplified compression segments are sorted according to the starting timestamps to obtain a segment sequence; the segment sequence is compressed according to the dual-state matrix and a preset compression algorithm to obtain the compressed video corresponding to the video to be compressed.
7. A computer device, characterized in that, The device includes a memory and a processor, wherein the memory stores a computer program; wherein the processor executes the computer program to implement a video compression method based on dynamic perception as described in any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements a video compression method based on dynamic perception as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Video compression method, system and device and medium
CN115776568A
Three-dimensional reconstruction method, semantic recognition method and system of multi-view 2D image
CN120088407A