A smart bracelet image compression storage method for improving compression rate

By converting the smart bracelet image from RGB color space to YCrCb, DCT transformation and quantization are performed, and multiple compression is achieved, solving the problem of low compression rate of smart bracelet image and significantly reducing image usage space expands storage.

CN115037941BActive Publication Date: 2024-11-08SHENZHEN HUAXINZHI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210812696.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-11
Publication Date
2024-11-08
Estimated Expiration
2042-07-11

AI Technical Summary

Technical Problem

In the prior art, the image compression rate of smart bracelets is low, which leads to a large space occupied by the picture, reducing the amount of images stored by the bracelet.

Method used

Using color conversion and sampling technology, the image is converted from RGB color space to YCrCb color space, DCT transformation and quantization are performed, combined with Zigzag scanning and Huffman encoding, and multiple compressions are performed to improve the compression rate.

Benefits of technology

By reducing the data storage amount within a range that is not noticed by the human eye, and concentrating non-zero values, the compression rate of the picture is improved, the bytes occupied by the picture is significantly reduced, and the storage amount of the picture in the bracelet is expanded.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115037941B_ABST
    Figure CN115037941B_ABST
Patent Text Reader

Abstract

The present invention discloses a smart bracelet image compression storage method with improved compression rate. The image compression storage method aims to solve the technical problems of low compression rate of images under the prior art, large space occupied by images, and reduced storage capacity of images in the bracelet. The image compression storage method has the following steps: S1: color conversion and sampling; S2: dividing the image into multiple 8*8 matrices; S3: performing DCT transformation on each matrix. The image compression storage method reduces the storage capacity of data within a range that is not easily perceived by the human eye by using color conversion and sampling, thereby reducing the bytes occupied by the image and achieving a compression effect. After DCT transformation and quantization, the lower right corner of the matrix has basically become a zero value, and the non-zero values ​​are basically concentrated in the upper left corner of the matrix. In addition, the secondary compression method is adopted to further improve the compression rate of the image, and effectively expand the storage capacity of the image in the bracelet.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of smart bracelets, and in particular relates to a smart bracelet picture compression storage method for improving the compression rate. Background Art

[0002] As a wearable smart device, smart bracelets can record real-time data such as exercise, sleep, and diet in daily life, and synchronize these data with mobile phones and tablets, playing the role of guiding healthy living through data. Wearing smart bracelets brings a good feeling of health, technology, confidence and taste, and has become one of the typical high-tech products.

[0003] At present, the invention patent with patent application number CN202010626661.0 discloses a picture compression method, including the following steps: obtaining a picture compression request for a target picture, generating a picture compression task corresponding to the picture compression request; adding the picture compression task to a message queue; reading the picture compression task from the message queue, and executing the picture compression task. In the second aspect, an embodiment of the present application provides a picture compression device, including: a task generation unit, for obtaining a picture compression request for a target picture, generating a picture compression task corresponding to the picture compression request; a task adding unit, for adding the picture compression task to a message queue; a picture compression unit, for reading the picture compression task from the message queue, and executing the picture compression task. It adopts the method that the request access service and the picture compression service no longer need to communicate through the network, and the communication method between the two is more flexible and the picture compression efficiency is high, but the compression rate of the picture is low in this compression method, and the space occupied by the picture is large, which reduces the storage capacity of the bracelet for the picture.

[0004] Therefore, the above-mentioned problem of low compression rate needs to be solved urgently to improve the usage scenarios of smart bracelets. Summary of the invention

[0005] (1) Technical issues to be solved

[0006] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a smart bracelet picture compression storage method with improved compression rate. The picture compression storage method aims to solve the technical problems of low compression rate of pictures in the prior art, large space occupied by pictures, and reduced storage capacity of pictures in the bracelet.

[0007] (2) Technical solution

[0008] In order to solve the above technical problems, the present invention provides a smart bracelet image compression storage method for improving the compression rate, and the steps are as follows:

