A video compression method, a video decompression method, a smart terminal, and a storage medium

By cropping, pixel statistics and multifunction fitting of independent picture frames of video, 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.

CN119676457BActive Publication Date: 2025-06-13TIANJIN TIANHE DIGITAL IND TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411772907.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-06-13
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 CN119676457B_ABST
    Figure CN119676457B_ABST
Patent Text Reader

Abstract

The present invention is applicable to the field of video processing technologies, and particularly relates to a video compression method, a video decompression method, an intelligent terminal, and a storage medium. The method includes: obtaining a video to be compressed, selecting two sets of independent picture frames for cropping to obtain two sets of cropped image blocks; constructing two sets of pattern recombination functions, and generating recombination bases according to the two sets of pattern recombination functions; performing pixel exchange on each set of independent picture frames based on a first recombination base and a second recombination base to generate pixel exchange images, calculating the pixel order degree of the pixel exchange images, selecting a set of exchanged and sorted images, performing pixel partitioning on the exchanged and sorted images, and performing multiple function fitting on the partitioned pixels to obtain an image fitting function and storing it. The present invention performs pixel partitioning and fitting 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 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 particularly 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 reduce storage space requirements and transmission bandwidth while maintaining visual quality. It is based on the redundancy of video data and the characteristics of the human visual system, removing unnecessary information or encoding information in a more efficient way. 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 techniques, enabling high-definition and even ultra-high-definition videos to be played smoothly on the Internet and easily stored and shared on platforms with limited storage capacities such as mobile devices.

[0003] Existing video compression mainly uses lossy compression as the mainstream. There are few means of video lossy compression, and the overall compression ratio is also low, making it difficult to meet the requirements of various scenarios for video lossless compression. Summary of the Invention

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

[0005] The present invention is implemented as follows. A video compression method, the method includes:

[0006] Obtain the 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 blocks, construct two groups of pattern recombination functions based on the statistical results, and generate recombination bases according to the two groups of pattern recombination functions. 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 recombination base and the second recombination base to generate a pixel-swapped image, and calculate the pixel order degree of the pixel-swapped image;

[0009] Select a group of swapped and sorted images from the pixel-swapped image based on the pixel order degree, perform pixel partitioning on the swapped and sorted images, perform multiple function fitting on the partitioned pixels, obtain an image fitting function, and store it.

[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] Number multiple cropped image blocks from the same independent frame, and count the sum of pixel gray values included in each cropped image block;

[0012] Using the numbers of the cropped image blocks as the abscissa and the corresponding sums of pixel gray values as the ordinate, construct image block coordinates, and perform fitting on the image block coordinates to obtain a pattern recombination function;

[0013] Import a preset natural number sequence into the two sets 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 steps of performing pixel exchange on each set of independent frames based on the first recombination base and the second recombination base to generate a pixel exchange image and calculating the pixel order degree of the pixel exchange image specifically include:

[0015] Linearly arrange the pixels in the independent frame, and perform position exchange on the pixels with odd numbers in the independent frame according to the first recombination base;

[0016] Perform position exchange on the pixels with even numbers in the independent frame according to the second recombination base. When the preset stop condition is met, it is regarded as one round of exchange 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 the number of pixels whose cosine similarity with adjacent pixels is greater than the preset value is counted to obtain the pixel order degree.

[0018] Preferably, the steps of selecting a set of exchange sorting images from the pixel exchange images based on the pixel order degree, performing pixel partitioning on the exchange sorting images, performing multiple function fitting on the partitioned pixels, obtaining an image fitting function and storing it specifically include:

[0019] Select a set of pixel exchange images with the highest pixel order degree as the exchange sorting images, linearly arrange the pixels in the exchange sorting images, and intercept them into multiple pixel partitions, and the pixel partitions contain the same number of pixels;

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

