Information compression / decompression method and device

By clustering and losslessly compressing the text areas and lines in text blocks, the problems of low efficiency and insufficient clarity of text information compression in the prior art are solved, and more efficient text information compression and clearer transmission effects are achieved.

CN111918065BActive Publication Date: 2025-03-25ZTE CORP
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN201910383463.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-05-08
Publication Date
2025-03-25
Estimated Expiration
2039-06-08

AI Technical Summary

Technical Problem

In the prior art, the compression efficiency of text information has not been optimized, and the clarity after the transmission of text information is insufficient.

Method used

By clustering the text blocks to be processed into different text areas based on the pixel distribution information, the text line distribution information of each text area is obtained, and each text line is scanned to obtain the original pixel information, and finally the text line distribution information and the original pixel information are lostlessly compressed.

Benefits of technology

Improve the compression efficiency of text information and improve the clarity after text information transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111918065B_ABST
    Figure CN111918065B_ABST
Patent Text Reader

Abstract

The present application discloses an information compression / decompression method and device. The present application divides the text blocks to be processed into different text areas, providing a prerequisite for the subsequent line feature analysis of the text areas that the text blocks can be split into text lines, thereby ensuring the compression of text information using the distribution characteristics of the text, thereby improving the compression efficiency of the text information and improving the clarity of text information transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to but is not limited to information processing technology, and in particular to an information compression / decompression method and device. Background Art

[0002] With the popularization of cloud computing, virtual desktop and other technologies, a large amount of remote data needs to be transmitted to the user terminal as quickly and clearly as possible through the network for display. In the daily office-related scenarios of cloud desktops, the screen content usually contains a large amount of text, and the clarity of the text content can significantly affect the comfort of human vision. Therefore, in the usual cloud desktop scenarios, text is processed using lossless or nearly lossless compression algorithms.

[0003] In the related art, there are two mainstream methods for compressing text. One is to cluster the text area to generate a palette based on the limited distribution of pixel value types in the text area, and then compress the palette index value corresponding to each pixel, that is, compression based on the palette and index value. Another mainstream method is to transform the original pixels of the text area in the frequency domain and transmit the transformed coefficients.

[0004] In the related art, the compression method for text information, after distinguishing and identifying the text area, uses a lossless or lossy, spatial domain or frequency domain compression algorithm to compress the entire text area. In this way, the compression efficiency of the text is not optimized. Summary of the invention

[0005] The present application provides an information compression / decompression method and device, which can improve the compression efficiency of text information and at the same time improve the clarity of text information after transmission.

[0006] The present application provides an information compression method, comprising:

[0007] Clustering the text blocks to be processed into different text areas according to pixel distribution information;

[0008] For each text area, obtaining text line distribution information of the text area according to foreground pixels of each line in the text area;

[0009] Scan each text line to obtain original pixel information of each text line according to the obtained text line distribution information;

[0010] Losslessly compress the text line distribution information and the scanned original pixel information.

[0011] In an exemplary embodiment, the method further comprises:

[0012] The coding block to be processed is determined to be an image block or the text block according to the pixel distribution information.

[0013] In an exemplary embodiment, the method further comprises:

[0014] For the changed area in the original screen data, the color space conversion is performed on the pixels of the original screen data;

[0015] The original screen data is divided into blocks according to the coding unit size to obtain the coding blocks to be processed.

[0016] In an exemplary embodiment, clustering the text blocks to be processed into different text areas includes:

[0017] According to the values ​​of top2 pixels, the text blocks of the coding unit size are clustered into the large text area; wherein the values ​​of top2 pixels are the two types of pixels that account for the largest proportion of pixel types in a single text block.

[0018] In an exemplary embodiment, the obtaining of text line distribution information of the text area includes:

[0019] For each of the text regions, a horizontal histogram projection method is used to obtain pixel histogram information of each row of the text region;

[0020] Use the local extreme value method to obtain the distribution extreme value of the foreground color pixels on the histogram;

[0021] Extract row coordinate information of the row according to the obtained distribution extreme value;