[0009] S1: Color conversion and sampling: Convert the image from RGB color space to YCrCb color space, specify the quality factor as Q1, perform the first compression, perform the first sampling, and the color mode conversion relationship is

[0010] S2: Divide the image into multiple 8*8 matrices and subtract 128 from each value in the matrix;

[0011] S3: Perform DCT transformation on each matrix, and obtain a frequency coefficient matrix after transformation, in which the frequency coefficients are all floating point numbers. The DCT transformation formula is: The coefficient C(u) is defined as: For Y(u), the coefficient when u=0 is the DC coefficient, and the other coefficients are AC coefficients. X(m) is the mth item in the input time domain sequence, and Y(u) is the uth item in the output frequency domain sequence. u=0, 1, ..., N-1, u is the horizontal frequency, m=0, 1, ..., N-1, and m is the position of the pixel.

[0012] S4: Quantize the transformed frequency coefficients. The quantization formula is: Y ij is the conversion coefficient in matrix Y, Z ij is the output quantization coefficient, Q step is the quantization step size;

[0013] S5: Scan sort: convert the quantized coefficients from two dimensions to one dimension;

[0014] S6: Differential pulse modulation encoding of DC coefficient: Take the difference between each DC value and the previous DC value in the same image component diff = DC n -DC n-1 To encode;

[0015] S7: Calculation of intermediate format of DC coefficient: Divide the data into 16 groups according to the number of bits, save them in the VLI coding table, and output the intermediate format of DC coefficient;

[0016] S8: Run-length coding of AC coefficients: RLC is used to replace consecutive characters that appear repeatedly in a string with two bytes, where the first byte represents the number of repetitions and the second byte represents the repeated string;

[0017] S9: calculation of the intermediate format of AC coefficients: processing the data on the right side of each pair in S8, encoding it with the VLI encoding table, and obtaining the result as the intermediate format of AC coefficients;

[0018] S10: Entropy coding: Huffman coding is used to assign shorter binary codes to characters with a high probability of occurrence, and longer binary codes to characters with a low probability of occurrence.

[0019] S101: Arrange the source symbols xa in descending order according to the probability of occurrence, a=1, 2, ..., p;

[0020] S102: Assign "0" and "1" to the two symbols with the smallest probabilities respectively, and then add the two probabilities as the probability of a new auxiliary symbol

[0021] S103: rearrange the new auxiliary symbol together with other symbols in the order of probability;

[0022] S104: Jump back to S102 until the probability of occurrence is added up to "1";

[0023] S105: Connect the symbols with lines to obtain a code tree, where p endpoints of the tree correspond to p source symbols;

[0024] S106: Starting from the last node with a probability of "1", along each symbol reaching the source, the binary codes "0" or "1" encountered along the way are arranged in order, which is the codeword of the source symbol corresponding to the endpoint;

[0025] S11: Restore the image data in S10, specify the quality factor Q2, perform a second compression, repeat steps S2-S10, and then save.

[0026] Preferably, in S1, Y represents the brightness component, Cr represents the chromaticity component of the red-green color difference, and Cb represents the chromaticity component of the blue-green color difference.

[0027] Preferably, the sampling signal format in S1 is 4:1:1.

[0028] Preferably, the scanning order in S5 is Zigzag scanning order, which is specifically to start from the upper left corner of the 8*8 matrix and scan in the shape of "Z".

[0029] Preferably, if the number of consecutive 0s between AC coefficients in S8 exceeds 16, an extended byte (15, 0) is used to represent 16 consecutive 0s.

[0030] Preferably, in S11, Q2≠Q1.

[0031] (3) Beneficial effects

