Video compression method, video decompression method, intelligent terminal and storage medium

By cropping, pixel statistics and multifunction fitting of video independent picture frames, image fitting functions are generated, which solves the problem of difficulty in realizing lossless video compression in the prior art, and achieves efficient lossless video compression.

CN119676457AActive Publication Date: 2025-03-21TIANJIN TIANHE DIGITAL IND TECHNOLOGY CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411772907.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-03-21
Estimated Expiration
2044-12-04

AI Technical Summary

Technical Problem

The existing video compression technology mainly focuses on lossy compression, with fewer means and lower overall compression rate, making it difficult to meet various scenarios of lossless video compression.

Method used

Image fitting functions are generated to achieve lossless compression by cropping, pixel statistics, pattern recombination function construction, pixel exchange and multifunction fitting of independent picture frames to be compressed.

Benefits of technology

Lossless video compression is realized, data compression efficiency is improved, and compression needs in various scenarios are met.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119676457A_ABST
    Figure CN119676457A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of video processing, and particularly relates to a video compression method, a video decompression method, an intelligent terminal and a storage medium, and the method comprises the steps: obtaining a to-be-compressed video, selecting two groups of independent picture frames for cutting, and obtaining two groups of cut image blocks; constructing two groups of pattern recombination functions, and generating recombination cardinal numbers according to the two groups of pattern recombination functions; based on the first recombination cardinal number and the second recombination cardinal number, carrying out pixel exchange on each group of independent picture frames, generating a pixel exchange image, calculating the pixel order degree of the pixel exchange image, selecting a group of exchange sorting images, carrying out pixel partitioning on the exchange sorting images, and carrying out multi-function fitting on the partitioned pixels; and an image fitting function is obtained and stored. According to the method, the pixels are partitioned and fitted to obtain the image fitting function, and through multi-function fitting, the fitting precision of the pixel coordinates is greatly improved, lossless compression is realized, and the data compression efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of video processing, and in particular relates to a video compression method, a video decompression method, an intelligent terminal and a storage medium. Background Art

[0002] Video compression is a technology that reduces the size of video files through algorithms, aiming to maintain visual quality while reducing storage space requirements and transmission bandwidth. It removes unnecessary information or encodes information in a more efficient way based on the redundancy of video data and the characteristics of the human visual system. Common video compression standards include MPEG-4, H.264 / AVC, H.265 / HEVC, etc. They effectively reduce the amount of original video data through intra-frame compression and inter-frame compression technology, allowing high-definition and even ultra-high-definition videos to be played smoothly on the Internet, and can be easily stored and shared on platforms with limited storage capacity such as mobile devices.

[0003] Existing video compression mainly uses lossy compression as the mainstream. There are fewer means of lossy video compression and the overall compression rate is also low, which makes it difficult to meet various scenarios of lossless video compression. Summary of the invention

[0004] The purpose of the present invention is to provide a video compression method, aiming to solve the problem that there are few means for lossy video compression, the overall compression rate is also low, and it is difficult to meet various scenarios of lossless video compression.

[0005] The present invention is implemented in this way: a video compression method, the method comprising:

[0006] Obtain a video to be compressed, split the video to be compressed into independent picture frames, number each independent picture frame, randomly select two groups of independent picture frames for cropping, and obtain two groups of cropped image blocks;

[0007] Perform pixel statistics on the cropped image block, construct two sets of pattern recombination functions based on the statistical results, and generate recombination bases according to the two sets of pattern recombination functions, wherein the recombination bases include a first recombination base and a second recombination base;

[0008] Perform pixel swapping on each group of independent picture frames based on the first reorganization base and the second reorganization base to generate a pixel swapped image, and calculate the pixel order of the pixel swapped image;

[0009] A set of exchange sorted images is selected from the pixel exchange image based on the pixel order, the exchange sorted image is pixel partitioned, multiple functions are fitted to the partitioned pixels, and the image fitting function is obtained and stored.

[0010] Preferably, the steps of performing pixel statistics on the cropped image blocks, constructing two sets of pattern recombination functions based on the statistical results, and generating recombination bases according to the two sets of pattern recombination functions specifically include:

[0011] Numbering multiple cropped image blocks from the same independent picture frame, and counting the sum of the pixel grayscale values ​​contained in each cropped image block;