[0022] When each line of the text area is processed, the number of text lines included in the text area is recorded;

[0023] The text line distribution information corresponds to each text area, including: the number of text lines included in the text area, and the line coordinate information of each text line in the text area.

[0024] In an exemplary embodiment, obtaining original pixel information of each text line includes:

[0025] According to the obtained text row distribution information, vertical column scanning is performed for each text row in each text area according to the row coordinate information to obtain the original pixel information of the text row.

[0026] In an exemplary embodiment, when the coding block to be processed includes an image block and a text block, the method further includes:

[0027] Perform lossy compression on the image block to obtain a lossy data packet;

[0028] The lossless data packet and the lossy data packet are packaged and then transmitted.

[0029] In an exemplary embodiment, when the coding blocks to be processed include image blocks and text blocks, before clustering the text blocks to be processed into different text areas, the method further includes:

[0030] The types of the blocks adjacent to the left, upper left and upper sides of the image block are determined. If all of them are text blocks, the type of the image block is classified as a text block.

[0031] The present application also provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute any of the above-mentioned information compression methods.

[0032] The present application further provides a device for implementing information compression, including a processor and a memory; wherein the memory stores a computer program that can be run on the processor: used to execute the steps of any of the above-mentioned information compression methods.

[0033] The present application further provides an information compression device, comprising: a clustering module, a splitting module, a scanning module, and a compression module; wherein:

[0034] A clustering module, used for clustering the text blocks to be processed into different text areas according to pixel distribution information;

[0035] A splitting module is used to obtain text line distribution information of each text area according to the foreground pixels of each line in the text area;

[0036] A scanning module, used for scanning each text line to obtain original pixel information of each text line according to the obtained text line distribution information;

[0037] The compression module is used to perform lossless compression on the text line distribution information and the original pixel information obtained by scanning to obtain a lossless data packet.

[0038] In an exemplary embodiment, the device further includes: a pre-processing module, configured to determine whether the coding block to be processed is an image block or the text block according to the pixel distribution information.

[0039] In an exemplary embodiment, the compression module is further used for: performing lossy compression on the image block to obtain a lossy data packet; and packetizing the lossless data packet and the lossy data packet for transmission.

[0040] In an exemplary embodiment, the device further includes: a processing module, configured to determine the types of blocks adjacent to the left, upper left, and above the image block, and if all of the blocks are text blocks, classifying the type of the image block as a text block.

[0041] The present application also provides an information decompression method, comprising:

[0042] Parse the received lossless data packet to obtain text line distribution information;

[0043] When it is determined that there is a valid text line, the original pixel information of the line obtained by parsing is used to fill the text line pixels one by one according to the text line distribution information to obtain the text block to be processed.

[0044] In an exemplary embodiment, the method further comprises:

[0045] Parsing the received data packet to determine whether the currently received data packet is a lossless data packet of a lossless compression type or a lossy data packet of a lossy compression type;

[0046] If the currently received data packet is the lossless data packet, continue to execute the step of parsing the received lossless data packet; if the currently received data packet is a lossy data packet, decode the received lossy data packet.

[0047] In an exemplary embodiment, the method further comprises:

[0048] Placing the decoded data into a data frame, wherein the decoded data includes: the lossless decoded data, or the lossless decoded data and the lossy decoded data;

[0049] According to the color space requirements of the final display, the pixels in the data frame are converted into colors.

[0050] In an exemplary embodiment, the determining whether there is a valid text line includes:

[0051] If the text line distribution information obtained after parsing shows that the number of text lines in at least one text area is greater than 0, it is determined that the valid text line exists.

[0052] The present application also provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute any of the above-mentioned information decompression methods.

[0053] The present application further provides a device for implementing information decompression, including a processor and a memory; wherein the memory stores a computer program that can be run on the processor: used to execute the steps of any of the above-mentioned information decompression methods.

[0054] The present application further provides an information decompression device, comprising: a parsing module and a recovery module; wherein:

[0055] A parsing module, used to parse the received lossless data packet to obtain text line distribution information;

[0056] The restoration module is used to fill the text line pixels one by one with the original pixel information of the line obtained by parsing according to the text line distribution information when it is determined that there is a valid text line, so as to obtain the text block to be processed.

[0057] In an exemplary embodiment, the parsing module is further used for:

[0058] Parsing the received data packet to determine whether the currently received data packet is a lossless data packet of a lossless compression type or a lossy data packet of a lossy compression type;

[0059] If the currently received data packet is a lossless data packet, continue to parse the received lossless data packet to obtain the text line distribution information; if the currently received data packet is a lossy data packet, decode the received lossy data packet;

[0060] In an exemplary embodiment, the recovery module is further configured to:

[0061] Placing the decoded data into a data frame; wherein the decoded data includes: the lossless decoded data, or the lossless decoded data and the lossy decoded data;

[0062] According to the color space requirements of the final display, the pixels in the data frame are converted into colors.

[0063] In an exemplary embodiment, the determining whether there is a valid text line in the recovery module includes:

[0064] If the text line distribution information obtained after parsing shows that the number of text lines in at least one text area is greater than 0, it is determined that the valid text line exists.

[0065] On the one hand, the information compression method of the present application includes: clustering the text blocks to be processed into different text areas according to pixel distribution information; for each text area, obtaining the text line distribution information of the text area according to the foreground pixels of each line in the text area; scanning each text line to obtain the original pixel information according to the obtained text line distribution information; and losslessly compressing the text line distribution information and the scanned original pixel information. The present application divides the text blocks to be processed into different text areas, which provides the prerequisite that the text blocks can be split into text lines for the subsequent line feature analysis of the text area, thereby ensuring the compression of text information using the distribution characteristics of the text, thereby improving the compression efficiency of the text information, and at the same time improving the clarity of text information transmission.

[0066] On the other hand, the information decompression method of the present application includes: parsing the received lossless data packet to obtain text line distribution information; when it is determined that there is a valid text line, the original pixel information of the line obtained by parsing is filled with text line pixels one by one according to the text line distribution information to obtain the text block to be processed. The present application realizes the restoration of the screen pixels of the cloud desktop according to the text blocks in different areas, realizes the transmission and processing of text information by using the distribution characteristics of text, thereby improving the compression efficiency of text information and the clarity of text information transmission.

[0067] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] The accompanying drawings are used to provide further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.

[0069] Figure 1 This is a flowchart of the information compression method of this application;

[0070] Figure 2 This is a schematic diagram of the structure of the information compression device of this application;

[0071] Figure 3 This is a flowchart of the method for decompressing application information;

[0072] Figure 4 This is a schematic diagram of the composition structure of the information decompression device of this application. DETAILED DESCRIPTION

[0073] In a typical configuration of the present application, a computing device includes one or more processors (CPU), an input / output interface, a network interface, and a memory.

[0074] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0075] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory media such as modulated data signals and carrier waves.

[0076] In order to make the purpose, technical solution and advantages of the present application more clear, the embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other arbitrarily without conflict.

[0077] Figure 1 This is a flow chart of the text information compression method of this application, such as Figure 1 As shown, including:

[0078] Step 101: clustering the text blocks to be processed into different text areas according to pixel distribution information.

[0079] According to the values ​​of top2 pixels, the text blocks of the coding unit size are clustered into large text areas. Here, the values ​​of top2 pixels refer to the two types of pixels with the largest proportion in a single text block.

[0080] In an exemplary embodiment, for two types of pixels, such as a first pixel (Y1, U1, V1) and a second pixel (Y2, U2, V2), determining whether the two are similar may include:

[0081] Set a first threshold T1 and a second threshold a1 for determining the degree of similarity between two pixels;

[0082] If |Y1-Y2|<=a1 and |U1-U2|<=a1 and |V1-V2|<=a1, then it is determined that the difference between the first pixel and the second pixel is <=T1, and the first pixel and the second pixel are approximate pixels; otherwise, it is determined that the difference between the first pixel and the second pixel is >T1, and the first pixel and the second pixel are non-approximate pixels.