[0032] Compared with the prior art, the beneficial effect of the present invention is that the image compression storage method of the present invention reduces the storage amount of data within a range that is not easily perceived by the human eye by using color conversion and sampling, thereby reducing the bytes occupied by the image and achieving a compression effect. After DCT transformation and quantization, the lower right corner of the matrix has actually basically become a zero value, and the non-zero values ​​are basically concentrated in the upper left corner of the matrix. After ZigZag scanning, the two-dimensional matrix is ​​converted into a one-dimensional string, and the front is the non-zero value, and the back is a large number of zero values. The order generated by Zigzag scanning provides a particularly good premise for subsequent entropy coding, and the quantized image is then compressed through Huffman coding, and the secondary compression method is adopted to further improve the compression rate of the image, greatly reduce the bytes occupied by the image, and effectively expand the storage capacity of the image in the bracelet. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 The present invention is a flowchart of a specific implementation of the image compression storage method of the present invention. DETAILED DESCRIPTION

[0034] Example 1

[0035] This specific implementation method is a smart bracelet image compression storage method with improved compression rate, and its flow chart is as follows: Figure 1 As shown, the steps of the image compression storage method are as follows:

[0036] S1: Color conversion and sampling: Convert the image from RGB color space to YCrCb color space, specify the quality factor as Q1, perform the first compression, perform the first sampling, and the color mode conversion relationship is

[0037] S2: Divide the image into multiple 8*8 matrices and subtract 128 from each value in the matrix;

[0038] S3: Perform DCT transformation on each matrix, and obtain a frequency coefficient matrix after transformation, in which the frequency coefficients are all floating point numbers. The DCT transformation formula is: The coefficient C(u) is defined as: For Y(u), the coefficient when u=0 is the DC coefficient, and the other coefficients are AC coefficients. X(m) is the mth item in the input time domain sequence, and Y(u) is the uth item in the output frequency domain sequence. u=0, 1, ..., N-1, u is the horizontal frequency, m=0, 1, ..., N-1, and m is the position of the pixel.

[0039] S4: Quantize the transformed frequency coefficients. The quantization formula is: Y ij is the conversion coefficient in matrix Y, Z ij is the output quantization coefficient, Q step is the quantization step size;

[0040] S5: Scan sort: convert the quantized coefficients from two dimensions to one dimension;

[0041] S6: Differential pulse modulation encoding of DC coefficient: Take the difference between each DC value and the previous DC value in the same image component diff = DC n -DC n-1 To encode;

[0042] S7: Calculation of intermediate format of DC coefficient: Divide the data into 16 groups according to the number of bits, save them in the VLI coding table, and output the intermediate format of DC coefficient;

[0043] S8: Run-length coding of AC coefficients: RLC is used to replace consecutive characters that appear repeatedly in a string with two bytes, where the first byte represents the number of repetitions and the second byte represents the repeated string;

[0044] S9: calculation of the intermediate format of AC coefficients: processing the data on the right side of each pair in S8, encoding it with the VLI encoding table, and obtaining the result as the intermediate format of AC coefficients;

[0045] S10: Entropy coding: Huffman coding is used to assign shorter binary codes to characters with a high probability of occurrence, and longer binary codes to characters with a low probability of occurrence.

[0046] S101: Arrange the source symbols xa in descending order according to the probability of occurrence, a=1, 2, ..., p;

[0047] S102: Assign "0" and "1" to the two symbols with the smallest probabilities respectively, and then add the two probabilities as the probability of a new auxiliary symbol

[0048] S103: rearrange the new auxiliary symbol together with other symbols in the order of probability;

[0049] S104: Jump back to S102 until the probability of occurrence is added up to "1";

[0050] S105: Connect the symbols with lines to obtain a code tree, where p endpoints of the tree correspond to p source symbols;

[0051] S106: Starting from the last node with a probability of "1", along each symbol reaching the source, the binary codes "0" or "1" encountered along the way are arranged in order, which is the codeword of the source symbol corresponding to the endpoint;

[0052] S11: Restore the image data in S10, specify the quality factor Q2, perform a second compression, repeat steps S2-S10, and then save.