[0012] The image block coordinates are constructed by taking the number of the cut image block as the horizontal coordinate and the sum of the corresponding pixel grayscale values ​​as the vertical coordinate, and the image block coordinates are fitted to obtain the pattern reconstruction function;

[0013] A preset natural number sequence is introduced into two groups of pattern recombination functions to generate a first recombination base and a second recombination base, and there is a matching relationship between the first recombination base and the second recombination base.

[0014] Preferably, the step of performing pixel swapping on each group of independent picture frames based on the first reorganization base and the second reorganization base to generate a pixel swapped image and calculating the pixel order of the pixel swapped image specifically includes:

[0015] Linearly arranging pixels in the independent picture frame, and exchanging positions of pixels with odd numbers in the independent picture frame according to the first reorganization base;

[0016] The positions of even-numbered pixels in the independent picture frames are exchanged according to the second reorganization base, and when a preset stop condition is met, it is considered that one round of exchange is completed, and multiple rounds of pixel exchange are repeated;

[0017] After each exchange is completed, a pixel exchange image is obtained, a pixel color vector is constructed, and the proportion of pixels whose cosine similarity with adjacent pixels is greater than a preset value is counted to obtain the pixel order.

[0018] Preferably, the step of selecting a group of exchange sorted images from the pixel exchange images based on the pixel order, performing pixel partitioning on the exchange sorted images, performing multiple function fitting on the partitioned pixels, obtaining the image fitting function and storing it specifically includes:

[0019] Selecting a group of pixel exchange images with the highest pixel order as exchange sorting images, linearly arranging pixels in the exchange sorting images, and cutting them into a plurality of pixel partitions, wherein the pixel partitions contain the same number of pixels;

[0020] Extract pixel information in each pixel partition, construct pixel information coordinates, perform a first function fitting based on the pixel information coordinates, and obtain a first set of image fitting functions, where the horizontal coordinate of the pixel information coordinates is the number of the pixel in the pixel partition, and the vertical coordinate is the composite value of the color value of the pixel;

[0021] The fitting difference coordinates are constructed according to the first set of image fitting functions and pixel information coordinates, and the quadratic function fitting is performed again, and this is repeated multiple times until the accuracy of the obtained image fitting function reaches a preset value and is stored.

[0022] Preferably, when the number of repetitions of function fitting reaches a preset number, all image fitting functions corresponding to the current pixel partition are discarded, and the pixel information coordinates in the pixel partition are directly stored.

[0023] Preferably, the number of cropped image blocks corresponding to the independent picture frames is not less than five groups.

[0024] Preferably, when storing the image fitting function, only the type of the image fitting function and the value of the constant are stored.

[0025] Another object of the present invention is to provide a video decompression method, which is used in the video compression method as described above, and the video decompression method comprises:

[0026] Retrieve all image fitting functions corresponding to each independent picture frame, divide the image fitting functions according to pixel partitions, generate a function independent variable sequence according to the number of pixel partitions, import the function independent variable sequence into all image fitting functions corresponding to the same pixel partition one by one, synthesize the pixel information of each pixel in the pixel partition based on the output value of each image fitting function, determine the color value of each pixel in the pixel partition accordingly, repeat this process to obtain the content of the complete independent picture frame, and synthesize the original video to be compressed according to the content of the independent picture frame.

[0027] Another object of the present invention is to provide a video decompression intelligent terminal, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the video compression method as described above.

[0028] Another object of the present invention is to provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the processor executes the steps of the video compression method as described above.

[0029] The present invention provides a video compression method, which rearranges pixels in independent picture frames to select an arrangement mode with more uniform pixel distribution, and partitions and fits the pixels accordingly to obtain an image fitting function. By performing multiple function fitting, the fitting accuracy of pixel coordinates is greatly improved, lossless compression is achieved, and data compression efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1A flowchart of a video compression method provided by an embodiment of the present invention;

[0031] Figure 2 A flowchart of the steps of performing pixel statistics on a cropped image block, constructing two sets of pattern recombination functions based on the statistical results, and generating a recombination base according to the two sets of pattern recombination functions provided by an embodiment of the present invention;

[0032] Figure 3 A flowchart of the steps of performing pixel swapping on each group of independent picture frames based on a first reorganization base and a second reorganization base, generating a pixel swapped image, and calculating the pixel order of the pixel swapped image provided by an embodiment of the present invention;