[0083] The following example illustrates whether to cluster text blocks based on the degree of pixel similarity.

[0084] For example: for the initial state of text block clustering, there is currently no clustered text area. If the difference between the background pixel of the first text block to be clustered and the top2 pixels of the second text block is > T1, the two text blocks will be classified as two independent text areas; if the difference between the background pixel of the first text block and one of the top2 pixels of the second text block is <= T1, the two text blocks are clustered into the same text area, where the background pixel of the clustered text area is taken as the background pixel of the first text block.

[0085] For another example: as the clustering of text blocks proceeds, there are several clustered text areas. If the difference between the top2 pixels of the text block to be clustered and the background pixels of a certain text area is <= T1, then the text block is clustered into this text area. If the difference between the top2 pixels of the text block to be clustered and the background pixels of all existing text areas is > T1, then the text block does not belong to any existing text area and a new text area needs to be added. The background pixels of the newly added text area are taken as the background pixels of the text block.

[0086] Through the loop processing of this step, the text block to be processed is classified into the corresponding text area according to the values ​​of the top2 most important pixels in the text block, which provides the prerequisite for the text block to be split into text lines for the subsequent line feature analysis of the text area, thereby ensuring the subsequent compression of text information by utilizing the distribution characteristics of text, thereby improving the compression efficiency of text and at the same time improving the clarity of text information transmission.

[0087] In an exemplary embodiment, before step 100, the following may also be included:

[0088] Step 100: Determine whether the coding block to be processed is an image block or a text block according to pixel distribution information.

[0089] In an exemplary embodiment, this step may include:

[0090] Image blocks and text blocks are distinguished from the coding block to be processed according to the gradient characteristics and color distribution information of the pixel distribution inside the coding block to be processed.

[0091] In an exemplary instance, in this step, first, according to the requirements of the encoder, macroblocks can be divided according to encoding unit sizes such as 16x16, 32x32, 64x64, etc.; then, the gradient features of the internal pixel distribution of each macroblock are analyzed (i.e., the gradient values are calculated), and the macroblocks are divided into image blocks and text blocks. Further, it may also include: analyzing the pixel color information within the divided text blocks, such as the types of pixel colors, the values of the top 2 pixels, etc., and screening out the text blocks that meet the requirements (for example: setting the pixel type threshold within the text block as A1, setting the difference between the top 2 pixels as T2, and the text block can be finally determined as a text block only if the number of pixel color types within the text block < A1 and the difference between the top 2 pixels within the text block > T2).

[0092] Since the pixel distribution of an image is progressive, the change gradient of pixels is small, while there are many internal boundaries in text, and the change gradient of pixels is large. Therefore, if a gradient threshold T3 is preset, then the macroblocks with gradient values > T3 are determined as text blocks, and the remaining macroblocks are determined as image blocks.

[0093] In an exemplary instance, before this step, it may also include:

[0094] For the changing area in the original screen data, perform color space conversion on the pixels of the original screen data, that is, perform color space conversion on the pixels of the original screen data from the RGB color space to the YUV color space such as the YUV4:4:4 color space.

[0095] Divide the original screen data into blocks according to the encoding unit size to obtain the encoding blocks to be processed.

[0096] Among them, YUV refers to a pixel format in which the luminance parameter and the chrominance parameter are represented separately, Y represents luminance (Luminance, Luma), and U and V represent chrominance (Chrominance, Chroma).

[0097] YUV4:4:4 sampling means that the sampling ratios of the three components, namely the luminance component Y, the chrominance component U, and the chrominance component V, are the same. Therefore, in the generated image, the three component information of each pixel is complete, and each is 8 bits, that is, one byte.

[0098] In an exemplary instance, the changing area in the original screen data may include: the changing area of the virtual desktop to be transmitted.

[0099] Step 102: For each text area, obtain the text line distribution information of the text area according to the foreground pixels of each line in the text area.

