Fractal image compression optimization method based on DCT and compressed sensing
By combining the low-frequency structural characteristics of the image and the compression-sensing encoding process, the optimal matching blocks are selected for image sub-blocks, which solves the problem that the matching search process occupies a lot of time in the existing fractal encoding, and achieves the efficiency and high fractal encoding. Mass compression.
Patent Information
- Application Number
- CN202411431910.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-02-14
AI Technical Summary
In the existing fractal coding, the matching search process occupies a large amount of coding time, affecting the efficiency of fractal coding.
By combining the low-frequency structural characteristics of the image and the compression-sensing encoding process, the image sub-block is selected, including the method of combining smoothness division of the D block, calculating the measurement vector parameters, and matching with the traversal of the smoothing category.
The speed of fractal coding is significantly improved, and the encoding time is reduced by optimizing the encoding process, while maintaining high-quality image compression effect.
Smart Images

Figure CN119450077A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image compression, and in particular relates to a fractal image compression optimization method based on DCT and compressed sensing. Background Art
[0002] At present, the commonly used image coding method in image compression technology is fractal coding, which breaks through the boundaries of previous entropy compression coding. In the coding process, a similar method is used, and decoding is completed by iteration, and it has resolution-independent decoding characteristics, etc. However, the applicant found that in the existing fractal coding, the best matching block is retrieved by traversing the R block in the code book D block in a certain way (such as full search) to perform the fractal coding process of the image. The matching search process occupies a large amount of coding time and is one of the important factors affecting the efficiency of fractal coding, which greatly reduces the practicality of fractal coding. Summary of the invention
[0003] In order to solve the above problems existing in the prior art, the present invention provides a fractal image compression optimization method based on DCT and compressed sensing.
[0004] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0005] The fractal image compression optimization method based on DCT and compressed sensing described in the present invention is based on the low-frequency structural characteristics of the image, and selects the best matching block for the image sub-block by combining the compressed sensing encoding process; comprising:
[0006] The D blocks are divided into smoothness according to the low-frequency characteristics of the image sub-blocks;
[0007] The measurement vector parameters of different image sub-blocks are calculated to obtain the horizontal / vertical measurement vectors. Then, the smooth sub-blocks are traversed and matched according to the correlation degree matching of the horizontal / vertical measurement vectors and the traversal of the smooth category to select the best matching block.
[0008] Furthermore, the “dividing the D blocks into smoothness according to the low-frequency characteristics of the image sub-blocks” is specifically:
[0009] The image is segmented according to two scales and step sizes to form an R block atlas and a D block atlas.
[0010] Furthermore, the “calculating measurement vector parameters for different image sub-blocks to obtain horizontal / vertical measurement vectors, and then traversing and matching the smooth sub-blocks according to a method combining correlation matching of the horizontal / vertical measurement vectors with traversal of the smoothness category to select the best matching block” is specifically:
[0011] By referring to the compressed sensing coding idea, the sub-blocks required in fractal coding are sparsely represented based on low-frequency coefficients. The image is converted into low-frequency correlation coefficients through DCT transform. Feature selection is performed on the transformed matrix according to the main low-frequency coefficients, and the redundant information is set to 0 for preliminary data compression. The main low-frequency coefficients are further obtained by converting the remaining matrix after coefficient representation and removing redundant data through a custom measurement matrix, and defined as the final measurement vector for optimal comparison block matching.
[0012] Furthermore, the method of “calculating measurement vector parameters for different image sub-blocks to obtain horizontal / vertical measurement vectors, and then traversing and matching the smooth sub-blocks according to the combination of the correlation degree matching of the horizontal / vertical measurement vectors and the traversal of the smoothness category to select the best matching block” includes the following steps:
[0013] Perform DCT transformation on each D block in the D block atlas, and take the absolute value of the difference between the positions of F[0,1] and F[1,0] after the transformation to form a list;
[0014] Sort the list from small to large, and take the 25% position difference from small to large as the smoothing class division threshold according to the low-frequency characteristics;
[0015] Classify the R blocks, use the same method as the D blocks to calculate the difference of each R block in the R block atlas, and judge whether it belongs to the smooth class, horizontal class, or vertical class according to the threshold of the R block;
[0016] For the horizontal and smooth classes, according to the compressed sensing idea, the non-corresponding thresholds of their DCT transformed matrices are set to zero, and the D blocks are represented as horizontal coefficients or vertical coefficients according to different categories;
[0017] During encoding, the horizontal and vertical categories of the R block are confirmed and expressed as horizontal coefficients or vertical coefficients, and then the traversal process of the R block and the D block is converted into a corresponding coefficient matching process. According to the smallest difference in coefficients, the matching D block is directly determined and then the R block is encoded;
[0018] For the remaining smooth R blocks, traversal matching is performed in the D block codebook without the vertical or horizontal blocks.
[0019] Beneficial effects of the present invention:
[0020] Through the above technical scheme, the present invention can integrate with compressed sensing coding according to the low-frequency characteristics of the image, absorb the characteristics of the compressed sensing coding speed block, further improve the encoding speed of fractal coding, and further optimize the encoding process time by targeting the low-frequency characteristics of the image. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1It is a flow chart of the fractal image compression optimization method based on DCT and compressed sensing of the present invention;
[0022] Figure 2 It is a time curve diagram of a graphics coding experiment using the fractal image compression optimization method based on DCT and compressed sensing of the present invention;
[0023] Figure 3 It is a time curve chart of graphic coding experiment using existing fractal image method. DETAILED DESCRIPTION
[0024] 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 used to limit the present invention.
[0025] The fractal image compression optimization method based on DCT and compressed sensing of the present invention is based on the low-frequency structural characteristics of the image (i.e., the sub-blocks in the image have low-frequency coefficients of different scales in the horizontal and vertical directions), and selects the best matching block for the image sub-block by combining the compressed sensing encoding process; it includes:
[0026] The D blocks are divided into smoothness according to the low-frequency characteristics of the image sub-blocks;
[0027] The measurement vector parameters of different image sub-blocks are calculated to obtain the horizontal / vertical measurement vectors. Then, the smooth sub-blocks are traversed and matched according to the correlation degree matching of the horizontal / vertical measurement vectors and the traversal of the smooth category to select the optimal matching block. Specifically, by referring to the compressed sensing coding idea, the sub-blocks required in fractal coding are sparsely represented based on low-frequency coefficients, and the image is converted into low-frequency correlation coefficients through DCT transform. Feature selection is performed on the transformed matrix for the main low-frequency coefficients, and the redundant information is set to 0 for preliminary data compression. The main low-frequency coefficients are further obtained by converting the remaining matrix after the coefficient representation and removal of redundant data through a custom measurement matrix, and defined as the final measurement vector for optimal comparison block matching.
[0028] like Figure 1 As shown, the fractal image compression optimization method based on DCT and compressed sensing of the present invention specifically includes the following steps:
[0029] Step S1. Segment the image according to two scales and step sizes to form an R block atlas and a D block atlas. The scale of the R block can be 4×4 with a step size of 4; the scale of the D block can be 8×8 with a step size of 8; and the step size of the R block is equal to the block length. At the same time, in order to segment the image without overlap, the block length of the D block is twice that of the R block.
[0030] Step S2. Perform DCT transformation on each D block in the D block atlas, and take the absolute value of the difference between the positions of F[0,1] and F[1,0] after the transformation to form a list; wherein the DCT transformation is directly implemented using the cv2.dct() function in Python, and then the required position data is obtained through the matrix.
[0031] Step S3. Sort the list from small to large, and take the 25% position difference from small to large as the smoothing class division threshold according to the low-frequency characteristics: for example: if there are 100 coefficients, the 25th coefficient is used as the smoothing class division threshold.
[0032] Step S4. classify the R blocks, calculate the difference of each R block in the R block atlas using the same method as the D block, and judge whether it belongs to the smoothing class, horizontal class, or vertical class according to the threshold of the R block (the threshold of the R block is calculated using the same method as the smoothing class division threshold of the D block, which will not be repeated here); when the difference is lower than the threshold, it belongs to the smoothing class; when the difference is higher than the threshold and the horizontal low-frequency characteristic is greater than the vertical low-frequency characteristic, it belongs to the horizontal class; when the difference is higher than the threshold and the horizontal low-frequency characteristic is less than the vertical low-frequency characteristic, it belongs to the vertical class.
[0033] Step S5. For the horizontal and vertical categories, according to the compressed sensing concept, the non-corresponding thresholds of the matrix after DCT transformation are set to zero, and the D block is represented as a horizontal coefficient or a vertical coefficient according to different categories.
[0034] Step S6. During encoding, the horizontal and vertical categories of the R blocks are confirmed (i.e., the classification of step S4 is confirmed), and are represented as horizontal coefficients or vertical coefficients. Then, the traversal process of the R blocks and the D blocks is converted into a corresponding coefficient matching process (i.e., the coefficients of the R blocks to be matched are subtracted from the coefficients of the D blocks in the corresponding category, and the D blocks with the smallest interpolation are selected). Based on the smallest difference in coefficients, the matching D blocks are directly determined and then the R block encoding is performed.
[0035] Step S7: For the remaining smooth R blocks, traversal matching is performed in the D block codebook without the vertical or horizontal blocks.
[0036] It can be seen that the present invention integrates compressed sensing coding according to the low-frequency characteristics of the image, absorbs the characteristics of the compressed sensing coding speed block, further improves the encoding speed of fractal coding, and further optimizes the encoding process in terms of time by targeting the low-frequency characteristics of the image.
[0037] Through experiments, the method of the present invention was tested on a collection of one thousand breast pathology images and found that after encoding by the method of the present invention, the encoding time can be greatly reduced when the average PSNR reaches 37.45s (through experiments, the average time for graphic encoding of the same data set using the method of the present invention and the existing fractal encoding method is 76.96s and 96.82s respectively, see the following table and Figure 2 and Figure 3 ), and the method of the present invention can perform compression processing on biological microscopic images with higher restoration quality.
[0038]
[0039]
[0040]
[0041]
[0042]
[0043]
[0044]
[0045]
[0046]
[0047]
[0048]
[0049]
[0050]
[0051]
[0052]
[0053]
[0054]
[0055]
[0056]
[0057]
[0058]
[0059]
[0060]
[0061]
[0062]
[0063]
[0064]
[0065]
[0066]
[0067]
[0068]
[0069]
[0070]
[0071]
[0072]
[0073]
[0074]
[0075]
[0076]
[0077]
[0078]
[0079]
[0080]
[0081]
[0082]
[0083]
[0084]
[0085]
[0086]
[0087]
[0088]
[0089]
[0090]
[0091]
[0092]
[0093]
[0094]
[0095]
[0096]
[0097]
[0098]
[0099]
[0100]
[0101]
[0102]
[0103]
[0104]
[0105]
[0106] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A fractal image compression optimization method based on DCT and compressed sensing, characterized in that: This method is based on the low-frequency structural characteristics of the image and selects the best matching block for the image sub-block by combining the compressed sensing encoding process; it includes: The D blocks are divided into smoothness according to the low-frequency characteristics of the image sub-blocks; The measurement vector parameters of different image sub-blocks are calculated to obtain the horizontal / vertical measurement vectors. Then, the smooth sub-blocks are traversed and matched according to the correlation degree matching of the horizontal / vertical measurement vectors and the traversal of the smooth category to select the best matching block.
2. The method according to claim 1, characterized in that The “dividing the D blocks into smoothness according to the low-frequency characteristics of the image sub-blocks” is specifically: The image is segmented according to two scales and step sizes to form an R block atlas and a D block atlas.
3. The method according to claim 2, characterized in that The "calculating measurement vector parameters for different image sub-blocks to obtain horizontal / vertical measurement vectors, and then traversing and matching the smooth sub-blocks according to the combination of horizontal / vertical measurement vector correlation matching and traversal for smoothness to select the best matching block" is specifically: By referring to the compressed sensing coding idea, the sub-blocks required in fractal coding are sparsely represented based on low-frequency coefficients. The image is converted into low-frequency correlation coefficients through DCT transform. Feature selection is performed on the transformed matrix according to the main low-frequency coefficients, and the redundant information is set to 0 for preliminary data compression. The main low-frequency coefficients are further obtained by converting the remaining matrix after coefficient representation and removing redundant data through a custom measurement matrix, and defined as the final measurement vector for optimal comparison block matching.
4. The method according to claim 3, characterized in that The method of "calculating measurement vector parameters for different image sub-blocks to obtain horizontal / vertical measurement vectors, and then performing traversal matching on smooth sub-blocks according to a method combining correlation matching of the horizontal / vertical measurement vectors with traversal matching of the smoothness category to select the best matching block" includes the following steps: Perform DCT transformation on each D block in the D block atlas, and take the absolute value of the difference between the positions of F[0,1] and F[1,0] after the transformation to form a list; Sort the list from small to large, and take the 25% position difference in the new list reordered from small to large as the smoothing class division threshold according to the low-frequency characteristics; Classify the R blocks, use the same method as the D blocks to calculate the difference of each R block in the R block atlas, and judge whether it belongs to the smooth class, horizontal class, or vertical class according to the threshold of the R block; For the horizontal and vertical classes, according to the compressed sensing idea, the non-corresponding thresholds of the DCT transformed matrix are set to zero, and the D block is represented as a horizontal coefficient or a vertical coefficient according to the different categories; During encoding, the horizontal and vertical categories of the R block are confirmed and expressed as horizontal coefficients or vertical coefficients, and then the traversal process of the R block and the D block is converted into a corresponding coefficient matching process. According to the smallest difference in coefficients, the matching D block is directly determined and then the R block is encoded; For the remaining smooth R blocks, traversal matching is performed in the D block codebook without the vertical or horizontal blocks.