[0033] Figure 4 A flowchart of the steps of selecting a group of exchange sorted images from pixel exchange images based on pixel order, partitioning the exchange sorted images, fitting multiple functions to the partitioned pixels, obtaining image fitting functions and storing them is provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0035] like Figure 1 FIG. 1 is a flowchart of a video compression method provided by an embodiment of the present invention, wherein the method comprises:

[0036] S100, obtaining a video to be compressed, splitting the video to be compressed into independent picture frames, numbering each independent picture frame, and randomly selecting two groups of independent picture frames for cropping to obtain two groups of cropped image blocks.

[0037] In this step, the video to be compressed is obtained. The video to be compressed actually contains multiple independent picture frames. The video is essentially a continuously played picture. Therefore, the video to be compressed can be disassembled to extract all the independent picture frames contained therein, and the independent picture frames can be numbered. When numbering, they are numbered continuously in the order of video playback. Two groups of independent picture frames are selected from all the independent picture frames through a random algorithm, and each selected independent picture frame is divided into multiple cropped image blocks. The cropped image blocks are gray-processed and converted into gray-scale images. Then, each pixel in the cropped image block can be represented by a gray-scale value.

[0038] S200, performing pixel statistics on the cropped image block, constructing two sets of pattern recombination functions based on the statistical results, and generating recombination bases according to the two sets of pattern recombination functions, the recombination bases including a first recombination base and a second recombination base.

[0039] In this step, pixel statistics are performed on the cropped image blocks. When the cropped image blocks are generated, the cropped image blocks are numbered, the grayscale values ​​of the pixels contained in each cropped image block are counted, the sum of the grayscale values ​​in each cropped image block is counted, the image block coordinates are constructed, and the image block coordinates are fitted according to a preset function type to obtain two groups of pattern recombination functions. The two groups of selected independent picture frames correspond to the two groups of image recombination functions. When processing all independent picture frames, each independent picture frame is called frame by frame according to the number of the independent picture frame, and a preset natural number sequence is introduced into the pattern recombination function, so as to generate a recombination cardinality through the pattern recombination function. The recombination cardinality is generated in pairs, and the recombination cardinality generated by the two groups of pattern recombination functions are respectively a first recombination cardinality and a second recombination cardinality.

[0040] S300, performing pixel swapping on each group of independent picture frames based on a first reorganization basis and a second reorganization basis to generate a pixel swapped image, and calculating a pixel order of the pixel swapped image.

[0041] In this step, pixels of each group of independent picture frames are exchanged based on the first recombination cardinality and the second recombination cardinality. The number of the first recombination cardinality and the second recombination cardinality is plural, so each time a group of the first recombination cardinality and the second recombination cardinality is extracted, and according to the preset pixel exchange rule, the pixels in the independent picture frames are exchanged according to the first recombination cardinality and the second recombination cardinality, so as to randomly disrupt the pixel arrangement order in the independent picture frames to obtain a large number of pixel exchanged images. In order to determine the arrangement order of pixels in each pixel exchanged image after the disruption, the pixel order degree of the pixel exchanged image is calculated. The pixel order degree can be obtained by calculating the variance. The higher the pixel order degree, the more orderly the pixel arrangement in the current pixel exchanged image is, and the easier it is to fit.

[0042] S400, selecting a group of exchange order images from the pixel exchange image based on the pixel order, performing pixel partitioning on the exchange order image, performing multiple function fitting on the partitioned pixels, obtaining an image fitting function and storing it.

[0043] In this step, a group of exchange sorted images is selected from the pixel exchange images based on the pixel order. When making the selection, the pixel exchange images are sorted according to the pixel order, and a group of pixel exchange images with the highest pixel order is selected and defined as the exchange sorted images. The above exchange sorted images represent the most orderly group of images among all pixel exchange images. In order to improve the fitting accuracy, the exchange sorted images are pixel partitioned, such as dividing 1000 pixels into one pixel partition. Since the pixels have been exchanged, the pixel arrangement order in the pixel partition is more orderly than the original independent picture frame. Then, pixel information coordinates are constructed according to the pixel information, and the pixel information coordinates are fitted to obtain the image fitting function. However, due to the large number of pixel information coordinates, it is difficult to achieve the expected accuracy by performing a single fitting. Therefore, multiple fittings are performed, and the image fitting function obtained by multiple fittings is used to record the color information of all pixels in the pixel partition, so as to achieve the purpose of greatly reducing the storage data and improve the compression rate of lossless compression.