[0100] In an exemplary instance, this step may include:

[0101] For each text area, first, use the horizontal histogram projection method to obtain the pixel histogram information of each row of the text area; then, use the local extreme value method to obtain the distribution extreme value of the foreground color pixel on the histogram, and extract the row coordinate information of the row according to the distribution extreme value of the foreground color pixel on the histogram, including the starting coordinate and the ending coordinate of the row. When each row of the text area is processed, record the number of text rows included in the text area.

[0102] Herein, the text line distribution information corresponding to each text area includes, but is not limited to: the number of text lines included in the text area, and the line coordinate information of each text line in the text area.

[0103] Among them, the local extremum method can resist the interference of the table frame and accurately identify the real distribution coordinates of the text line. The row coordinate information of the text line obtained in this step will be used as the input source for subsequent lossless compression.

[0104] It should be emphasized that the implementation of the horizontal histogram projection method and the local extreme value method can refer to the relevant technology, and the specific implementation is not used to limit the protection scope of this application. It should be emphasized here that before compressing and transmitting the text block, the present application will analyze and split the different text areas in the text block and the text lines in the text area according to the background information and foreground information, thereby ensuring that the text information can be compressed using the distribution characteristics of the text, thereby improving the compression efficiency of the text and improving the clarity of the text information transmission.

[0105] In this step, for each text region after clustering, a horizontal histogram projection is performed inside the region, that is, the foreground pixels on each line of the text region are summarized, and the starting position of the line is identified based on the summarized values ​​using the local extreme value method. Through this step, the text region is split into text lines.

[0106] Step 103: Scan each text line according to the obtained text line distribution information to obtain original pixel information of each text line.

[0107] In an exemplary embodiment, this step may include:

[0108] According to the obtained text row distribution information, a certain row in a certain text area is scanned vertically according to the row coordinate information to obtain the original pixel information of the text row.

[0109] For example, starting from the starting coordinate of the row to the ending coordinate of the row, the text row is scanned in a vertical column scanning manner from left to right to obtain the original pixel information included in the text row.

[0110] For another example, starting from the end coordinate of the row to the start coordinate of the row, the text row is scanned in a vertical column scanning manner from right to left to obtain the original pixel information included in the text row.

[0111] It should be noted here that those skilled in the art can easily understand that for the vertical column scanning of each row, as long as the compression and decompression are performed in a corresponding manner, it will suffice.

[0112] The original pixel information of the text line obtained in this step will be used as the input source for subsequent lossless compression.

[0113] Step 104: Losslessly compress the text line distribution information and the scanned original pixel information.

[0114] In this step, the row coordinate information of the text line and the original pixel information of the text line are used as input sources of lossless compression to perform lossless compression to obtain a lossless data packet.

[0115] The lossless data packet obtained after the lossless compression processing in this step is the compression result of the text block to be processed.

[0116] The lossless compression in this step can be implemented using relevant technologies. The specific implementation method is not used to limit the protection scope of this application and will not be repeated here.

[0117] In an exemplary embodiment, if the coding block to be processed includes an image block and a text block, then the present application further includes:

[0118] The image block is compressed, such as lossy compression, to obtain a lossy data packet; the lossless data packet and the lossy data packet are packaged and then transmitted. At this time, the application also includes: distinguishing the lossless data packet from the lossy data packet, such as setting different identifiers.

[0119] In an exemplary embodiment, if the coding block to be processed includes an image block and a text block, then the processing of the image block in the present application further includes:

[0120] Determine the types of blocks adjacent to the left, upper left, and upper of the image block, and if they are all text blocks, classify the type of the image block as a text block. The advantage of this processing in the present application is that it prevents the entire text area from being split into irregular small areas, fully ensures the integrity of the text block area, and improves the accuracy of subsequent text line splitting.

[0121] The information compression method of the present application improves the text compression efficiency and at the same time improves the clarity of text information after transmission.

[0122] An embodiment of the present invention further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the information compression method described in any one of the above items.