[0021] Construct the fitting difference coordinates based on the first group of image fitting functions and pixel information coordinates, perform quadratic function fitting again, and repeat multiple times until the accuracy of the obtained image fitting function reaches the preset value, and then store it.

[0022] Preferably, when the number of times of repeating function fitting reaches the preset number of times, discard all the image fitting functions corresponding to the current pixel partition, and directly store the pixel information coordinates within the pixel partition.

[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 store the type of the image fitting function and the numerical value of the constant.

[0025] Another object of the present invention is to provide a video decompression method for the video compression method as described above. The video decompression method includes:

[0026] Retrieve all the image fitting functions corresponding to each independent picture frame, divide the image fitting functions according to the pixel partitions, generate a function independent variable sequence according to the number of pixel partitions, import the function independent variable sequence into all the image fitting functions corresponding to the same pixel partition one by one, synthesize the pixel information of each pixel within the pixel partition based on the output values of each image fitting function, determine the color values of each pixel within 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, including a memory and a processor. A computer program is stored in the memory. 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. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the processor executes the steps of the video compression method as described above.

[0029] A video compression method provided by the present invention re-arranges the pixels in the independent picture frame to select a more uniform arrangement of pixel distribution, and accordingly partitions and fits the pixels to obtain an image fitting function. By performing multiple function fittings, the fitting accuracy of pixel coordinates is greatly improved, lossless compression is achieved, and the data compression efficiency is improved. Description of the Drawings

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

[0031] Figure 2 Flowchart of 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 provided by an embodiment of the present invention;

[0032] Figure 3 Flowchart of the steps of performing pixel exchange on each set of independent video frames based on the first recombination base and the second recombination base to generate a pixel-exchanged image, and calculating the pixel order degree of the pixel-exchanged image provided by an embodiment of the present invention;

[0033] Figure 4 Flowchart of the steps of selecting a set of exchanged and sorted images from the pixel-exchanged image based on the pixel order degree, performing pixel partitioning on the exchanged and sorted images, performing multi-function fitting on the partitioned pixels, obtaining an image fitting function, and storing it provided by an embodiment of the present invention. Detailed implementation manners

[0034] In order to make the objectives, technical solutions, and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to 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 used to limit the present invention.

[0035] As Figure 1 shown, it is a flowchart of a video compression method provided by an embodiment of the present invention, and the method includes:

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

[0037] In this step, obtain the video to be compressed. The video to be compressed actually contains multiple independent video frames. The video is essentially a continuously played picture. Therefore, the video to be compressed can be disassembled to extract all the independent video frames it contains, and the independent video frames are numbered. When numbering, continuous numbering is performed in the order of video playback. Two sets of independent video frames are randomly selected from all the independent video frames. Each selected independent video frame is divided into multiple cropped image blocks, and the cropped image blocks are subjected to grayscale processing to convert them into grayscale images. Then each pixel in the cropped image block can be characterized by a grayscale value.

[0038] S200, 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. The recombination bases include 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, numbering processing is performed on the cropped image blocks. The gray values of the pixels included in each cropped image block are statistically analyzed, the sum of the gray values in each cropped image block is statistically analyzed, the image block coordinates are constructed, and the image block coordinates are fitted according to a preset function type to obtain two sets of pattern recombination functions. The two selected independent picture frames correspond to the two sets of image recombination functions. When processing all the independent picture frames, each independent picture frame is retrieved frame by frame according to the number of the independent picture frame, and a preset natural number sequence is imported into the pattern recombination function, so as to generate recombination bases through the pattern recombination function. The recombination bases are generated in pairs. The recombination bases generated by the two sets of pattern recombination functions are the first recombination base and the second recombination base respectively.

[0040] S300, perform pixel exchange on each set of independent picture frames based on the first recombination base and the second recombination base to generate a pixel-exchanged image, and calculate the pixel order degree of the pixel-exchanged image.

[0041] In this step, pixel exchange is performed on each set of independent picture frames based on the first recombination base and the second recombination base. The numbers of the first recombination base and the second recombination base are both multiple. Therefore, each time a set of the first recombination base and the second recombination base is extracted, and according to the preset pixel exchange rule, the pixels in the independent picture frame are exchanged based on the first recombination base and the second recombination base, so as to randomly shuffle the pixel arrangement order in the independent picture frame to obtain a large number of pixel-exchanged images. In order to determine the arrangement order of the pixels in each pixel-exchanged image after shuffling, 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, and the easier it is to fit.

[0042] S400, select a set of exchanged and sorted images from the pixel-exchanged images based on the pixel order degree, perform pixel partitioning on the exchanged and sorted images, perform multiple function fitting on the partitioned pixels, obtain an image fitting function and store it.

[0043] In this step, a set of swapped sorting images is selected from the pixel-swapped image based on the pixel order degree. When making the selection, the pixel-swapped image is sorted according to the pixel order degree, and a set of pixel-swapped images with the highest pixel order degree is selected and defined as the swapped sorting image. The above-mentioned swapped sorting image represents the most orderly set of images among all pixel-swapped images. To improve the fitting accuracy, the swapped sorting image is subjected to pixel partitioning. For example, 1000 pixels are divided into a pixel partition. Since pixel swapping has occurred, the pixel arrangement order within the pixel partition is more orderly than that of the original independent picture frame. Then, pixel information coordinates are constructed based on the pixel information, and the pixel information coordinates are fitted to obtain an image fitting function. However, due to the large number of pixel information coordinates, it is difficult to achieve the expected accuracy with a single fitting. Therefore, by means of multiple fittings, the image fitting function obtained through multiple fittings records the color information of all pixels within the pixel partition, so as to achieve the purpose of significantly reducing the stored data and improving the compression ratio of lossless compression.

[0044] As Figure 2 shown, as a preferred embodiment of the present invention, 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.

[0045] S201, number multiple cropped image blocks from the same independent picture frame, and count the sum of the pixel gray values included in each cropped image block.

[0046] In this step, multiple cropped image blocks from the same independent picture frame are numbered. The number of cropped image blocks corresponding to the independent picture frame is not less than five groups. When numbering, continuous numbering is used. For example, if five groups of cropped image blocks are obtained, the numbers are 1, 2, 3, 4, and 5 respectively. The gray values of each pixel in each cropped image block are counted, and the sum of the gray values is calculated. For example, the sum of the pixel gray values in the 1st cropped image block is K1.

[0047] S202, taking the number of the cropped image block as the abscissa and the corresponding sum of the pixel gray values as the ordinate, construct image block coordinates, and fit the image block coordinates to obtain a pattern recombination function.

[0048] In this step, image block coordinates are constructed. The abscissa of the image block coordinates is the number of the cropped image block, and the corresponding sum of the pixel gray values is the ordinate. For example, the image block coordinates are (1, K1), (2, K2), (3, K3), (4, K4), and (5, K5) respectively. The image block coordinates are imported into a function simulation tool for fitting to obtain the corresponding pattern recombination function, and two sets of pattern recombination functions are obtained.

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

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

[0051] As Figure 3 shown, as a preferred embodiment of the present invention, the step of performing pixel exchange on each group of independent picture frames based on the first recombination base number and the second recombination base number to generate a pixel exchange image and calculating the pixel order degree of the pixel exchange image specifically includes:

[0052] S301. Linearly arrange the pixels in the independent picture frame, and perform position exchange on the pixels with odd numbers in the independent picture frame according to the first recombination base number.

[0053] S302. Perform position exchange on the pixels with even numbers in the independent picture frame according to the second recombination base number. When the preset stop condition is met, it is regarded as the completion of one round of exchange, and multiple rounds of pixel exchange are repeated.

[0054] In this step, linearly arrange the pixels in the independent picture frame. Specifically, the pixels can be extracted from the independent picture frame in the order from left to right and from top to bottom, and then sorted according to the extraction order. The first recombination base number is retrieved, and the pixels in the linearly arranged pixels are selected in turn. The selection order is 1, 2, 3, 4... 2n. When the number of pixels is odd, the last pixel is stored separately. If the first recombination base number is M1 and the second recombination base number is M2, then the (2n - 1)th pixel is exchanged with the (2n - 1 + M1)th pixel, and the 2nth pixel is exchanged with the (2n + M2)th pixel, that is, traverse the linearly arranged pixels in the order of the number. When the number of the current pixel is odd, execute "exchange the (2n - 1)th pixel with the (2n - 1 + M1)th pixel", and when the number of the current pixel is even, execute "exchange the 2nth pixel with the (2n + M2)th pixel". If 2n - 1 + M1 or 2n + M2 is greater than 2n, then this round of pixel exchange ends. Repeat the preset number of times. For example, if this process is repeated 10 times, the pixel exchange process based on the current first recombination base number and second recombination base number ends, and a group of pixel exchange images are obtained. Retrieve the next group of first recombination base numbers and second recombination base numbers to obtain the preset number of pixel exchange images.

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

[0056] In this step, after each exchange is completed, a pixel-exchanged image is obtained, and the color values of the pixels are counted. The pixels are represented by RGB colors, which include the color value of the R channel, the color value of the G channel, and the color value of the B channel. For example, if the color values of the R channel, the G channel, and the B channel are 147, 232, and 188 respectively, the pixel color vector is (147, 232, 188). Calculate the cosine similarity between each pixel color vector and the adjacent pixel color vectors, and count the proportion of the number of pixels whose cosine similarity with adjacent pixels is greater than a preset value (the ratio between the number of pixels whose cosine similarity with adjacent pixels is greater than the preset value and the total number of pixels). This proportion is the pixel orderliness.

[0057] As Figure 4 shown, as a preferred embodiment of the present invention, the step of selecting a set of exchanged and sorted images from the pixel-exchanged images based on the pixel orderliness, performing pixel partitioning on the exchanged and sorted images, and performing multiple function fittings on the partitioned pixels to obtain an image fitting function and storing it specifically includes:

[0058] S401, select a set of pixel-exchanged images with the highest pixel orderliness as the exchanged and sorted images, linearly arrange the pixels in the exchanged and sorted images, and intercept them into multiple pixel partitions, where the number of pixels included in each pixel partition is the same.

[0059] In this step, select a set of pixel-exchanged images with the highest pixel orderliness as the exchanged and sorted images, record the natural numbers corresponding to the first recombination base number and the second recombination base number, and store them. Similarly, linearly arrange the pixels in the exchanged and sorted images that need to be processed, and divide them into multiple pixel partitions. The number of pixels in each pixel partition is the same, such as including 1000 pixels.

[0060] S402, extract the pixel information in each pixel partition, construct a pixel information coordinate, and perform a first function fitting based on the pixel information coordinate to obtain a first set of image fitting functions. The abscissa of the pixel information coordinate is the number of the pixel in the pixel partition, and the ordinate is the composite value of the color values of the pixels.

[0061] In this step, the pixel information within each pixel partition is extracted to construct pixel information coordinates. In the pixel information coordinates, the abscissa is the pixel number N, and the ordinate is the concatenated value of the color values of the three channels of the pixel. For example, if the color values of the R channel, G channel, and B channel are 147, 232, and 188 respectively, then the pixel information coordinates are (N, 147232188). Based on the pixel information coordinates, a first function fitting is performed, and a polynomial function is used for fitting during the fitting process to obtain the first set of image fitting functions.

[0062] S403. According to the first set of image fitting functions and the pixel information coordinates, fitting difference coordinates are constructed, and a quadratic function fitting is performed again. This process is repeated multiple times until the accuracy of the obtained image fitting function reaches the preset value, and then it is stored.

[0063] In this step, according to the first set of image fitting functions and the pixel information coordinates, fitting difference coordinates are constructed. After the first function fitting, the fitting accuracy at this time is insufficient. If the corresponding curve is plotted 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 with a distance from the curve greater than the preset value. At this time, calculate the difference in the ordinate between each pixel information coordinate and the curve corresponding to the first set of image fitting functions to construct the fitting difference coordinates. The abscissa of the fitting difference coordinates is still the pixel number, and the ordinate is the difference in the ordinate between the pixel information coordinate and the curve corresponding to the first set of image fitting functions, denoted as (N, D). Continue to fit all the fitting difference coordinates 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 to 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 denoted as f i (x). By superimposing the above image fitting functions, the final image fitting function F(x) can be obtained. Then F(x) = f 1 (x) + f 2 (x) + f 3 (x) + …… f i (x). Then the color value information of all pixels within the current pixel partition can be represented by the final image fitting function F(x). Accordingly, an independent frame of the image can be represented by multiple sets of image fitting functions F(x). Store the image fitting function F(x), only store the type of the image fitting function and the numerical value of the constant. When the number of times of repeated function fitting reaches the preset number of times and the fitting accuracy still cannot meet the requirements, then discard all the image fitting functions corresponding to the current pixel partition and directly store the pixel information coordinates within the pixel partition.

[0064] The present invention also provides a video decompression method for the video compression method described above. The video decompression method includes:

[0065] Retrieve all the image fitting functions corresponding to each independent 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 one by one into all the image fitting functions corresponding to the same pixel partition, synthesize the pixel information of each pixel within the pixel partition based on the output values of the respective image fitting functions, thereby determine the color values of each pixel within the pixel partition, repeat this process to obtain the content of the complete independent frame, and synthesize the original video to be compressed according to the content of the independent frame.

[0066] In this method, retrieve all the image fitting functions corresponding to each independent frame (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. Import it into the image fitting function F(x) to obtain a calculated value, round the calculated value to obtain the pixel information coordinates of the current pixel, and disassemble the ordinate of the pixel information coordinates to obtain the three-channel color value of the pixel. Accordingly, the content of the entire independent frame can be restored.

[0067] In one embodiment, a video decompression intelligent terminal is proposed. The video decompression intelligent terminal includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:

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

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

[0070] Perform pixel exchange on each group of independent frames based on the first recombination base and the second recombination base to generate pixel exchange images, and calculate the pixel order degree of the pixel exchange images;

[0071] Select a group of exchange sorting images from the pixel exchange images based on the pixel order degree, perform pixel partitioning on the exchange sorting images, and perform multiple function fittings on the partitioned pixels to obtain and store the image fitting functions.

[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 is caused to perform the following steps:

[0073] Obtain the 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 to obtain two groups of cropped image blocks;

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

[0075] Perform pixel exchange on each group of independent picture frames based on the first recombination base and the second recombination base to generate a pixel-exchanged image, and calculate the pixel order degree of the pixel-exchanged image;

[0076] Select a group of exchanged and sorted images from the pixel-exchanged image based on the pixel order degree, perform pixel partitioning on the exchanged and sorted images, perform multiple function fitting on the partitioned pixels, obtain an image fitting function and store it.

[0077] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention shall be included within 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, wherein 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; Select a group of exchange sorted images from the pixel exchange image based on the pixel order, perform pixel partitioning on the exchange sorted image, perform multiple function fitting on the partitioned pixels, obtain the image fitting function and store it; 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; Importing a preset natural number sequence into two sets 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; 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.

2. 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.

3. The video compression method according to claim 2, 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.

4. 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.

5. The video compression method according to claim 2, 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.

6. A video decompression method, characterized in that: Used in the video compression method according to any one of claims 1 to 5, 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.

7. 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 5.

8. 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 5.

Citation Information

Patent Citations

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

    CN107343200A

  • Image compression method, decompression method, system, equipment and medium

    CN117793357A