[0044] like Figure 2 As shown, as a preferred embodiment of the present invention, the steps of performing pixel statistics on the cropped image block, constructing two sets of pattern recombination functions based on the statistical results, and generating recombination bases according to the two sets of pattern recombination functions specifically include.

[0045] S201 , numbering a plurality of cropped image blocks from the same independent picture frame, and counting the sum of the pixel grayscale values ​​contained in each cropped image block.

[0046] In this step, multiple cropped image blocks from the same independent picture frame are numbered, and the number of cropped image blocks corresponding to the independent picture frame is not less than five groups. When numbering, a continuous numbering method is adopted. For example, five groups of cropped image blocks are obtained, which are numbered 1, 2, 3, 4 and 5 respectively. The grayscale value of each pixel in each cropped image block is counted, and the sum of the grayscale values ​​is calculated. For example, the sum of the grayscale values ​​of the pixels in cropped image block No. 1 is K1.

[0047] S202 , using the number of the cut image block as the horizontal coordinate and the sum of the corresponding pixel grayscale values ​​as the vertical coordinate, constructing the image block coordinates, and fitting the image block coordinates to obtain a pattern reconstruction function.

[0048] In this step, the image block coordinates are constructed. The horizontal coordinate of the image block coordinates is the number of the cropped image block, and the sum of the corresponding pixel grayscale values ​​is the vertical coordinate. For example, the image block coordinates are (1, K1), (2, K2), (3, K3), (4, K4) and (5, K5). The image block coordinates are imported into the function simulation tool and fitted to obtain the corresponding pattern recombination function, thereby obtaining two sets of pattern recombination functions.

[0049] S203, importing a preset natural number sequence into two groups of pattern recombination functions to generate a first recombination base and a second recombination base, wherein the first recombination base and the second recombination base have a matching relationship.

[0050] In this step, a preset natural number sequence is imported into two sets of pattern recombination functions. The number of natural numbers contained in the preset natural number sequence is set according to the compression accuracy. If a higher compression accuracy is desired, the more natural numbers in the preset natural number sequence, and vice versa. Each time a natural number is imported, it is simultaneously imported into the two sets of pattern recombination functions to obtain multiple first recombination bases and second recombination bases. The first recombination bases and the second recombination bases generated based on the same set of natural numbers have a pairing relationship.

[0051] like Figure 3 As shown, as a preferred embodiment of the present invention, the steps of performing pixel swapping on each group of independent picture frames based on the first reorganization base and the second reorganization base, generating a pixel swapped image, and calculating the pixel order of the pixel swapped image specifically include:

[0052] S301 , linearly arranging pixels in an independent picture frame, and exchanging positions of odd-numbered pixels in the independent picture frame according to a first reorganization base.

[0053] S302, swapping the positions of even-numbered pixels in the independent picture frames according to the second reorganization base, and when a preset stop condition is met, it is considered that one round of swapping is completed, and multiple rounds of pixel swapping are repeated.

[0054] In this step, the pixels in the independent picture frame are arranged linearly. Specifically, the pixels can be extracted from the independent picture frame in order from left to right and from top to bottom, and then sorted according to the extraction order, and the first reorganization base is called to select the pixels in the linear arrangement in order of 1, 2, 3, 4...2n. When the number of pixels is an odd number, the last pixel is stored separately. The first reorganization base is M1, and the second reorganization base is M2. Then the 2n-1th pixel is swapped with the 2n-1+M1th pixel, and the 2nth pixel is swapped with the 2n+M2th pixel, that is, traversing in the order of numbering. For pixels arranged linearly, when the current pixel number is an odd number, execute "exchange the position of the 2n-1th pixel with the 2n-1+M1th pixel", and when the current pixel number is an even number, execute "exchange the position of the 2nth pixel with the 2n+M2th pixel". If 2n-1+M1 or 2n+M2 is greater than 2n, the current round of pixel exchange is completed and repeated for a preset number of times. For example, if this process is repeated 10 times, the pixel exchange process based on the current first recombination cardinality and second recombination cardinality is completed, and a set of pixel exchange images is obtained. The next set of first recombination cardinality and second recombination cardinality is called to obtain a preset number of pixel exchange images.