[0123] An embodiment of the present invention further provides a device for implementing information compression, including a processor and a memory; wherein the memory stores a computer program that can be run on the processor: used to execute the steps of the above-mentioned information compression method and any of the above-mentioned steps.

[0124] Figure 2 This is a schematic diagram of the structure of the information compression device of this application, such as Figure 2 As shown, it at least includes: a clustering module, a splitting module, a scanning module, and a compression module; wherein,

[0125] A clustering module, used for clustering the text blocks to be processed into different text areas according to pixel distribution information;

[0126] A splitting module is used to obtain text line distribution information of each text area according to the foreground pixels of each line in the text area;

[0127] A scanning module, used for scanning each text line to obtain original pixel information of each text line according to the obtained text line distribution information;

[0128] The compression module is used to perform lossless compression on the text line distribution information and the original pixel information obtained by scanning to obtain a lossless data packet.

[0129] The information compression device of the present application also includes: a preprocessing module, which is used to determine whether the coding block to be processed is an image block or a text block according to pixel distribution information.

[0130] In an exemplary embodiment, the compression module of the present application is also used to: perform lossy compression on the image block to obtain a lossy data packet; and package the lossless data packet and the lossy data packet for transmission.

[0131] In an exemplary embodiment, the present application further includes: a processing module, used to determine the types of blocks adjacent to the left, upper left and above the image block, and if they are all text blocks, classifying the type of the image block as a text block.

[0132] Figure 3 This is a flowchart of the method for decompressing application information. Figure 3 As shown, including:

[0133] Step 300: parse the received lossless data packet to obtain text line distribution information.

[0134] In an exemplary embodiment, a lossless decoding method may be used to decode a lossless data packet to obtain text line distribution information, original pixel information of the line, and the like.

[0135] The text line distribution information corresponds to each text area, including but not limited to: the number of text lines included in the text area, and the line coordinate information (including the starting coordinate and the ending coordinate) of each line in the text area.

[0136] Step 301: When it is determined that there is a valid text line, the original pixel information of the line obtained by parsing is used to fill the text line pixels one by one according to the text line distribution information to obtain the text block to be processed.

[0137] In one exemplary embodiment, determining that there is a valid text line may include:

[0138] If the text line distribution information obtained after parsing shows that the number of text lines in at least one text area is greater than 0, then it indicates that there are valid text lines in the current frame, ie, the currently received data packet.

[0139] In an exemplary embodiment, if there is no line splitting, that is, if there is no valid text line, the decoded data can be directly used to fill the entire large text area.

[0140] In an exemplary embodiment, before step 300, the following may also be included:

[0141] Parsing the received data packet to determine whether the currently received data packet is a lossless data packet of a lossless compression type or a lossy data packet of a lossy compression type;

[0142] If the currently received data packet is a lossless data packet, proceed to step 300; if the currently received data packet is a lossy data packet, directly decode the received lossy data packet;

[0143] At this time, after executing step 301, the method of the present application further includes:

[0144] Placing the decoded data into a data frame, wherein the decoded data may include, for example, lossless decoded data, or lossless decoded data and lossy decoded data;

[0145] According to the color space requirements of the final display, the pixels in the data frame are converted from the YUV color space to the color space required for display.

[0146] In an exemplary embodiment, for example, when the changed area in the original screen data includes: the changed area of ​​the virtual desktop to be transmitted, Figure 3 The method shown restores the screen pixels of the cloud desktop according to the text blocks in different areas, realizes the transmission processing of text information by utilizing the distribution characteristics of text, thereby improving the compression efficiency of text and improving the clarity of text information transmission.

[0147] An embodiment of the present invention further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the information decompression method described in any one of the above items.

[0148] An embodiment of the present invention also provides a device for implementing information decompression, including a processor and a memory; wherein the memory stores a computer program that can be run on the processor: used to execute the steps of the above-mentioned information decompression method and any of the above-mentioned steps.

[0149] Figure 4 This is a schematic diagram of the structure of the information decompression device of this application, such as Figure 4 As shown, it at least includes: a parsing module and a recovery module; wherein,