[0053] Among them, Y in S1 represents the brightness component, Cr represents the chrominance component of the red-green color difference, Cb represents the chrominance component of the blue-green color difference, and the sampling signal format in S1 is 4:1:1.

[0054] At the same time, the scanning sorting method used in S5 is Zigzag scanning sorting, and the specific method is to start from the upper left corner of the 8*8 matrix and scan in the shape of "Z".

[0055] In addition, if the number of consecutive 0s between AC coefficients in S8 exceeds 16, an extended byte (15, 0) is used to represent 16 consecutive 0s, and Q2≠Q1 in S11.

[0056] When using the image compression storage method of this technical solution, the steps are as follows:

[0057] S1: Color conversion and sampling: Convert the image from RGB color space to YCrCb color space, specify the quality factor as Q1, perform the first compression, perform the first sampling, and the color mode conversion relationship is Y represents the brightness component, Cr represents the chrominance component of the red-green color difference, Cb represents the chrominance component of the blue-green color difference, and the sampling signal format is 4:1:1;

[0058] S2: Divide the image into multiple 8*8 matrices and subtract 128 from each value in the matrix;

[0059] S3: Perform DCT transformation on each matrix, and obtain a frequency coefficient matrix after transformation, in which the frequency coefficients are all floating point numbers. The DCT transformation formula is: The coefficient C(u) is defined as: For Y(u), the coefficient when u=0 is the DC coefficient, and the other coefficients are AC coefficients. X(m) is the mth item in the input time domain sequence, and Y(u) is the uth item in the output frequency domain sequence. u=0, 1, ..., N-1, u is the horizontal frequency, m=0, 1, ..., N-1, and m is the position of the pixel.

[0060] S4: Quantize the transformed frequency coefficients. The quantization formula is: Y ijis the conversion coefficient in matrix Y, Z ij is the output quantization coefficient, Q step is the quantization step size;

[0061] S5: Scanning and sorting: The quantized coefficients are converted from two dimensions to one dimension. The scanning and sorting method is Zigzag scanning and sorting. The specific method is to start from the upper left corner of the 8*8 matrix and scan in the shape of "Z";

[0062] S6: Differential pulse modulation encoding of DC coefficient: Take the difference between each DC value and the previous DC value in the same image component diff = DC n -DC n-1 To encode;

[0063] S7: Calculation of intermediate format of DC coefficient: Divide the data into 16 groups according to the number of bits, save them in the VLI coding table, and output the intermediate format of DC coefficient;

[0064] S8: Run-length coding of AC coefficients: RLC is used to replace the consecutive characters in a string with two bytes, where the first byte represents the number of repetitions and the second byte represents the repeated string. If the number of consecutive 0s between AC coefficients exceeds 16, an extended byte (15, 0) is used to represent 16 consecutive 0s.

[0065] S9: calculation of the intermediate format of AC coefficients: processing the data on the right side of each pair in S8, encoding it with the VLI encoding table, and obtaining the result as the intermediate format of AC coefficients;

[0066] S10: Entropy coding: Huffman coding is used to assign shorter binary codes to characters with a high probability of occurrence, and longer binary codes to characters with a low probability of occurrence.

[0067] S101: Arrange the source symbols xa in descending order according to the probability of occurrence, a=1, 2, ..., p;

[0068] S102: Assign "0" and "1" to the two symbols with the smallest probabilities respectively, and then add the two probabilities as the probability of a new auxiliary symbol

[0069] S103: rearrange the new auxiliary symbol together with other symbols in the order of probability;

[0070] S104: Jump back to S102 until the probability of occurrence is added up to "1";

[0071] S105: Connect the symbols with lines to obtain a code tree, where p endpoints of the tree correspond to p source symbols;

[0072] S106: Starting from the last node with a probability of "1", along each symbol reaching the source, the binary codes "0" or "1" encountered along the way are arranged in order, which is the codeword of the source symbol corresponding to the endpoint;