[0055] S303, after each exchange is completed, a pixel exchange image is obtained, a pixel color vector is constructed, and the proportion of pixels whose cosine similarity with adjacent pixels is greater than a preset value is counted to obtain a pixel order.

[0056] In this step, a pixel exchange image is obtained after each exchange is completed, and the color value of the pixel is counted. The pixel is represented by RGB color, which includes R channel color value, G channel color value and B channel color value. For example, the R channel color value, G channel color value and B channel color value are 147, 232 and 188 respectively, then the pixel color vector is (147, 232, 188), and the cosine similarity between each pixel color vector and the adjacent pixel color vector is calculated. The proportion of pixels whose cosine similarity with adjacent pixels is greater than a preset value (the ratio of the number of pixels whose cosine similarity with adjacent pixels is greater than a preset value to the total number of pixels) is counted, and this proportion is the pixel order.

[0057] like Figure 4 As shown, as a preferred embodiment of the present invention, the steps of selecting a group of exchange sorted images from the pixel exchange images based on the pixel order, performing pixel partitioning on the exchange sorted images, performing multiple function fitting on the partitioned pixels, obtaining the image fitting function and storing it specifically include:

[0058] S401, selecting a group of pixel exchange images with the highest pixel order as exchange sorting images, linearly arranging pixels in the exchange sorting images, and cutting them into a plurality of pixel partitions, wherein the pixel partitions contain the same number of pixels.

[0059] In this step, a group of pixel exchange images with the highest pixel order is selected as the exchange sorting image, and the natural numbers corresponding to the corresponding first reorganization cardinality and the second reorganization cardinality are recorded and stored. Similarly, the pixels in the image to be exchanged and sorted are linearly arranged and divided into multiple pixel partitions. The number of pixels in the pixel partitions is the same, such as containing 1000 pixels.

[0060] S402, extracting pixel information in each pixel partition, constructing pixel information coordinates, performing a first function fitting based on the pixel information coordinates, and obtaining a first set of image fitting functions, wherein the horizontal coordinate of the pixel information coordinates is the number of the pixel in the pixel partition, and the vertical coordinate is the composite value of the color value of the pixel.

[0061] In this step, the pixel information in each pixel partition is extracted to construct the pixel information coordinates. The horizontal coordinate in the pixel information coordinates is the pixel number N, and the vertical coordinate is the splicing value of the color values ​​of the three channels of the pixel. For example, the R channel color value, the G channel color value and the B channel color value are 147, 232 and 188 respectively, then the pixel information coordinates are (N, 147232188). The first function fitting is performed based on the pixel information coordinates. A polynomial function is used for fitting to obtain the first set of image fitting functions.

[0062] S403, constructing fitting difference coordinates according to the first set of image fitting functions and pixel information coordinates, performing quadratic function fitting again, repeating multiple times until the obtained image fitting function accuracy reaches a preset value, and storing it.

[0063] In this step, fitting difference coordinates are constructed according to the first set of image fitting functions and pixel information coordinates. After the first function fitting, the fitting accuracy is insufficient. When the corresponding curve is drawn in the two-dimensional coordinate system according to the first set of image fitting functions, there will be a large number of pixel information coordinates whose distance from the curve is greater than the preset value. At this time, the difference between each pixel information coordinate and the curve corresponding to the first set of image fitting functions on the ordinate is calculated to construct the fitting difference coordinates. The abscissa of the fitting difference coordinates is still the pixel number, and the ordinate is the difference between the pixel information coordinate and the curve corresponding to the first set of image fitting functions on the ordinate, which is expressed as (N, D). All the fitting difference coordinates are continued to be fitted to obtain the second set of image fitting functions. Since the fitting difference coordinates record the distance relationship between the pixel information coordinates and the first set of image fitting functions, the overall volatility is greatly reduced, and the fitting accuracy is greatly improved compared with the first set of image fitting functions. Repeating this process will obtain multiple sets of image fitting functions. The i-th set of image fitting functions is recorded as f i (x), the above image fitting functions are superimposed to obtain the final image fitting function F(x), then F(x) = f1(x) + f2(x) + f3(x) + ... f i (x), then the color value information of all pixels in the current pixel partition can be represented by the final image fitting function F(x). Accordingly, an independent picture frame can be represented by multiple sets of image fitting functions F(x). The image fitting function F(x) is stored, and only the type of image fitting function and the value of the constant are stored. When the function fitting is repeated for a preset number of times and the fitting accuracy still cannot meet the requirements, all image fitting functions corresponding to the current pixel partition are discarded, and the pixel information coordinates in the pixel partition are directly stored.