[0150] A parsing module, used to parse the received lossless data packet to obtain text line distribution information;

[0151] The restoration module is used to fill the text line pixels one by one with the original pixel information of the line obtained by parsing according to the text line distribution information when it is determined that there is a valid text line, so as to obtain the text block to be processed.

[0152] In an exemplary embodiment, determining that there is a valid text line in the recovery module may include:

[0153] If the text line distribution information obtained after parsing shows that the number of text lines in at least one text area is greater than 0, then it indicates that there are valid text lines in the current frame, ie, the currently received data packet.

[0154] In an exemplary embodiment, the parsing module is further configured to:

[0155] Parsing the received data packet to determine whether the currently received data packet is a lossless data packet of a lossless compression type or a lossy data packet of a lossy compression type;

[0156] If the currently received data packet is a lossless data packet, continue to parse the received lossless data packet to obtain text line distribution information; if the currently received data packet is a lossy data packet, directly decode the received lossy data packet;

[0157] Accordingly, the recovery module is also used to:

[0158] Placing the decoded data into a data frame; wherein the decoded data includes, for example, lossless decoded data, or lossless decoded data and lossy decoded data;

[0159] According to the color space requirements of the final display, the pixels in the data frame are converted from the YUV color space to the color space required for display.

[0160] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. An information compression method, comprising: Clustering the text blocks to be processed of the coding unit size into different text areas according to the values ​​of the top2 pixels of the text blocks to be processed, wherein the values ​​of the top2 pixels are the two types of pixels with the largest proportion in a single text block; For each text area, obtaining text line distribution information of the text area according to foreground pixels of each line in the text area; Scan each text line to obtain original pixel information of each text line according to the obtained text line distribution information, wherein the text line is a line of text composed of multiple pixel lines; Losslessly compress the text line distribution information and the scanned original pixel information.

2. The information compression method according to claim 1, further comprising: The coding block to be processed is determined to be an image block or the text block according to the pixel distribution information.

3. The information compression method according to claim 2, further comprising: For the changed area in the original screen data, the color space conversion is performed on the pixels of the original screen data; The original screen data is divided into blocks according to the coding unit size to obtain the coding blocks to be processed.

4. The information compression method according to claim 1, 2 or 3, wherein: The obtaining of text line distribution information of the text area includes: For each of the text regions, a horizontal histogram projection method is used to obtain pixel histogram information of each row of the text region; Use the local extreme value method to obtain the distribution extreme value of the foreground color pixels on the histogram; Extract row coordinate information of the row according to the obtained distribution extreme value; When each line of the text area is processed, the number of text lines included in the text area is recorded; The text line distribution information corresponds to each text area, including: the number of text lines included in the text area, and the line coordinate information of each text line in the text area.

5. The information compression method according to claim 1, 2 or 3, wherein: The obtaining of original pixel information of each text line includes: According to the obtained text row distribution information, vertical column scanning is performed for each text row in each text area according to the row coordinate information to obtain the original pixel information of the text row.

6. The information compression method according to claim 2, when the coding block to be processed includes an image block and a text block, the method further comprises: Perform lossy compression on the image block to obtain a lossy data packet; The lossless data packets and the lossy data packets are packaged and transmitted.

7. The information compression method according to claim 2, when the coding blocks to be processed include image blocks and text blocks, before clustering the text blocks to be processed into different text areas, further comprising: The types of the blocks adjacent to the left, upper left and upper sides of the image block are determined. If all of them are text blocks, the type of the image block is classified as a text block.

8. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the information compression method according to any one of claims 1 to 7.

9. A device for implementing information compression, comprising a processor and a memory; wherein: The memory stores a computer program that can be run on the processor: used to execute the steps of the information compression method described in any one of claims 1 to 7.