[0073] S11: Restore the image data in S10, specify the quality factor Q2, and Q2≠Q1, perform a second compression, repeat steps S2-S10, and then save.

Claims

1. A smart bracelet image compression storage method for improving compression rate, characterized in that: The steps are as follows: S1: Color conversion and sampling: Convert the image from RGB color space to YCrCb color space, specify the quality factor as Q1, perform the first compression, perform the first sampling, and the color mode conversion relationship is S2: Divide the image into multiple 8*8 matrices and subtract 128 from each value in the matrix; S3: Perform DCT transformation on each matrix, and obtain a frequency coefficient matrix after transformation, in which the frequency coefficients are all floating point numbers. The DCT transformation formula is: The coefficient C(u) is defined as: For Y(u), the coefficient when u=0 is the DC coefficient, and the other coefficients are AC coefficients. X(m) is the mth item in the input time domain sequence, and Y(u) is the uth item in the output frequency domain sequence. u=0, 1, ..., N-1, u is the horizontal frequency, m=0, 1, ..., N-1, and m is the position of the pixel. S4: Quantize the transformed frequency coefficients. The quantization formula is: Y ij is the conversion coefficient in matrix Y, Z ij is the output quantization coefficient, Q step is the quantization step size; S5: Scan sort: convert the quantized coefficients from two dimensions to one dimension; S6: Differential pulse modulation encoding of DC coefficient: Take the difference between each DC value and the previous DC value in the same image component diff = DC n -DC n-1 To encode; S7: Calculation of intermediate format of DC coefficient: Divide the data into 16 groups according to the number of bits, save them in the VLI coding table, and output the intermediate format of DC coefficient; S8: Run-length coding of AC coefficients: RLC is used to replace consecutive characters that appear repeatedly in a string with two bytes, where the first byte represents the number of repetitions and the second byte represents the repeated string; S9: calculation of the intermediate format of AC coefficients: processing the data on the right side of each pair in S8, encoding it with the VLI encoding table, and obtaining the result as the intermediate format of AC coefficients; S10: Entropy coding: Huffman coding is used to assign shorter binary codes to characters with a high probability of occurrence, and longer binary codes to characters with a low probability of occurrence. S101: Arrange the source symbols xa in descending order according to the probability of occurrence, a=1, 2, ..., p; S102: Assign "0" and "1" to the two symbols with the smallest probabilities respectively, and then add the two probabilities as the probability of a new auxiliary symbol S103: rearrange the new auxiliary symbol together with other symbols in the order of probability; S104: Jump back to S102 until the probability of occurrence is added up to "1"; S105: Connect the symbols with lines to obtain a code tree, where p endpoints of the tree correspond to p source symbols; S106: Starting from the last node with a probability of "1", along each symbol reaching the source, the binary codes "0" or "1" encountered along the way are arranged in order, which is the codeword of the source symbol corresponding to the endpoint; S11: Restore the image data in S10, specify the quality factor Q2, perform a second compression, repeat steps S2-S10, and then save.

2. A smart bracelet image compression storage method for improving compression rate according to claim 1, characterized in that: In S1, Y represents the brightness component, Cr represents the chromaticity component of the red-green color difference, and Cb represents the chromaticity component of the blue-green color difference.

3. A smart bracelet image compression storage method for improving compression rate according to claim 1, characterized in that: The sampling signal format in S1 is 4:1:

1.

4. A smart bracelet image compression storage method for improving compression rate according to claim 1, characterized in that: The scanning order in S5 is Zigzag scanning order, which is specifically started from the upper left corner of the 8*8 matrix and scanned in the shape of "Z".

5. A smart bracelet image compression storage method for improving compression rate according to claim 1, characterized in that: If the number of consecutive 0s between AC coefficients in S8 exceeds 16, an extended byte (15, 0) is used to represent 16 consecutive 0s.

6. A smart bracelet image compression storage method for improving compression rate according to claim 1, characterized in that: In the S11, Q2≠Q1.