[0064] The present invention also provides a video decompression method, which is used in the above-mentioned video compression method, and the video decompression method comprises:

[0065] Retrieve all image fitting functions corresponding to each independent picture frame, divide the image fitting functions according to pixel partitions, generate a function independent variable sequence according to the number of pixel partitions, import the function independent variable sequence into all image fitting functions corresponding to the same pixel partition one by one, synthesize the pixel information of each pixel in the pixel partition based on the output value of each image fitting function, determine the color value of each pixel in the pixel partition accordingly, repeat this process to obtain the content of the complete independent picture frame, and synthesize the original video to be compressed according to the content of the independent picture frame.

[0066] In this method, all image fitting functions corresponding to each independent picture frame are called (after superposition, it is the final image fitting function F(x)), then the number of pixels contained in the pixel partition is the number of natural numbers in the function independent variable sequence, which is imported into the image fitting function F(x) to obtain the calculated value, and the calculated value is rounded to obtain the pixel information coordinates of the current pixel, and the vertical coordinates of the pixel information coordinates are disassembled to obtain the three-channel color value of the pixel, based on which the content of the entire independent picture frame can be restored.

[0067] In one embodiment, a video decompression intelligent terminal is provided, the video decompression intelligent terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the following steps when executing the computer program:

[0068] Obtain a video to be compressed, split the video to be compressed into independent picture frames, number each independent picture frame, randomly select two groups of independent picture frames for cropping, and obtain two groups of cropped image blocks;

[0069] Perform pixel statistics on the cropped image block, construct two sets of pattern recombination functions based on the statistical results, and generate recombination bases according to the two sets of pattern recombination functions, wherein the recombination bases include a first recombination base and a second recombination base;

[0070] Perform pixel swapping on each group of independent picture frames based on the first reorganization base and the second reorganization base to generate a pixel swapped image, and calculate the pixel order of the pixel swapped image;

[0071] A set of exchange sorted images is selected from the pixel exchange image based on the pixel order, the exchange sorted image is pixel partitioned, multiple functions are fitted to the partitioned pixels, and the image fitting function is obtained and stored.

[0072] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the processor performs the following steps:

[0073] Obtain a video to be compressed, split the video to be compressed into independent picture frames, number each independent picture frame, randomly select two groups of independent picture frames for cropping, and obtain two groups of cropped image blocks;

[0074] Perform pixel statistics on the cropped image block, construct two sets of pattern recombination functions based on the statistical results, and generate recombination bases according to the two sets of pattern recombination functions, wherein the recombination bases include a first recombination base and a second recombination base;

[0075] Perform pixel swapping on each group of independent picture frames based on the first reorganization base and the second reorganization base to generate a pixel swapped image, and calculate the pixel order of the pixel swapped image;

[0076] A set of exchange sorted images is selected from the pixel exchange image based on the pixel order, the exchange sorted image is pixel partitioned, multiple functions are fitted to the partitioned pixels, and the image fitting function is obtained and stored.

[0077] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A video compression method, characterized in that: The method comprises: Obtain a video to be compressed, split the video to be compressed into independent picture frames, number each independent picture frame, randomly select two groups of independent picture frames for cropping, and obtain two groups of cropped image blocks; Perform pixel statistics on the cropped image block, construct two sets of pattern recombination functions based on the statistical results, and generate recombination bases according to the two sets of pattern recombination functions, where the recombination bases include a first recombination base and a second recombination base; Perform pixel swapping on each group of independent picture frames based on the first reorganization base and the second reorganization base to generate a pixel swapped image, and calculate the pixel order of the pixel swapped image; A set of exchange sorted images is selected from the pixel exchange image based on the pixel order, the exchange sorted images are pixel partitioned, multiple functions are fitted to the partitioned pixels, and the image fitting function is obtained and stored.