10. An information compression device, comprising: A clustering module, a splitting module, a scanning module, and a compression module; wherein the clustering module is used to cluster the text blocks to be processed of the coding unit size into different text areas according to the values ​​of the top2 pixels of the text blocks to be processed, wherein the values ​​of the top2 pixels are the two types of pixels with the largest proportion in a single text block; A splitting module is used to obtain text line distribution information of each text area according to the foreground pixels of each line in the text area; A scanning module, used for scanning each text line to obtain original pixel information of each text line according to the obtained text line distribution information, wherein the text line is a line of text composed of multiple pixel lines; The compression module is used to perform lossless compression on the text line distribution information and the original pixel information obtained by scanning to obtain a lossless data packet.

11. The information compression device according to claim 10, further comprising: The preprocessing module is used to determine whether the coding block to be processed is an image block or the text block according to the pixel distribution information.

12. According to the information compression device of claim 11, the compression module is further used for: performing lossy compression on the image block to obtain a lossy data packet; and packaging the lossless data packet and the lossy data packet for transmission.

13. The information compression device according to claim 11, further comprising: The processing module is used to determine the types of blocks adjacent to the left, upper left and upper sides of the image block. If all of the blocks are text blocks, the type of the image block is classified as a text block.

14. A method for decompressing information, comprising: Parsing the received lossless data packet to obtain text line distribution information, wherein the text line distribution information is obtained according to the information compression method according to claim 1; When it is determined that there is a valid text line, the original pixel information of the line obtained by parsing is used to fill the text line pixels one by one according to the text line distribution information to obtain the text block to be processed.

15. The decompression method according to claim 14, further comprising: Parsing the received data packet to determine whether the currently received data packet is a lossless data packet of a lossless compression type or a lossy data packet of a lossy compression type; If the currently received data packet is the lossless data packet, continue to execute the step of parsing the received lossless data packet; if the currently received data packet is a lossy data packet, decode the received lossy data packet.

16. The decompression method according to claim 15, further comprising: Placing the decoded data into a data frame, wherein the decoded data includes: lossless decoded data, or lossless decoded data and lossy decoded data; According to the color space requirements of the final display, the pixels in the data frame are converted into colors.

17. The decompression method according to claim 14, 15 or 16, wherein: The determining that there is a valid text line includes: If the text line distribution information obtained after parsing shows that the number of text lines in at least one text area is greater than 0, it is determined that the valid text line exists.

18. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the information decompression method according to any one of claims 14 to 17.

19. A device for implementing information decompression, comprising a processor and a memory; wherein: The memory stores a computer program that can be run on the processor: used to execute the steps of the information decompression method described in any one of claims 14 to 17.

20. An information decompression device, comprising: Analysis module, recovery module; among them, A parsing module, used for parsing the received lossless data packet to obtain text line distribution information, wherein the text line distribution information is obtained according to the information compression method according to claim 1; The restoration module is used to fill the text line pixels one by one with the original pixel information of the line obtained by parsing according to the text line distribution information when it is determined that there is a valid text line, so as to obtain the text block to be processed.

21. The information decompression device according to claim 20, wherein the parsing module is further used for: Parsing the received data packet to determine whether the currently received data packet is a lossless data packet of a lossless compression type or a lossy data packet of a lossy compression type; If the currently received data packet is a lossless data packet, continue to parse the received lossless data packet to obtain the text line distribution information; if the currently received data packet is a lossy data packet, decode the received lossy data packet.

22. The information decompression device according to claim 21, wherein the restoration module is further used for: The decoded data is placed into a data frame; wherein, The decoded data includes: lossless decoded data, or lossless decoded data and lossy decoded data; According to the color space requirements of the final display, the pixels in the data frame are converted into colors.

23. The information decompression device according to claim 20, 21 or 22, wherein the determining that there is a valid text line in the restoration module comprises: If the text line distribution information obtained after parsing shows that the number of text lines in at least one text area is greater than 0, it is determined that the valid text line exists.

Citation Information

Patent Citations

  • System for recognizing characters from image

    CN102136064A

  • Method and device for extracting Uighur, Kazakh and Kirgiz text images by rows

    CN102542279A

  • Image encoding apparatus and method of controlling the same

    US20090208125A1