2. The video compression method according to claim 1, characterized in that: The steps of performing pixel statistics on the cropped image blocks, constructing two sets of pattern recombination functions based on the statistical results, and generating recombination bases according to the two sets of pattern recombination functions specifically include: Numbering multiple cropped image blocks from the same independent picture frame, and counting the sum of the pixel grayscale values ​​contained in each cropped image block; The image block coordinates are constructed by taking the number of the cut image block as the horizontal coordinate and the sum of the corresponding pixel grayscale values ​​as the vertical coordinate, and the image block coordinates are fitted to obtain the pattern reconstruction function; A preset natural number sequence is introduced into two groups of pattern recombination functions to generate a first recombination base and a second recombination base, and there is a matching relationship between the first recombination base and the second recombination base.

3. The video compression method according to claim 1, characterized in that: The step of performing pixel swapping on each group of independent picture frames based on the first reorganization base and the second reorganization base to generate a pixel swapped image and calculating the pixel order of the pixel swapped image specifically includes: Linearly arranging pixels in the independent picture frame, and exchanging positions of odd-numbered pixels in the independent picture frame according to a first reorganization base; The positions of even-numbered pixels in the independent picture frames are exchanged according to the second reorganization base number. When a preset stop condition is met, it is considered that one round of exchange is completed, and multiple rounds of pixel exchange are repeated; After each exchange is completed, a pixel exchange image is obtained, a pixel color vector is constructed, and the proportion of pixels whose cosine similarity with adjacent pixels is greater than a preset value is counted to obtain the pixel order.

4. The video compression method according to claim 1, characterized in that: The steps of selecting a group of exchange sorted images from the pixel exchange images based on the pixel order, performing pixel partitioning on the exchange sorted images, performing multiple function fitting on the partitioned pixels, obtaining the image fitting function and storing it specifically include: Selecting a group of pixel exchange images with the highest pixel order as exchange sorting images, linearly arranging pixels in the exchange sorting images, and cutting them into a plurality of pixel partitions, wherein the pixel partitions contain the same number of pixels; Extract pixel information in each pixel partition, construct pixel information coordinates, perform a first function fitting based on the pixel information coordinates, and obtain a first set of image fitting functions, where the horizontal coordinate of the pixel information coordinates is the number of the pixel in the pixel partition, and the vertical coordinate is the composite value of the color value of the pixel; The fitting difference coordinates are constructed according to the first set of image fitting functions and pixel information coordinates, and the quadratic function fitting is performed again, and this is repeated multiple times until the accuracy of the obtained image fitting function reaches a preset value and is stored.

5. The video compression method according to claim 4, characterized in that: When the number of repetitions of function fitting reaches a preset number, all image fitting functions corresponding to the current pixel partition are discarded, and the pixel information coordinates in the pixel partition are directly stored.

6. The video compression method according to claim 1, characterized in that: The number of cropped image blocks corresponding to the independent picture frames is not less than five groups.

7. The video compression method according to claim 4, characterized in that: When storing the image fitting function, only the type of the image fitting function and the value of the constant are stored.

8. A video decompression method, characterized in that: Used in the video compression method according to any one of claims 1 to 7, the video decompression method comprises: Retrieve all image fitting functions corresponding to each independent picture frame, divide the image fitting functions according to pixel partitions, generate a function independent variable sequence according to the number of pixel partitions, import the function independent variable sequence into all image fitting functions corresponding to the same pixel partition one by one, synthesize the pixel information of each pixel in the pixel partition based on the output value of each image fitting function, determine the color value of each pixel in the pixel partition accordingly, repeat this process to obtain the content of the complete independent picture frame, and synthesize the original video to be compressed according to the content of the independent picture frame.

9. A video decompression intelligent terminal, characterized in that: The invention comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the video compression method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the steps of the video compression method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Methods and devices for compressing and decompressing multiple color images based on optical method

    CN107343200A

  • Image group transmission method, device, equipment and system based on data block recombination

    CN112822516A

  • Face forgery detection method based on local region regularization

    CN115546873A

  • JPEG color image encryption method based on chaos theory

    CN116405702A

  • Image processing method and system for video communication

    CN116980534A