WO2014079036A1 - 图像压缩方法及图像处理装置 - Google Patents

图像压缩方法及图像处理装置 Download PDF

Info

Publication number
WO2014079036A1
WO2014079036A1 PCT/CN2012/085146 CN2012085146W WO2014079036A1 WO 2014079036 A1 WO2014079036 A1 WO 2014079036A1 CN 2012085146 W CN2012085146 W CN 2012085146W WO 2014079036 A1 WO2014079036 A1 WO 2014079036A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
compression
threshold
block
image block
Prior art date
Application number
PCT/CN2012/085146
Other languages
English (en)
French (fr)
Inventor
李超洋
陈普
包成儒
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2012/085146 priority Critical patent/WO2014079036A1/zh
Priority to CN201280002934.8A priority patent/CN104025561A/zh
Publication of WO2014079036A1 publication Critical patent/WO2014079036A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/14Coding unit complexity, e.g. amount of activity or edge presence estimation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock

Definitions

  • the present invention relates to computer technology, and in particular, to an image compression method and an image processing apparatus. Background technique
  • desktop sharing technology is often used in telecommuting, multimedia conferencing, multimedia teaching and other fields.
  • desktop sharing technology has matured, the requirements for terminal devices are not high.
  • various handheld terminals and network devices based on third-generation mobile communication (3rd-generation, 3G) can also be used. Sharing the desktop of the remote server makes the desktop sharing technology more widely used.
  • the existing desktop sharing technology can directly take screenshots on the server side, and obtain the original information of the desktop image through the interface function provided by the operating system, but the data amount of the desktop image of the computer is very large.
  • a 17-inch LCD monitor has a desktop image data of 3.75MB. If the desktop image is captured at 15 frames per second, the amount of data generated in one second is 56.25MB. This amount of data is currently 10M/100M or even When 1000M is transmitted over the Internet, it is easy to cause network congestion and transmission delay. Therefore, it is necessary to effectively compress and encode the desktop image before transmitting the desktop image in real time to obtain a compressed desktop image sequence.
  • the server sends the compressed sequence of desktop images to the client, and the client decodes the received sequence of desktop images to obtain a desktop image of the server.
  • Typical compression algorithms include lossy compression algorithms and lossless compression algorithms.
  • Lossy compression algorithms such as the Joint Photographic Experts Group (JPEG) algorithm, have a high compression ratio, but need to be at the expense of image quality, especially if the text in the image is blurred.
  • Lossy compression algorithms are not suitable for some special application scenarios. For example, in the medical industry, in order to avoid the occurrence of misjudgments, it is not allowed to apply the lossy compression algorithm to desktop sharing. Lossless compression algorithms such as Run-Length Encoding (RED-Like Encoding), LZW (Lempel-Ziv-Welch Encoding) algorithm, etc., can guarantee better reconstruction quality when the desktop image is compressed, but its compression ratio is not as good as loss. The compression algorithm is high. If the lossless compression algorithm is used for the desktop image that does not require high reconstruction quality, compression efficiency will occur. Reduced situation.
  • JPEG Joint Photographic Experts Group
  • the present invention provides an image compression method and an image processing apparatus for taking into account the requirements for compression efficiency and image reconstruction quality in image compression.
  • a first aspect of the present invention provides an image compression method, including:
  • compression is performed by using a lossy compression algorithm to obtain a compressed code stream
  • the method further includes:
  • the original image is image data of a red, green, and blue RGB color space, converting image data of the RGB color space into image data of a YUV color space;
  • the determining the number of color categories included in the image data corresponding to each image block is specifically:
  • the number of color types included in the image data of the YUV color space corresponding to each image block is judged.
  • the image block that is greater than the first threshold for the number of color categories is compressed by using a lossy compression algorithm.
  • compression is performed using a lossy compression algorithm of a second quantization step, the second quantization step being greater than the first quantization step.
  • the image block whose quantity of the color type is less than or equal to the first threshold is compressed by using a lossless compression algorithm.
  • the compressed code stream is specifically:
  • the image data of the RGB color space of the image block whose number of color types is less than or equal to the first threshold is decomposed into a red R component data stream, a green G component data stream, and a blue B component data stream;
  • the compressed R component data stream, the G component data stream, and the B component data stream are combined to obtain a compressed code stream.
  • a second aspect of the present invention provides an image processing apparatus, including:
  • a dividing unit configured to divide the original image into at least one image block
  • a processing unit configured to determine, according to the number of color categories included in the image data corresponding to each image block; for the image block whose number of colors is less than or equal to the first threshold, compressing by using a lossless compression algorithm to obtain compression a code stream; for an image block whose number of colors is greater than the first threshold, compressing with a lossy compression algorithm to obtain a compressed code stream; and sending unit, configured to compress the at least one image block separately
  • the code streams are combined into a unified code stream, and the unified code stream is sent to the client.
  • the image processing apparatus further includes:
  • a conversion unit configured to image data in the original image as a red, green and blue RGB color space And converting the image data of the RGB color space into image data of the YUV color space; correspondingly, the processing unit is specifically configured to:
  • the number of color types included in the image data of the YUV color space corresponding to each image block is judged.
  • the processing unit is specifically configured to:
  • the processing unit is further configured to:
  • an image block whose number of color types is greater than the first threshold and smaller than the second threshold is compressed by a lossy compression algorithm of a first quantization step, the second threshold being greater than the first threshold;
  • An image block having a quantity greater than or equal to the second threshold is compressed by a lossy compression algorithm of a second quantization step size, the second quantization step being greater than the first quantization step.
  • the processing unit is further configured to:
  • a third aspect of the present invention provides an image processing apparatus including a processor, a memory, a bus, and a communication interface; the memory is configured to store a computer execution instruction, and the processor is connected to the memory through the bus.
  • the processor executes the computer-executed instructions stored in the memory when the image processing apparatus is in operation, such that the image processing apparatus performs the image compression method described above.
  • a fourth aspect of the present invention provides a computer readable medium, comprising: computer executable instructions for executing, by the processor of a computer, the computer executing the instructions Like the compression method.
  • FIG. 1 is a flowchart of an embodiment of an image compression method according to an embodiment of the present invention
  • FIG. 2 is a flowchart of another image compression method according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of still another image compression method according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of another image processing apparatus according to an embodiment of the present invention
  • FIG. 6 is a schematic structural diagram of still another image processing apparatus according to an embodiment of the present invention.
  • the application scenario of the embodiments of the present invention is mainly that the client remotely shares the desktop image of the server, and the desktop image of the server may also be referred to as a computer screen image.
  • the image processing device in the embodiments of the present invention may be the same. Server, or a functional module in the server.
  • the desktop image Before the image processing device sends the desktop image to the client, the desktop image needs to be encoded, that is, the desktop image is compressed.
  • Compression standards for natural images and video include lossy compression algorithms such as the JPEG series, H.26X series, and Moving Pictures Experts Group/Mo tin Pictures Experts Group (M PEG-X) series, based on human vision. The characteristics of sensitive features and natural image tones are continuous; the compression standards for text include lossless compression algorithms such as REL algorithm and LZW algorithm.
  • the lossy compression algorithm has a higher compression ratio than the lossless compression algorithm, correspondingly, when the image is reconstructed by the client by decoding, the image compressed by the lossy compression algorithm may be more than the image compressed by the lossless compression algorithm. Distortion.
  • the quality of decoding and restoration of natural images by human eyes is relatively low, even if there is partial loss. The human eye does not have obvious notice, so the effective compression of natural images can be achieved with a lossy compression algorithm. If you use a lossless compression algorithm to compress natural images, it will reduce the compression efficiency. However, if you use a lossy compression algorithm to compress the text, the client will have lower resolution when restoring the text.
  • the lossy compression algorithm is suitable for compression of natural images in desktop images
  • the lossless compression algorithm is suitable for compression of text and graphics in desktop images.
  • the desktop image contains not only natural images, but also a large amount of text and graphics. Therefore, if only the lossy compression algorithm is used to compress the desktop image, the reconstruction quality of the desktop image will be poor. If only the lossless compression algorithm is used Compressing the desktop image will result in lower compression efficiency for compressing the desktop image.
  • a lossy compression algorithm and a lossless compression algorithm are combined to balance the compression efficiency and reconstruction quality of the desktop image compression.
  • FIG. 1 is a flowchart of an embodiment of an image compression method according to an embodiment of the present invention. As shown in FIG. 1, the method includes:
  • the image processing apparatus sends its desktop image to each client when sharing its desktop to one or more clients; before sending, the image processing apparatus needs to first encode and compress the original image of the desktop image, and The compressed original image is sent to the client.
  • the client After receiving the compressed original image, the client can restore the original image of the image processing device after decoding the encoded compressed original image according to the communication protocol between the image processing device and the client.
  • the image compression method in each embodiment of the present invention is performed for each frame image in the original image, and the original image transmitted by the image processing device to the client may be a compressed one or more frame image.
  • the image processing device sends a continuous multi-frame image to the client, the image processing device compresses the encoding of each frame of the original image, and the client receives the original frame for each frame.
  • the manner in which the image is decoded and decompressed can be implemented in various embodiments of the present invention.
  • the entire original image sub-area may be encoded and compressed.
  • the original image is divided into one or more image blocks.
  • the size of the image area of each divided image block is equal for the standard original image; for the non-standard original image, the method of color edge filling may be used to make the image area of each image block Have equal sizes. It can be understood that dividing the original image into equal-sized image blocks is only a preferred implementation manner. If the original image is divided into image blocks of different sizes, the implementation of the method described in the embodiments of the present invention is not affected. The size of each image area that is specifically divided can be set as needed.
  • the original image can be divided into smaller image blocks. If the reconstruction quality of the original image is not high, but the compression efficiency is low. The requirement is higher, and the original image can be divided into larger image blocks; the original image can be divided into image regions of appropriate size according to the trade-off between reconstruction quality and compression efficiency.
  • the image blocks of the original image are sequentially encoded and compressed.
  • the first is to obtain the number of color types of each image block, and according to the type of the color, the corresponding coding compression mode is used for the image block.
  • the image processing device is preset with a first threshold value, and the first threshold value is a basic determination condition to determine whether the image block is an image block mainly composed of characters or graphics.
  • the number of color types of the image block is less than or equal to the first threshold, it indicates that the image content of the image block is mainly text or graphics, and the image block of the type is processed in the manner described in step 103; If the number of color types of the block is greater than the first threshold, it indicates that the image content of the image block is not mainly text or graphics, and the image block of the type is processed in the manner described in step 104.
  • the image content of the image block is mainly text or graphics, and the image block of the type is hereinafter referred to as a text or graphic data block.
  • the reduction algorithm performs compression to obtain a compressed code stream.
  • the image content of the image block is not mainly text or graphics, but may be an image block mainly composed of natural images, or includes Text or graphics, including image blocks of natural images.
  • an image block mainly composed of a natural image is referred to as a natural image data block
  • an image block including both text and graphics and a natural image is referred to as a mixed image data block.
  • a lossy compression algorithm can be used for encoding compression.
  • the image processing apparatus encodes and compresses each image block of the original image in accordance with the above steps. After the encoding and compression of each image block is completed, the data streams encoded by all the image blocks are combined to form a unified code stream, and the synthesized unified code stream is used as the compressed code stream of the desktop image.
  • the image processing device outputs the compressed code stream of the original image to the client; after receiving the code stream, the client according to the related information carried in the code stream and the communication protocol between the image processing device and the client,
  • the code stream is decoded, and the decoded image is a desktop image of the image processing device restored by the client, thereby realizing sharing of one or more frames of the desktop image by the client to the image processing device.
  • the client decodes the received code stream correspondingly, and restores the image corresponding to the code stream, that is, the client performs the image processing apparatus on the image processing apparatus.
  • Desktop sharing is
  • the image compression method provided by the embodiment of the present invention divides the original image into one or more image blocks, and determines a compression algorithm that needs to be used according to the number of color types included in the image block, and the number of color types is less than or equal to
  • a threshold image block is compressed by a lossless compression algorithm with better image reconstruction quality.
  • compression is performed by a lossy compression algorithm with higher compression efficiency, which will be obtained separately.
  • the code streams compressed for each image block are combined into a unified code stream, and the unified code stream is sent to the client.
  • the lossy compression algorithm or the loss compression algorithm is used for encoding compression, which can effectively balance the reconstruction quality and compression efficiency of the desktop image. And have better reconstruction quality and more than just using a single compression algorithm. Large compression ratio; In addition, since there is no need to meticulously classify different types of image blocks, only a rough classification method is needed, so that the calculation complexity is low, and the desktop sharing can have better real-time performance. .
  • FIG. 2 is a flowchart of another image compression method according to an embodiment of the present invention. As shown in FIG. 2, the method may further include:
  • step 102 For details, refer to the implementation manner described in step 102.
  • the method for the image processing apparatus to determine the number of color types included in the image data corresponding to the image block may be:
  • the method for obtaining the histogram is to scan the pixels of the image block and record the number of colors respectively, and the R, G, and B components all have a value range of 0-255, thereby obtaining a histogram of the image block.
  • the image data of the RGB color space is converted into image data of a brightness chromaticity (YUV) color space.
  • YUV can also be called YCrCb
  • Y is the brightness (Luminance or Luma), which is the gray level value
  • U and V are the chromaticity (Chrominance or Chroma).
  • the number of color types included in the image data of the RGB color space corresponding to each image block is determined.
  • the specific operation of converting the image data of the RGB color space into the image data of the YUV color space is performed before the execution of 202. Further, the conversion of the color space of the image data may be performed before the original image is divided, or may be performed separately for each image block after dividing the original image.
  • the corresponding image data respectively has image data in the RGB color space and the number of images in the YUV color space. According to. Regardless of the order of execution between the conversion of the color space and the division of the original image, one or more image blocks are obtained, each image block having image data in the RGB color space and image data in the YUV color space, respectively.
  • step 103 For details, refer to the implementation manner described in step 103.
  • the image data of the RGB color space of the image block whose number of color types is less than or equal to the first threshold value may be Decomposed into a red R component data stream, a green G component data stream, and a blue B component data stream; using a lossless compression algorithm, respectively performing the R component data stream, the G component data stream, and the B component data stream Compression; combining the compressed R component data stream, the G component data stream, and the B component data stream to obtain a compressed code stream.
  • compressing is performed by using a lossy compression algorithm of a first quantization step.
  • the second threshold is greater than the first threshold.
  • the second quantization step size is greater than the first quantization step size.
  • the lossy compression algorithm requires encoding compression for image data in the YUV color space.
  • the lossy compression algorithm by setting the magnitude of the quantization step size, different compression effects are achieved accordingly.
  • the larger the value of the quantization step the higher the compression of the image data, and the lower the reconstruction quality, the higher the compression efficiency.
  • the smaller the value of the quantization step the smaller the compression of the image data, and the corresponding reconstruction The higher the quality, the lower the compression efficiency.
  • the image blocks for which the number of color types is greater than the first threshold may be further divided into natural image data blocks and mixed image data blocks.
  • the image processing apparatus may be further provided with a second threshold value whose value is greater than the value of the first threshold value. Since the more natural images are included in the image block, the fewer the text or graphics, the more the number of color types, and vice versa. The fewer natural images contained in the image block, the more text or graphics, the color type. The less the number.
  • the image processing device performs encoding compression on the determined mixed image data block by using the lossy compression algorithm of the first quantization step; and performs the lossy compression algorithm on the determined natural image data block by using the second quantization step Encoding compression.
  • the value of the second quantization step is greater than the value of the first quantization step.
  • the quantization step size ranges from 1-100. Therefore, compression of natural image data blocks is relatively large, compression efficiency is relatively high, and image reconstruction quality is relatively low; compression of compressed image data blocks is relatively small, compression efficiency is relatively low, and image reconstruction quality is low. Relatively high.
  • the quantization step size for compressing the mixed image data block is set to a smaller value than the quantization step size for compressing the natural image data block, and the image reconstruction quality for compressing the mixed image data block can be improved to improve the mixed image data.
  • step 105 For details, refer to the implementation manner described in step 105.
  • the image compression method provided by the embodiment of the invention has image information of two color spaces for each image block, so that the lossless compression algorithm can be used for encoding compression of the text or graphic data block, and the natural image data block is used for comparison.
  • the lossy compression algorithm with large quantization step size performs coding compression.
  • the lossy compression algorithm with smaller quantization step size is used for encoding compression, so that the text in the mixed image data block can be higher when reconstructed.
  • the definition can also effectively balance the reconstruction quality and compression efficiency of the desktop image, and has better reconstruction quality and larger compression ratio than the method using only a single compression algorithm; Careful classification of different types of image blocks requires only a rough classification, so it has lower computational complexity and enables better real-time sharing of desktops.
  • FIG. 3 is a flowchart of still another image compression method according to an embodiment of the present invention.
  • the embodiment of the present invention differs in color and texture according to text, graphics, and natural images in a desktop image. Characteristics, the overall flow of the encoding method shown in Figure 3 is presented.
  • the execution subject in the embodiment of the present invention is the server image processing apparatus described above.
  • Step 301 Obtain a desktop image.
  • Step 302 Convert the desktop image from the RGB color space to the YUV color space.
  • the RGB color space and the YUV space are only examples of two color spaces, and the optional color space is not limited to this.
  • the lossless compression algorithm needs to be used in image data in the RGB color space
  • the lossy compression algorithm needs to be used in the image data of the YUV color space. Therefore, in the embodiment of the present invention, while retaining the image data of the RGB color space, the image data of the RGB color space is also converted into the image data of the YUV color space, so that the desktop image has two images in the two color spaces. data.
  • Step 303 Divide the desktop image into a plurality of 16 ⁇ 16 image blocks.
  • a desktop image When dividing a desktop image into image blocks, it can be divided into 16 x 16 image blocks, or it can be divided into 32 x 32 or 8 x 8 size or other sizes. If each image block is larger, the compression efficiency of the coding compression is higher, and the reconstruction quality may be lower. If each image block is smaller, the compression efficiency during coding compression is lower, and the reconstruction quality may be lower. high. Therefore, the setting of the size of the divided image blocks depends on the actual requirements for compression efficiency and reconstruction quality, and the image block size of 16 X 16 is a preferred implementation.
  • the number of color categories of each image block is further acquired. It is determined which type of text or graphic data block, natural image data block, or mixed image data block each image block belongs to according to the number of color types.
  • the method of obtaining the number of color types of the image block may be: obtaining the number of color types of the image block according to the histogram information of the image block in the RGB color space.
  • the histogram information to judge the color type of the image block, because the color of the image block mainly composed of text or graphics is simple, the texture changes are severe, and the number of color types in the histogram information is small, and the distribution of the histogram is small.
  • the image blocks based on natural images are rich in color, the texture changes are relatively flat, and the number of color types in the histogram information is large, and the distribution of histograms is continuous, so the use of histogram information can be simple. Efficiently separate the approximate types of image blocks.
  • the first threshold T1 and the second threshold T2 are set, and T1 and T2 are the number thresholds of the two color categories, respectively, and T1 is less than T2.
  • T1 and T2 are the number thresholds of the two color categories, respectively, and T1 is less than T2.
  • T1 is less than T2.
  • T2 is not exceeded, so that an image block whose number of color types Num is greater than or equal to T2 is determined as a natural image data block; for an image block whose number of colors Num is larger than T1 and smaller than T2, the mixed image data can be roughly determined.
  • T1 and T2 are the number thresholds of the two color categories, respectively, and T1 is less than T2.
  • T1 and T2 can be set as needed.
  • a preferred setting is to set T1 to 6, and set T2 to 20. This setting is only an example, and the optional setting is not limited to this.
  • Step 304 If the image block is a text or graphic data block, use the lossless compression coding mode for the RGB color space.
  • the R, G, and B components in the RGB space are respectively compressed to form a compressed code stream of the R component, a compressed code stream of the G component, and a compressed code stream of the B component. Since the data of each of the 1, G, and B components is between 0 and 255, the input requirements of various algorithms such as RLE and LZW can be satisfied, and the compression ratio can be improved.
  • the compressed code stream of the R component, the compressed code stream of the G component, and the compressed code stream of the B component are combined into a compressed mixed code stream, that is, compression of the text or image data block is completed.
  • the client decodes the components into 1, G, and B components according to the code stream order, thereby restoring the image data of the RGB color space, and reconstructing the text or image data block.
  • Step 305 If the image block is a natural image data block, use H.264-based intra prediction coding with a high compression ratio for the YUV color space.
  • the quality of decoding and restoration of the natural image by the human eye is relatively low, and even if there is partial distortion, the human eye does not have much awareness, so the loss of natural image data block is used.
  • the algorithm can achieve efficient compression.
  • the image data of the YUV space of the natural image data block is subjected to H.264-based intra prediction coding, or an encoding algorithm similar to H.264, and the luminance component can be used for 16 X 16, 8 X 8 and 4 X. 4 three intra-coding modes, each mode can also use 9 kinds of prediction directions; for color difference components, 8 x 8 intra-prediction coding modes can be used, and each mode can also use four kinds of modes.
  • the prediction direction is further entropy-encoded by a context-adaptive variable length coding algorithm.
  • Step 306 If the image block is a mixed image data block, use H.264-based intra prediction coding with a low compression ratio for the YUV color space.
  • the image data of the YUV space of the mixed image data block may be subjected to H.264-based intra prediction encoding or H.264-like encoding. algorithm.
  • H.264-based intra prediction encoding or H.264-like encoding. algorithm.
  • Step 307 Form a unified code stream output.
  • the compressed code streams of the respective image blocks of the entire desktop image are combined into a unified stream output.
  • the client decodes according to the code stream according to the communication protocol, thereby restoring the desktop image of the image processing device on the client.
  • the image compression method converts the desktop image from the RGB color space to the YUV color space, and divides the desktop image into non-overlapping image blocks of 16 ⁇ 16 size, according to the color and texture features of each image block.
  • the image block is divided into three types: text or graphic data block, mixed image data block or natural image data block.
  • the text or graphic data block is encoded in the original RGB space by lossless compression coding, and the natural image data block is similar to H.264 intra prediction predictive lossy coding mode, similar to H.264 intra prediction coding for mixed blocks, but to ensure better reconstruction quality, use smaller quantization step size than natural image data blocks , that is, a parameter with a higher compression quality.
  • the image compression method in the embodiment of the present invention is superior to the single image compression method of JPEG, JPEG2000, JPEG-LS, and LZW in terms of compression efficiency and reconstruction quality; and image compression in the embodiment of the present invention
  • the method is simple to classify images, which can effectively reduce the computational complexity. For applications like desktop sharing, better real-time performance can be guaranteed.
  • the method in the above embodiment may also be used, Different types of images are encoded and compressed using a lossless compression algorithm or a lossy compression algorithm.
  • the method for capturing image data by using the GUI instruction is: expanding the display driving function on the server image processing device side, capturing the GUI instruction in the operating system driver layer, and transmitting the instruction and related data directly or through compression to the client, the client After receiving the instruction data, the terminal calls the operating system to reproduce the drawing, thereby reconstructing the desktop of the remote server image processing device to the client.
  • GUI Graphical User Interface
  • GUI instructions and data are typically compressed using a lossless compression algorithm.
  • a lossless compression algorithm uses the method of capturing GUI instructions, since the amount of data is much smaller than the method of directly copying the screen, all are widely used.
  • the most typical example is that Microsoft's operating system, Windows Server, provides remote desktop connectivity.
  • Its remote desktop protocol (RDP) protocol uses the method of capturing GUI commands at the operating system level, and then through command data compression. , redraw the image on the client side.
  • the Citrix desktop protocol also uses the GUI command method to implement an efficient desktop.
  • the method for realizing computer screen image transmission by using GUI instructions needs to be implemented based on a specific platform.
  • the method in the above embodiment can also be used, and the image compression can also be compressed. A certain balance is achieved in terms of efficiency and quality of reconstruction.
  • FIG. 4 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present invention. As shown in FIG. 4, the image processing apparatus includes a dividing unit 11, a processing unit 12, and a transmitting unit 13.
  • a dividing unit 11 configured to divide the original image into at least one image block
  • the processing unit 12 is configured to determine the number of color categories included in the image data corresponding to each image block; for the image block whose number of colors is less than or equal to the first threshold, compress using a lossless compression algorithm to obtain compression a code stream; for an image block whose number of colors is greater than the first threshold, compressing with a lossy compression algorithm to obtain a compressed code stream; and sending unit 13 for respectively separating the at least one image block
  • the compressed code streams are merged into a unified stream, and the unified stream is sent to the client.
  • the method for performing image compression in the image processing apparatus may be referred to the operation steps described in the foregoing method embodiments, and details are not described herein again.
  • An image processing apparatus divides an original image into one or more image blocks, and determines a compression algorithm that needs to be used according to the number of color types included in the image block, and the number of color types is less than or equal to A threshold image block, using image reconstruction quality is better
  • the compression algorithm performs compression, and the image block whose number of colors is larger than the first threshold is compressed by a lossy compression algorithm with higher compression efficiency, and the separately obtained code streams compressed by each image block are combined into a unified code stream. And send the Unicode stream to the client.
  • the lossy compression algorithm or the loss compression algorithm is used for encoding compression, which can effectively balance the reconstruction quality and compression efficiency of the desktop image. And have better reconstruction quality and larger compression ratio than only using a single compression algorithm; in addition, since it is not necessary to classify different types of image blocks, only a rough classification is needed. The mode is sufficient, so it has lower computational complexity, which enables desktop sharing to have better real-time performance.
  • FIG. 5 is a schematic structural diagram of another image processing apparatus according to an embodiment of the present invention. As shown in FIG. 5, the image processing apparatus may further include a converting unit 14.
  • the converting unit 14 is configured to convert image data of the RGB color space into image data of a YUV color space when the original image is image data of a red, green, and blue RGB color space; correspondingly, the processing unit 12 is specific Used for:
  • the number of color types included in the image data of the YUV color space corresponding to each image block is judged.
  • processing unit 12 can also be used to:
  • processing unit 12 can also be used to:
  • an image block whose number of color types is greater than the first threshold and smaller than the second threshold is compressed by a lossy compression algorithm of a first quantization step, the second threshold being greater than the first threshold;
  • An image block having a quantity greater than or equal to the second threshold is compressed by a lossy compression algorithm of a second quantization step size, the second quantization step being greater than the first quantization step.
  • processing unit 12 can also be used to:
  • the method for performing image compression in the image processing apparatus may be referred to the operation steps described in the foregoing method embodiments, and details are not described herein again.
  • the image processing apparatus has image information of two color spaces for each image block, so that the lossless compression algorithm can be used for encoding compression of the text or graphic data block, and the natural image data block is used.
  • the lossy compression algorithm with large quantization step size performs coding compression.
  • the lossy compression algorithm with smaller quantization step size is used for encoding compression, so that the text in the mixed image data block can be higher when reconstructed.
  • the definition can also effectively balance the reconstruction quality and compression efficiency of the desktop image, and has better reconstruction quality and larger compression ratio than the method using only a single compression algorithm; Careful classification of different types of image blocks requires only a rough classification, so it has lower computational complexity and enables better real-time sharing of desktops.
  • FIG. 6 is a schematic structural diagram of still another image processing apparatus according to an embodiment of the present invention.
  • the image processing apparatus includes: a processor 21, a memory 22, a bus 23, and a communication interface 24.
  • the processor 21, the memory 22 and the communication interface 24 are connected by a bus 23 and perform mutual communication.
  • the processor 21 may be a single core or a multi-core central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more configured to implement the embodiments of the present invention. integrated circuit.
  • the memory 22 may be a high speed RAM memory or a non-volatile memory such as at least one disk memory.
  • the memory 22 is used to store the program 221.
  • the program 221 may include program code, and the program code includes a computer execution instruction.
  • the processor 21 runs the program 221 to perform: dividing the original image into at least one image block;
  • a lossy compression algorithm is used Compressing to obtain a compressed code stream
  • the method for performing image compression in the image processing apparatus can refer to the operation steps described in the foregoing method embodiments, and details are not described herein again, and the embodiment of the present invention achieves compression efficiency and image during image compression.
  • the purpose of the invention to rebuild the quality requirements.
  • the embodiment of the present invention further provides a computer readable medium, comprising the computer execution instructions, wherein the computer executes the image compression method in each of the above embodiments when the processor of the computer executes the computer execution instruction.
  • the method includes the steps of the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本发明提供一种图像压缩方法及图像处理装置,其中图像压缩方法包括,将原始图像划分为至少一个图像块;对每个图像块对应的图像数据所包含的颜色种类的数量进行判断;对于颜色种类的数量小于或等于第一阈值的图像块,釆用无损压缩算法进行压缩,获得压缩后的码流;对于颜色种类的数量大于第一阈值的图像块,釆用有损压缩算法进行压缩,获得压缩后的码流;将至少一个图像块分别压缩后的码流合并为统一码流;并将统一码流发送给客户端。由于根据每个图像块颜色种类的数量区分图像块的类型,针对不同类型的图像块,釆用有损压缩算法或损压缩算法进行编码压缩,能够有效地兼顾对桌面图像的重建质量和压缩效率。

Description

图像压缩方法及图像处理装置 技术领域 本发明涉及计算机技术, 尤其涉及一种图像压缩方法及图像处理装置。 背景技术
目前, 桌面共享技术常被应用于远程办公、 多媒体会议、 多媒体教学等 领域。 由于桌面共享技术已日渐成熟, 对终端设备的要求不高, 尤其在无线 通信技术快速发展的背景下, 各种手持终端和基于第三代移动通信 ( 3rd-generation, 3G ) 的网络设备也可以共享远程服务器的桌面, 使得桌面 共享技术得到了更为广泛的应用。
现有的桌面共享技术可以直接在服务器端进行屏幕截图, 通过操作系 统提供的接口函数获取桌面图像的原始信息, 但是计算机桌面图像的数据 量十分庞大。 例如, 17寸液晶显示器的一帧桌面图像数据为 3.75MB , 若 以 15帧 /秒的速度截取桌面图像, 则 1秒钟产生的数据量为 56.25MB , 这 样的数据量在当前 10M/100M甚至 1000M的互联网上进行传输时, 极易 引起网络拥塞和传输延时, 因此需要在实时传输桌面图像前对桌面图像进 行有效的压缩编码, 获得压缩后的桌面图像序列。 服务器将压缩后的桌面 图像序列发送给客户端, 客户端对接收到的桌面图像序列进行解码, 从而 获得服务器的桌面图像。
典型的压缩算法包括有损压缩算法和无损压缩算法。 有损压缩算法例如 联合图像专家小组(Joint Photographic Experts Group, JPEG )算法等, 具有 较高的压缩比, 但是需要以损失图像质量为代价, 尤其图像中的文字会出现 模糊不清的情况, 而且有损压缩算法并不适用于一些特殊的应用场景。 例如 在医疗行业中为了避免出现误判等情况的发生, 不允许将有损压缩算法应用 在桌面共享中。 无损压缩算法例如行程长度编码 ( Run- Length Encoding, RED 算法, LZW ( Lempel-Ziv- Welch Encoding) 算法等, 对桌面图像进行 压缩后能够保证具有较好的重建质量, 但是其压缩比不如有损压缩算法高, 对于对重建质量要求不高的桌面图像若釆用无损压缩算法, 会出现压缩效率 降低的情况。
因此, 现有技术中的图像压缩技术在兼顾压缩效率和重建质量方面存在 不足。 发明内容 本发明提供了一种图像压缩方法及图像处理装置, 用以兼顾图像压缩时 对压缩效率和图像重建质量的要求。
本发明的第一个方面是提供一种图像压缩方法, 包括:
将原始图像划分为至少一个图像块;
对每个图像块对应的图像数据所包含的颜色种类的数量进行判断; 对于颜色种类的数量小于或等于第一阈值的图像块, 釆用无损压缩算 法进行压缩, 获得压缩后的码流;
对于颜色种类的数量大于所述第一阈值的图像块, 釆用有损压缩算法 进行压缩, 获得压缩后的码流;
将所述至少一个图像块分别压缩后的码流合并为统一码流; 并将所述 统一码流发送给客户端。
结合第一个方面的图像压缩方法, 在第一种可能的实现方式中, 所述方 法还包括:
若所述原始图像为红绿蓝 RGB颜色空间的图像数据,将所述 RGB颜 色空间的图像数据转换为 YUV颜色空间的图像数据;
相应地, 所述对每个图像块对应的图像数据所包含的颜色种类的数量 进行判断具体为:
对每个图像块对应的 YUV颜色空间的图像数据所包含的颜色种类的 数量进行判断。
结合第一个方面的第一种可能的实现方式, 在第二种可能的实现方式 中, 所述对每个图像块对应的 YUV颜色空间的图像数据所包含的颜色种 类的数量进行判断具体为:
获取每个图像块对应的 RGB颜色空间的图像数据的直方图信息; 根据每个图像块的直方图信息, 判断每个图像块的图像数据的颜色种 类的数量。 结合第一个方面的第一种可能的实现方式, 在第三种可能的实现方式 中, 所述对于颜色种类的数量大于所述第一阈值的图像块, 釆用有损压缩 算法进行压缩包括:
对于颜色种类的数量大于所述第一阈值, 且小于第二阈值的图像块, 釆用第一量化步长的有损压缩算法进行压缩, 所述第二阈值大于所述第一 阈值;
对于颜色种类的数量大于或等于所述第二阈值的图像块, 釆用第二量 化步长的有损压缩算法进行压缩, 所述第二量化步长大于所述第一量化步 长。
结合第一个方面的第一种可能的实现方式, 在第四种可能的实现方式 中, 所述对于颜色种类的数量小于或等于第一阈值的图像块, 釆用无损压 缩算法进行压缩, 获得压缩后的码流具体为:
将颜色种类的数量小于或等于所述第一阈值的图像块在 RGB颜色空 间的图像数据, 分解为红 R分量数据流、 绿 G分量数据流和蓝 B分量数据 流;
釆用无损压缩算法,分别对所述 R分量数据流、所述 G分量数据流和所 述 B分量数据流进行压缩;
将压缩后的 R分量数据流、 G分量数据流和 B分量数据流合并, 获得压 缩后的码流。
本发明的第二个方面是提供一种图像处理装置, 包括:
划分单元, 用于将原始图像划分为至少一个图像块;
处理单元, 用于对每个图像块对应的图像数据所包含的颜色种类的数 量进行判断; 对于颜色种类的数量小于或等于第一阈值的图像块, 釆用无 损压缩算法进行压缩, 获得压缩后的码流; 对于颜色种类的数量大于所述 第一阈值的图像块, 釆用有损压缩算法进行压缩, 获得压缩后的码流; 发送单元, 用于将所述至少一个图像块分别压缩后的码流合并为统一 码流, 并将所述统一码流发送给客户端。
结合第二个方面的图像处理装置, 在第一种可能的实现方式中, 所述图 像处理装置还包括:
转换单元, 用于在所述原始图像为红绿蓝 RGB 颜色空间的图像数据 时, 将所述 RGB颜色空间的图像数据转换为 YUV颜色空间的图像数据; 相应地, 所述处理单元具体用于:
对每个图像块对应的 YUV颜色空间的图像数据所包含的颜色种类的 数量进行判断。
结合第二个方面的第一种可能的实现方式, 在第二种可能的实现方式 中, 所述处理单元具体用于:
获取每个图像块对应的 RGB颜色空间的图像数据的直方图信息; 根 据每个图像块的直方图信息, 判断每个图像块的图像数据的颜色种类的数 量。
结合第二个方面的第一种可能的实现方式, 在第三种可能的实现方式 中, 所述处理单元还用于:
对于颜色种类的数量大于所述第一阈值, 且小于第二阈值的图像块, 釆用第一量化步长的有损压缩算法进行压缩, 所述第二阈值大于所述第一 阈值; 对于颜色种类的数量大于或等于所述第二阈值的图像块, 釆用第二 量化步长的有损压缩算法进行压缩, 所述第二量化步长大于所述第一量化 步长。
结合第二个方面的第一种可能的实现方式, 在第四种可能的实现方式 中, 所述处理单元还用于:
将颜色种类的数量小于或等于所述第一阈值的图像块在 RGB颜色空 间的图像数据, 分解为红 R分量数据流、 绿 G分量数据流和蓝 B分量数据 流; 釆用无损压缩算法, 分别对所述 R分量数据流、 所述 G分量数据流和所 述 B分量数据流进行压缩; 将压缩后的 R分量数据流、 G分量数据流和 B 分量数据流合并, 获得压缩后的码流。
本发明的第三个方面是提供一种图像处理装置, 包括处理器、存储器、 总线和通信接口; 所述存储器用于存储计算机执行指令, 所述处理器与所 述存储器通过所述总线连接, 当所述图像处理装置运行时, 所述处理器执 行所述存储器存储的所述计算机执行指令, 使得所述图像处理装置执行上 述图像压缩方法。
本发明第四个方面是提供一种计算机可读介质, 包括计算机执行指令, 以供计算机的处理器执行所述计算机执行指令时, 所述计算机执行上述图 像压缩方法。
本发明实施例提供的图像压缩方法及图像处理装置, 将原始图像划分 为一个或多个图像块, 根据图像块中所包含的颜色种类的数量确定需要釆用 的压缩算法, 对颜色种类的数量小于或等于第一阈值的图像块, 釆用图像重 建质量较好的无损压缩算法进行压缩, 对颜色种类的数量大于第一阈值的图 像块, 釆用压缩效率较高的有损压缩算法进行压缩, 将分别获得的对各图像 块压缩后的码流合并为统一码流, 并将统一码流发送给客户端。 附图说明 图 1为本发明实施例提供的图像压缩方法一实施例的流程图;
图 2为本发明实施例提供的另一图像压缩方法的流程图;
图 3为本发明实施例提供的又一图像压缩方法的流程图;
图 4为本发明实施例提供的图像处理装置的结构示意图;
图 5为本发明实施例提供的另一图像处理装置的结构示意图; 图 6为本发明实施例提供的又一图像处理装置的结构示意图。 具体实施方式 本发明各实施例的应用场景主要为, 客户端远程共享服务器的桌面图 像, 服务器的桌面图像也可以称为计算机屏幕图像, 本发明各实施例中所 述的图像处理装置可以为该服务器, 或者该服务器中的功能模块。
在图像处理装置将桌面图像发送给客户端之前, 需要先对桌面图像进 行编码, 也就是对桌面图像进行压缩。 对自然图像和视频的压缩标准包括 JPEG 系列、 H.26X 系列和动态图像专家组 ( Moving Pictures Experts Group/Mo tin Pictures Experts Group, M PEG-X ) 系列等有损压缩算法, 是 基于人类视觉的敏感特性和自然图像色调连续的特征而制定的; 对文本的 压缩标准包括 REL算法和 LZW算法等无损压缩算法。
由于有损压缩算法比无损压缩算法的压缩比更高, 相应地, 在客户端通 过解码对图像进行重建时, 经过有损压缩算法压缩的图像比经过无损压缩算 法压缩的图像可能存在更大程度的失真。但是由于自然图像的色彩信息丰富, 纹理较为平滑, 人眼对自然图像的解码恢复质量相对较低, 即使存在部分失 真人眼也不会有明显的察觉, 因此釆用有损压缩算法即可实现对自然图像的 有效压缩。 若釆用无损压缩算法对自然图像进行压缩,反而会降低压缩效率; 但是若釆用有损压缩算法对文字进行压缩, 会造成客户端对文字进行还原时 的清晰度较低。
有损压缩算法适合于对桌面图像中的自然图像进行的压缩, 无损压缩 算法适合于对桌面图像中的文本和图形进行的压缩。而桌面图像中不仅包含 自然图像, 还可能包含大量的文本和图形, 因此若仅釆用有损压缩算法对 桌面图像进行压缩, 会造成桌面图像的重建质量较差; 若仅釆用无损压缩 算法对桌面图像进行压缩, 会造成对桌面图像的进行压缩的压缩效率较 低。
本发明各实施例中对桌面图像进行压缩的方法中结合了有损压缩算 法和无损压缩算法, 以兼顾对桌面图像进行压缩的压缩效率和重建质量。
图 1为本发明实施例提供的图像压缩方法一实施例的流程图,如图 1所 示, 该方法包括:
101、 将原始图像划分为至少一个图像块。
具体的, 图像处理装置在将其桌面共享给一个或多个客户端时, 将其 桌面图像发送给各客户端; 在发送之前, 图像处理装置需要先将桌面图像 的原始图像进行编码压缩, 将压缩后的原始图像发送给客户端。 客户端在 接收到该压缩后的原始图像之后, 根据图像处理装置与客户端之间的通信 协议, 在对编码压缩的原始图像进行解码之后, 即可还原出图像处理装置 的原始图像。
本发明各实施例中图像压缩方法是针对原始图像中的每一帧图像进行 的, 图像处理装置向客户端发送的原始图像可以是压缩后的一帧或多帧图 像。
在实际的共享桌面的过程中, 图像处理装置向客户端发送的是连续的 多帧图像, 图像处理装置对每一帧原始图像的编码压缩的方式, 以及客户 端对接收到的每一帧原始图像的解码解压缩的方式, 均可以釆用本发明各 实施例中的实现方式。
图像处理装置在对原始图像进行编码压缩时, 可以对整个原始图像分 区域进行编码压缩。 将原始图像被划分为一个或多个图像块。 为了便于处理, 对于标准的原始图像, 划分出的各图像块的图像区域 的大小是相等的;对于非标准的原始图像,可以釆用颜色边缘补齐的方法, 以使得各图像块的图像区域具有相等的大小。 可以理解的是, 将原始图像 划分为大小相等的图像块仅为一种优选的实现方式, 若将原始图像划分为 大小不相等的图像块并不影响本发明各实施例所述方法的实现。 具体划分 的每个图像区域的大小可以根据需要进行设置。 若对原始图像的重建质量 的要求比较高, 且对压缩效率的要求并不高, 可以将原始图像划分为较小 的图像块; 若对原始图像的重建质量的要求不高, 但是对压缩效率的要求 较高, 可以将原始图像划分为较大的图像块; 具体可以根据对重建质量和 压缩效率的权衡, 将原始图像划分为适当大小的图像区域。
102、 对每个图像块对应的图像数据所包含的颜色种类的数量进行判 断。
具体的, 图像处理装置在将原始图像划分为一个或多个图像块之后, 对原始图像的各图像块依次进行编码压缩。 在对每个图像块进行编码压缩 时, 首先是获取每个图像块的颜色种类的数量, 根据颜色种类的不同, 分 别对图像块釆用相应的编码压缩方式。
图像处理装置中预先设置有第一阈值, 以该第一阈值为基本的判断条 件, 以判定图像块是否是以文字或图形为主的图像块。
若图像块的颜色种类的数量小于或等于该第一阈值, 则说明该图像块 的图像内容以文字或图形为主, 对该类型的图像块, 按照步骤 103所述的 方式进行处理; 若图像块的颜色种类的数量大于该第一阈值, 则说明该图 像块的图像内容并非以文字或图形为主,对该类型的图像块,按照步骤 104 所述到的方式进行处理。
103、 对于颜色种类的数量小于或等于第一阈值的图像块, 釆用无损 压缩算法进行压缩, 获得压缩后的码流。
具体的, 若图像块的颜色种类的数量小于或等于该第一阈值, 则判断 出该图像块的图像内容以文本或图形为主, 以下将该类型的图像块称为文 本或图形数据块。
针对文本或图形数据块, 需要釆用无损压缩算法进行编码压缩。
104、 对于颜色种类的数量大于所述第一阈值的图像块, 釆用有损压 缩算法进行压缩, 获得压缩后的码流。
具体的, 若图像块的颜色种类的数量大于该第一阈值, 则判断出该图 像块的图像内容并非以文本或图形为主, 而可能为以自然图像为主的图像 块, 或者为既包括文本或图形, 又包括自然图像的图像块。 以下将以自然 图像为主的图像块称为自然图像数据块, 将既包括文本或图形, 又包括自 然图像的图像块称为混合图像数据块。
针对自然图像数据块和混合图像数据块, 可以釆用有损压缩算法进行 编码压缩。
105、 将所述至少一个图像块分别压缩后的码流合并为统一码流; 并 将所述统一码流发送给客户端。
图像处理装置按照上述步骤分别对原始图像的各个图像块进行编码 压缩。 在完成对各个图像块的编码压缩之后, 将全部图像块编码后的数据 流进行合成, 形成统一码流, 并将合成的统一码流作为该桌面图像的压缩 后的码流。
图像处理装置将原始图像的压缩后的码流输出, 发送给客户端; 客户 端在接收到该码流之后, 根据码流中携带的相关信息和图像处理装置与客 户端之间的通信协议, 对该码流进行解码, 解码后得到的图像即为客户端 还原出的图像处理装置的桌面图像, 从而实现客户端对图像处理装置的一 帧或多帧桌面图像的共享。 进而, 当图像处理装置连续地将压缩后的桌面 图像发送给客户端, 客户端相应地对接收到的码流进行解码, 还原出码流 对应的图像时, 即实现客户端对图像处理装置的桌面的共享。
本发明实施例提供的图像压缩方法,将原始图像划分为一个或多个图像 块, 根据图像块中所包含的颜色种类的数量确定需要釆用的压缩算法, 对颜 色种类的数量小于或等于第一阈值的图像块, 釆用图像重建质量较好的无损 压缩算法进行压缩, 对颜色种类的数量大于第一阈值的图像块, 釆用压缩效 率较高的有损压缩算法进行压缩, 将分别获得的对各图像块压缩后的码流合 并为统一码流, 并将统一码流发送给客户端。 由于根据每个图像块颜色种类 的数量区分图像块的类型, 针对不同类型的图像块, 釆用有损压缩算法或损 压缩算法进行编码压缩, 能够有效地兼顾对桌面图像的重建质量和压缩效 率, 并且与仅釆用单一的压缩算法的方式相比, 具有更好的重建质量, 更 大的压缩比; 此外, 由于不需要对图像块的不同类型进行细致分类, 只需 要釆用粗略的分类方式即可, 因此具有较低的计算复杂度, 能够使得桌面 共享具有较好的实时性。
图 2为本发明实施例提供的另一图像压缩方法的流程图, 如图 2所示, 该方法还可以包括:
201、 将原始图像划分为至少一个图像块。
具体的, 可以参见步骤 101中所述的实现方式。
202、 对每个图像块对应的图像数据所包含的颜色种类的数量进行判 断。
具体的, 可以参见步骤 102中所述的实现方式。
进一步地, 图像处理装置判断图像块对应的图像数据所包含的颜色种 类的数量的方法可以为:
获取每个图像块对应的红绿蓝 ( Red Green Blue , RGB )颜色空间的 图像数据的直方图信息; 根据每个图像块的直方图信息, 判断每个图像块 的图像数据的颜色种类的数量。
获取直方图的方法为,对图像块的像素进行扫描,分别记录颜色个数, R、 G、 B分量的取值范围均为 0-255 , 从而得到该图像块的直方图。
相应地, 在执行步骤 202之前, 若所述原始图像为 RGB颜色空间的 图像数据, 将所述 RGB颜色空间的图像数据转换为明亮度色度( YUV ) 颜色空间的图像数据。 其中, YUV也可以被称为 YCrCb; Y表示明亮度 ( Luminance或 Luma ) , 即灰阶值; U和 V表示色度 ( Chrominance或 Chroma ) 。
进而对每个图像块对应的 RGB颜色空间的图像数据所包含的颜色种 类的数量进行判断。
具体将 RGB颜色空间的图像数据转换为 YUV颜色空间的图像数据的 操作步骤需要在执行 202之前进行。 此外, 进行图像数据的颜色空间的转 换, 可以在对原始图像进行划分之前进行, 也可以在对原始图像进行划分 之后, 针对每个图像块分别进行。
图像处理装置在完成对图像数据的颜色空间的转换之后, 相应的图像 数据分别具有在 RGB颜色空间的图像数据和在 YUV颜色空间的图像数 据。 无论对颜色空间的转换与对原始图像的划分之间执行的先后顺序, 均 获得一个或多个图像块, 每个图像块分别具有在 RGB颜色空间的图像数 据和在 YUV颜色空间的图像数据。
203、 对于颜色种类的数量小于或等于第一阈值的图像块, 釆用无损 压缩算法进行压缩, 获得压缩后的码流。
具体的, 可以参见步骤 103中所述的实现方式。
此外, 由于无损压缩算法需要针对图像块在 RGB颜色空间的图像数 据进行编码压缩, 因此, 进一步地, 可以将颜色种类的数量小于或等于所 述第一阈值的图像块在 RGB颜色空间的图像数据,分解为红 R分量数据流、 绿 G分量数据流和蓝 B分量数据流; 釆用无损压缩算法, 分别对所述 R分 量数据流、 所述 G分量数据流和所述 B分量数据流进行压缩; 将压缩后的 R 分量数据流、 G分量数据流和 B分量数据流合并, 获得压缩后的码流。
204、 对于颜色种类的数量大于所述第一阈值, 且小于第二阈值的图 像块, 釆用第一量化步长的有损压缩算法进行压缩。
其中, 所述第二阈值大于所述第一阈值。
205、 对于颜色种类的数量大于或等于所述第二阈值的图像块, 釆用 第二量化步长的有损压缩算法进行压缩。
其中, 所述第二量化步长大于所述第一量化步长。
具体的, 有损压缩算法需要针对 YUV颜色空间的图像数据进行编码 压缩。 在有损压缩算法中, 通过设置量化步长的数值大小, 相应地实现不 同的压缩效果。 量化步长的数值越大, 则对图像数据的压缩比较高, 相应 地重建质量将越低, 压缩效率越高; 量化步长的数值越小, 则对图像数据 的压缩比较小, 相应地重建质量将越高, 压缩效率较低。
针对颜色种类的数量大于第一阈值的图像块, 可以进一步地区分为自 然图像数据块和混合图像数据块。 图像处理装置中除了预先设定有第一阈 值以外,还可以设定有第二阈值,该第二阈值的数值大于第一阈值的数值。 由于图像块中包含的自然图像越多, 文本或图形越少, 则其颜色种类的数 量越多, 反之同理, 图像块中包含的自然图像越少, 文本或图形越多, 则 其颜色种类的数量越少。因此,若图像块的颜色种类的数量大于第一阈值, 但是小于第二阈值, 则判定该图像块为混合图像数据块; 若图像块的颜色 种类的数量大于或等于第二阈值, 则判定该图像块为自然图像数据块。 图像处理装置对判断出的混合图像数据块, 釆用第一量化步长的有损 压缩算法进行编码压缩; 对判断出的自然图像数据块, 釆用第二量化步长 的有损压缩算法进行编码压缩。 其中, 第二量化步长的数值大于第一量化 步长的数值。 通常, 量化步长的取值范围为 1-100。 因此, 对自然图像数 据块进行压缩的压缩比较大, 压缩效率相对较高, 图像的重建质量相对较 低; 对混合图像数据块进行压缩的压缩比较小, 压缩效率相对较低, 图像 的重建质量相对较高。
将对混合图像数据块进行压缩的量化步长设置为比对自然图像数据 块进行压缩的量化步长更小的数值, 可以提高对混合图像数据块进行压缩 的图像重建质量, 以提高混合图像数据块中的文字或图形在被客户端还原 时的清晰度。
206、 将所述至少一个图像块分别压缩后的码流合并为统一码流; 并 将所述统一码流发送给客户端。
具体的, 可以参见步骤 105中所述的实现方式。
本发明实施例提供的图像压缩方法, 由于每个图像块均具有两种颜色 空间的图像信息, 使得能够针对文本或图形数据块釆用无损压缩算法进行 编码压缩, 对自然图像数据块釆用较大量化步长的有损压缩算法进行编码 压缩, 对于混合图像数据块釆用较小量化步长的有损压缩算法进行编码压 缩, 使得混合图像数据块中的文字在重建时能够具有更高的清晰度, 还能 够有效地兼顾对桌面图像的重建质量和压缩效率, 并且与仅釆用单一的压 缩算法的方式相比, 具有更好的重建质量, 更大的压缩比; 此外, 由于不 需要对图像块的不同类型进行细致分类, 只需要釆用粗略的分类方式即 可, 因此具有较低的计算复杂度, 能够使得桌面共享具有较好的实时性。
图 3为本发明实施例提供的又一图像压缩方法的流程图,为了能够对桌 面图像进行实时有效的编码, 本发明实施例根据桌面图像中文本、 图形和自 然图像在色彩和纹理上的不同特性, 提出了如图 3所示的编码方法的总体流 程。 本发明实施例中的执行主体为上述服务器图像处理装置。
步骤 301、 获取桌面图像。
步骤 302、 将桌面图像由 RGB颜色空间转换到 YUV颜色空间。 需要说明的是, RGB颜色空间和 YUV空间仅为两种颜色空间的举例, 可选的颜色空间并不仅限于此。
由于无损压缩算法需要使用在 RGB颜色空间的图像数据中, 有损压 缩算法需要使用在 YUV颜色空间的图像数据中。 因此, 在本发明实施例 中在保留 RGB颜色空间的图像数据的同时,还将 RGB颜色空间的图像数 据转换为 YUV颜色空间的图像数据, 从而桌面图像具有在两种颜色空间 中的两份图像数据。
步骤 303、 将桌面图像划分为多个 16 X 16的图像块。
在将桌面图像划分为图像块时, 可以划分为 16 x 16大小的图像块, 也可 以划分为 32 x 32或者 8 x 8大小或者其他大小的图像块。 若划分的每个图像 块较大时, 则编码压缩的压缩效率较高, 重建质量可能较低; 若划分的每个 图像块较小时, 则编码压缩时的压缩效率较低, 重建质量可能较高。 因此, 对于所划分的图像块的大小的设置, 取决于实际对压缩效率和重建质量的要 求, 16 X 16的图像块大小为一种优选的实现方式。
对于非标准的桌面图像, 可以釆用颜色边缘补齐的方法, 对划分时不满 足划分大小的图像区域通过补 0等方式,以使所获得的图像块的大小均相同。
在获得了桌面图像的一个或多个图像块之后, 进一步地获取各图像块的 颜色种类的数量。根据颜色种类的数量判断各图像块属于文本或图形数据块、 自然图像数据块或混合图像数据块中的哪一种类型。
具体的,获取图像块的颜色种类的数量的方法可以为,根据图像块在 RGB 颜色空间中的直方图信息, 获取图像块的颜色种类的数量。
釆用直方图信息判断图像块的颜色种类, 是因为通常以文本或图形为主 的图像块的色彩简单、 纹理变化比较剧烈, 其直方图信息中的颜色种类的数 量较少, 直方图的分布呈离散态; 而以自然图像为主的图像块的色彩丰富, 纹理变化比较平緩, 其直方图信息中的颜色种类的数量较多, 直方图的分布 呈连续态, 所以利用直方图信息可以简单高效地区分出图像块的大致类型。
设定第一阈值 T1和第二阈值 T2, T1和 T2分别为两个颜色种类的数量 阈值, T1 小于 T2。 对于简单的以文本或图形为主的图像块, 其颜色种类的 数量不会超过 T1 ,故将颜色种类的数量 Num小于或等于 T1的图像块判定为 文本或图形数据块; 对于包含较多文本或图形的图像块, 其颜色种类的数量 一般不会超过 T2,故将颜色种类的数量 Num大于或等于 T2的图像块判定为 自然图像数据块; 对于颜色种类的数量 Num大于 T1且小于 T2的图像块, 可粗略地判定为混合图像数据块。 这样的分类方式虽然较为粗略, 但是能保 证较高的压缩效率。
其中, T1和 T2的数值可以根据需要进行设置。 一种优选的设置方式为, 将 T1设置为 6, 将 T2设置为 20, 此设置方式仅为一种举例说明, 可选的设 置方式并不仅限于此。
步骤 304、若图像块为文本或图形数据块, 则对 RGB颜色空间釆用无 损压缩编码方式。
由于文本或图形数据块具有强烈的边缘与形状特征,人眼对文本 /图形 信息敏感,对其的解码恢复质量要求较高, 因而无损压缩方法是最佳选择。 通常的无损压缩算法, 例如 LZ W编码 ( Encoding ) 算法、 RLE算法和游 程编码等。 这些压缩算法都需要在 RGB颜色空间的图像数据中进行编码。
为提高压缩比, 将 RGB空间中 R、 G、 B分量分别进行压缩, 形成 R 分量的压缩码流、 G分量的压缩码流和 B分量的压缩码流。 由于每个1 、 G、 B分量的数据都在 0 - 255之间, 可满足使用 RLE、 LZW等多种算法 的输入要求, 同时也能提升压缩比。 将 R分量的压缩码流、 G分量的压缩 码流和 B分量的压缩码流合成为压缩后的混合码流,即完成对文本或图像 数据块的压缩。 对于该混合码流, 客户端在进行解码时, 按照码流顺序分 别解码为 1 、 G、 B分量, 进而还原出 RGB颜色空间的图像数据, 完成对 文本或图像数据块的重建。
步骤 305、 若图像块为自然图像数据块, 则对 YUV颜色空间釆用高 压缩率的基于 H.264的帧内预测编码。
由于自然图像的色彩信息丰富, 纹理较平滑, 人眼对自然图像的解码 恢复质量相对较低, 即使有部分失真人眼也不会有太大觉察, 因而对自然 图像数据块釆用有损压缩算法可以实现有效的压缩。
本发明对自然图像数据块的 YUV空间的图像数据釆用基于 H.264的 帧内预测编码,或者类似 H.264的编码算法,对亮度分量可以釆用 16 X 16、 8 X 8和 4 X 4三种帧内编码模式 , 每种模式还可以釆用 9种预测方向; 对 于色差分量可以釆用 8 x 8 帧内预测编码模式, 每种模式还可以釆用四种 预测方向; 进而釆用基于上下文自适应的可变长编码算法, 进行熵编码。 通过釆用加大量化步长的方法, 增大压缩比, 降低图像质量, 可以保证整 幅图像的高压缩比。
步骤 306、 若图像块为混合图像数据块, 则对 YUV颜色空间釆用低 压缩率的基于 H.264的帧内预测编码。
由于混合图像数据块中可能既包含文本或图形还包含自然图像, 因此 对混合图像数据块的 YUV空间的图像数据, 可以釆用基于 H.264的帧内 预测编码, 或者类似 H.264的编码算法。 通过量化步长来控制解码图像的 失真度, 通常釆用减小量化步长来实现近似无损压缩。 从而简单有效地实 现对混合图像数据块的压缩编码。
步骤 307、 形成统一码流输出。
最后, 将整个桌面图像的各图像块的压缩后的码流合并为统一码流输 出。 将形成的统一码流发送给客户端之后, 客户端根据通信协议依据码流 顺序进行解码, 从而在客户端还原出图像处理装置的桌面图像。
本发明实施例提供的图像压缩方法, 将桌面图像由 RGB颜色空间转 换到 YUV颜色空间, 将桌面图像划分为 16 x 16大小的非重叠的图像块, 根据每个图像块的色彩和纹理特征, 将图像块分为文本或图形数据块、 混 合图像数据块或自然图像数据块三类,对文本或图形数据块在原始的 RGB 空间釆用无损压缩编码方式, 对自然图像数据块釆用类似于 H.264帧内预 测的有损编码方式, 对混合块也釆用类似于 H.264帧内预测编码, 但为了 保证更好的重建质量, 釆用比自然图像数据块更小的量化步长, 即更高压 缩质量的参数。 无论在压缩效率方面还是重建质量方面, 本发明实施例中 的图像压缩方法均优于单一釆用 JPEG、 JPEG2000, JPEG-LS , LZW传统 的图像压缩方法; 并且由于本发明实施例中的图像压缩方法对图像的分类 较为简单, 能够有效地降低计算的复杂度, 对类似桌面共享类的应用, 可 以保证更好的实时性。
此外, 在利用图形用户界面 ( Graphical User Interface , GUI ) 指令捕 获桌面图像数据进行桌面共享的方法中, 当涉及到需要对图像进行压缩的 操作时, 也可以釆用上述实施例中的方法, 针对不同类型的图像, 釆用无 损压缩算法或有损压缩算法进行编码压缩。 具体的, 利用 GUI指令捕获图像数据的方式为, 在服务器图像处理装 置端, 扩展显示驱动功能, 在操作***驱动层捕获 GUI指令, 将指令和相 关数据直接或经过压缩后传递到客户端, 客户端接收到指令数据后, 再调 用操作***重现绘制, 从而把远端服务器图像处理装置的桌面重建到客户 端。
为了进一步减少指令和数据量,通常釆用无损压缩算法对 GUI指令和 数据进行压缩。釆用捕获 GUI指令的方法, 由于数据量较直接拷贝屏幕的 方法要小很多, 所有被广泛使用。 最典型的如, 微软的操作*** Windows Server提供远程桌面连接功能, 其釆用的远程桌面协议( Remote Desktop Protocol, RDP ) 协议, 釆用了在操作***层面捕获 GUI指令方法, 然后 通过指令数据压缩, 在客户端重新绘制图像。 思杰公司桌面协议同样釆用 了 GUI指令方法实现了高效的桌面。
利用 GUI指令实现计算机屏幕图像传输的方法需要基于特定平台实 现, 在该方法中对于涉及到需要对图像进行压缩的操作时, 也可以釆用上 述实施例中的方法, 同样可以在图像压缩的压缩效率和重建质量方面达到 一定的平衡。
图 4为本发明实施例提供的图像处理装置的结构示意图, 如图 4所示, 该图像处理装置包括划分单元 11、 处理单元 12和发送单元 13。
划分单元 11 , 用于将原始图像划分为至少一个图像块;
处理单元 12,用于对每个图像块对应的图像数据所包含的颜色种类的 数量进行判断; 对于颜色种类的数量小于或等于第一阈值的图像块, 釆用 无损压缩算法进行压缩, 获得压缩后的码流; 对于颜色种类的数量大于所 述第一阈值的图像块, 釆用有损压缩算法进行压缩, 获得压缩后的码流; 发送单元 13 ,用于将所述至少一个图像块分别压缩后的码流合并为统 —码流, 并将所述统一码流发送给客户端。
具体的, 图像处理装置进行图像压缩的方法, 可以参见上述对应的方 法实施例中所述的操作步骤, 此处不再赘述。
本发明实施例提供的图像处理装置,将原始图像划分为一个或多个图像 块, 根据图像块中所包含的颜色种类的数量确定需要釆用的压缩算法, 对颜 色种类的数量小于或等于第一阈值的图像块, 釆用图像重建质量较好的无损 压缩算法进行压缩, 对颜色种类的数量大于第一阈值的图像块, 釆用压缩效 率较高的有损压缩算法进行压缩, 将分别获得的对各图像块压缩后的码流合 并为统一码流, 并将统一码流发送给客户端。 由于根据每个图像块颜色种类 的数量区分图像块的类型, 针对不同类型的图像块, 釆用有损压缩算法或损 压缩算法进行编码压缩, 能够有效地兼顾对桌面图像的重建质量和压缩效 率, 并且与仅釆用单一的压缩算法的方式相比, 具有更好的重建质量, 更 大的压缩比; 此外, 由于不需要对图像块的不同类型进行细致分类, 只需 要釆用粗略的分类方式即可, 因此具有较低的计算复杂度, 能够使得桌面 共享具有较好的实时性。
图 5 为本发明实施例提供的另一图像处理装置的结构示意图, 如图 5 所示, 该图像处理装置还可以包括转换单元 14。
转换单元 14,用于在所述原始图像为红绿蓝 RGB颜色空间的图像数据 时, 将所述 RGB颜色空间的图像数据转换为 YUV颜色空间的图像数据; 相应地, 所述处理单元 12具体用于:
对每个图像块对应的 YUV颜色空间的图像数据所包含的颜色种类的 数量进行判断。
进一步地, 所述处理单元 12还可以用于:
获取每个图像块对应的 RGB颜色空间的图像数据的直方图信息; 根 据每个图像块的直方图信息, 判断每个图像块的图像数据的颜色种类的数 量。
进一步地, 所述处理单元 12还可以用于:
对于颜色种类的数量大于所述第一阈值, 且小于第二阈值的图像块, 釆用第一量化步长的有损压缩算法进行压缩, 所述第二阈值大于所述第一 阈值; 对于颜色种类的数量大于或等于所述第二阈值的图像块, 釆用第二 量化步长的有损压缩算法进行压缩, 所述第二量化步长大于所述第一量化 步长。
进一步地, 所述处理单元 12还可以用于:
将颜色种类的数量小于或等于所述第一阈值的图像块在 RGB颜色空 间的图像数据, 分解为红 R分量数据流、 绿 G分量数据流和蓝 B分量数据 流; 釆用无损压缩算法, 分别对所述 R分量数据流、 所述 G分量数据流和所 述 B分量数据流进行压缩; 将压缩后的 R分量数据流、 G分量数据流和 B 分量数据流合并, 获得压缩后的码流。
具体的, 图像处理装置进行图像压缩的方法, 可以参见上述对应的方 法实施例中所述的操作步骤, 此处不再赘述。
本发明实施例提供的图像处理装置, 由于每个图像块均具有两种颜色 空间的图像信息, 使得能够针对文本或图形数据块釆用无损压缩算法进行 编码压缩, 对自然图像数据块釆用较大量化步长的有损压缩算法进行编码 压缩, 对于混合图像数据块釆用较小量化步长的有损压缩算法进行编码压 缩, 使得混合图像数据块中的文字在重建时能够具有更高的清晰度, 还能 够有效地兼顾对桌面图像的重建质量和压缩效率, 并且与仅釆用单一的压 缩算法的方式相比, 具有更好的重建质量, 更大的压缩比; 此外, 由于不 需要对图像块的不同类型进行细致分类, 只需要釆用粗略的分类方式即 可, 因此具有较低的计算复杂度, 能够使得桌面共享具有较好的实时性。
图 6为本发明实施例提供的又一图像处理装置的结构示意图, 如图 6 所示, 该图像处理装置包括: 处理器 21、 存储器 22、 总线 23和通信接口 24。 处理器 21、 存储器 22和通信接口 24之间通过总线 23连接并完成相 互间的通信。
处理器 21可能为单核或多核中央处理单元 ( Central Processing Unit, CPU ) , 或者为特定集成电路( Application Specific Integrated Circuit, 简 称 ASIC ) , 或者为被配置成实施本发明实施例的一个或多个集成电路。 存储器 22可以为高速 RAM存储器,也可以为非易失性存储器( non-volatile memory ) , 例如至少一个磁盘存 4诸器。
存储器 22用于存放程序 221。具体的,程序 221中可以包括程序代码, 所述程序代码包括计算机执行指令。
当所述图像处理装置运行时, 处理器 21运行程序 221 , 以执行: 将原始图像划分为至少一个图像块;
对每个图像块对应的图像数据所包含的颜色种类的数量进行判断; 对于颜色种类的数量小于或等于第一阈值的图像块, 釆用无损压缩算 法进行压缩, 获得压缩后的码流;
对于颜色种类的数量大于所述第一阈值的图像块, 釆用有损压缩算法 进行压缩, 获得压缩后的码流;
将所述至少一个图像块分别压缩后的码流合并为统一码流; 并将所述 统一码流发送给客户端。
具体的, 图像处理装置进行图像压缩的方法, 可以参见上述对应的方 法实施例中所述的操作步骤, 此处不再赘述, 并由此实现本发明实施例兼 顾图像压缩时对压缩效率和图像重建质量的要求的发明目的。
本发明实施例还提供一种计算机可读介质, 包括上述计算机执行指 令, 以供计算机的处理器执行所述计算机执行指令时, 所述计算机执行上 述各实施例中的图像压缩方法。
本领域普通技术人员可以理解: 实现上述方法实施例的全部或部分步骤 可以通过程序指令相关的硬件来完成, 前述的程序可以存储于一计算机可读 取存储介质中, 该程序在执行时, 执行包括上述方法实施例的步骤; 而前述 的存储介质包括: ROM, RAM, 磁碟或者光盘等各种可以存储程序代码的介 质。
最后应说明的是: 以上各实施例仅用以说明本发明的技术方案, 而非对 其限制; 尽管参照前述各实施例对本发明进行了详细的说明, 本领域的普通 技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改, 或者对其中部分或者全部技术特征进行等同替换; 而这些修改或者替换, 并 不使相应技术方案的本质脱离本发明各实施例技术方案的范围。

Claims

权 利 要 求 书
1、 一种图像压缩方法, 其特征在于, 包括:
将原始图像划分为至少一个图像块;
对每个图像块对应的图像数据所包含的颜色种类的数量进行判断; 对于颜色种类的数量小于或等于第一阈值的图像块, 釆用无损压缩算 法进行压缩, 获得压缩后的码流;
对于颜色种类的数量大于所述第一阈值的图像块, 釆用有损压缩算法 进行压缩, 获得压缩后的码流;
将所述至少一个图像块分别压缩后的码流合并为统一码流; 并将所述 统一码流发送给客户端。
2、 根据权利要求 1所述的图像压缩方法, 其特征在于, 所述方法还包 括:
若所述原始图像为红绿蓝 RGB颜色空间的图像数据,将所述 RGB颜 色空间的图像数据转换为 YUV颜色空间的图像数据;
相应地, 所述对每个图像块对应的图像数据所包含的颜色种类的数量 进行判断包括:
对每个图像块对应的 YUV颜色空间的图像数据所包含的颜色种类的 数量进行判断。
3、 根据权利要求 2所述的图像压缩方法, 其特征在于, 所述对每个图 像块对应的 YUV颜色空间的图像数据所包含的颜色种类的数量进行判断 包括:
获取每个图像块对应的 RGB颜色空间的图像数据的直方图信息; 根据每个图像块的直方图信息, 判断每个图像块的图像数据的颜色种 类的数量。
4、 根据权利要求 2所述的图像压缩方法, 其特征在于, 所述对于颜色 种类的数量大于所述第一阈值的图像块, 釆用有损压缩算法进行压缩包 括:
对于颜色种类的数量大于所述第一阈值, 且小于第二阈值的图像块, 釆用第一量化步长的有损压缩算法进行压缩, 所述第二阈值大于所述第一 阈值; 对于颜色种类的数量大于或等于所述第二阈值的图像块, 釆用第二量 化步长的有损压缩算法进行压缩, 所述第二量化步长大于所述第一量化步 长。
5、 根据权利要求 2所述的图像压缩方法, 其特征在于, 所述对于颜色 种类的数量小于或等于第一阈值的图像块, 釆用无损压缩算法进行压缩, 获得压缩后的码流具体为:
将颜色种类的数量小于或等于所述第一阈值的图像块在 RGB颜色空 间的图像数据, 分解为红 R分量数据流、 绿 G分量数据流和蓝 B分量数据 流;
釆用无损压缩算法,分别对所述 R分量数据流、所述 G分量数据流和所 述 B分量数据流进行压缩;
将压缩后的 R分量数据流、 G分量数据流和 B分量数据流合并, 获得压 缩后的码流。
6、 一种图像处理装置, 其特征在于, 包括:
划分单元, 用于将原始图像划分为至少一个图像块;
处理单元, 用于对每个图像块对应的图像数据所包含的颜色种类的数 量进行判断; 对于颜色种类的数量小于或等于第一阈值的图像块, 釆用无 损压缩算法进行压缩, 获得压缩后的码流; 对于颜色种类的数量大于所述 第一阈值的图像块, 釆用有损压缩算法进行压缩, 获得压缩后的码流; 发送单元, 用于将所述至少一个图像块分别压缩后的码流合并为统一 码流, 并将所述统一码流发送给客户端。
7、 根据权利要求 6所述的图像处理装置, 其特征在于, 所述图像处理 装置还包括:
转换单元, 用于在所述原始图像为红绿蓝 RGB 颜色空间的图像数据 时, 将所述 RGB颜色空间的图像数据转换为 YUV颜色空间的图像数据; 相应地, 所述处理单元具体用于:
对每个图像块对应的 YUV颜色空间的图像数据所包含的颜色种类的 数量进行判断。
8、 根据权利要求 7所述的图像处理装置, 其特征在于, 所述处理单元 具体用于: 获取每个图像块对应的 RGB颜色空间的图像数据的直方图信息; 根 据每个图像块的直方图信息, 判断每个图像块的图像数据的颜色种类的数 量。
9、 根据权利要求 7所述的图像处理装置, 其特征在于, 所述处理单元 还用于:
对于颜色种类的数量大于所述第一阈值, 且小于第二阈值的图像块, 釆用第一量化步长的有损压缩算法进行压缩, 所述第二阈值大于所述第一 阈值; 对于颜色种类的数量大于或等于所述第二阈值的图像块, 釆用第二 量化步长的有损压缩算法进行压缩, 所述第二量化步长大于所述第一量化 步长。
10、 根据权利要求 7所述的图像处理装置, 其特征在于, 所述处理单元 还用于:
将颜色种类的数量小于或等于所述第一阈值的图像块在 RGB颜色空 间的图像数据, 分解为红 R分量数据流、 绿 G分量数据流和蓝 B分量数据 流; 釆用无损压缩算法, 分别对所述 R分量数据流、 所述 G分量数据流和所 述 B分量数据流进行压缩; 将压缩后的 R分量数据流、 G分量数据流和 B 分量数据流合并, 获得压缩后的码流。
11、 一种图像处理装置, 其特征在于, 包括处理器、 存储器、 总线和 通信接口; 所述存储器用于存储计算机执行指令, 所述处理器与所述存储 器通过所述总线连接, 当所述图像处理装置运行时, 所述处理器执行所述 存储器存储的所述计算机执行指令, 使得所述图像处理装置执行如权利要 求 1-5中任一所述的图像压缩方法。
12、 一种计算机可读介质, 其特征在于, 包括计算机执行指令, 以供 计算机的处理器执行所述计算机执行指令时, 所述计算机执行如权利要求 1-5中任一所述的图像压缩方法。
PCT/CN2012/085146 2012-11-23 2012-11-23 图像压缩方法及图像处理装置 WO2014079036A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2012/085146 WO2014079036A1 (zh) 2012-11-23 2012-11-23 图像压缩方法及图像处理装置
CN201280002934.8A CN104025561A (zh) 2012-11-23 2012-11-23 图像压缩方法及图像处理装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2012/085146 WO2014079036A1 (zh) 2012-11-23 2012-11-23 图像压缩方法及图像处理装置

Publications (1)

Publication Number Publication Date
WO2014079036A1 true WO2014079036A1 (zh) 2014-05-30

Family

ID=50775410

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/085146 WO2014079036A1 (zh) 2012-11-23 2012-11-23 图像压缩方法及图像处理装置

Country Status (2)

Country Link
CN (1) CN104025561A (zh)
WO (1) WO2014079036A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106878584A (zh) * 2015-12-11 2017-06-20 山东新北洋信息技术股份有限公司 金融票据图像的压缩方法及装置
WO2018103568A1 (zh) * 2016-12-08 2018-06-14 中兴通讯股份有限公司 云桌面内容编码与解码方法及装置、***
CN111145077A (zh) * 2019-12-02 2020-05-12 联想(北京)有限公司 运行方法、服务器及电子设备
CN111787386A (zh) * 2020-06-01 2020-10-16 深圳市战音科技有限公司 动画压缩、显示方法、设备、动画处理***及存储介质
CN116437116A (zh) * 2023-03-03 2023-07-14 深圳市宏辉智通科技有限公司 一种音视频调度方法及***

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106878728B (zh) * 2017-01-19 2019-06-07 西安万像电子科技有限公司 图像的压缩方法和装置
CN108810537B (zh) * 2017-04-26 2023-04-07 腾讯科技(深圳)有限公司 一种图片转码方法、装置及图像处理设备
CN110740325B (zh) * 2018-07-19 2022-07-08 腾讯数码(天津)有限公司 一种纹理压缩方法、装置、设备和存储介质
CN111831366A (zh) * 2019-04-15 2020-10-27 深信服科技股份有限公司 一种图像数据的发送方法、装置及相关组件
CN111200740A (zh) * 2020-01-09 2020-05-26 西安万像电子科技有限公司 编码方法及编码器
CN111506374A (zh) * 2020-04-12 2020-08-07 北京华如科技股份有限公司 基于不同对象的云应用ui交互方法及装置
CN111553957A (zh) * 2020-04-26 2020-08-18 郑州轻工业大学 一种计算机图像处理中对矢量化图形进行数据压缩的方法及装置
CN112040236B (zh) * 2020-09-04 2022-02-18 维沃移动通信有限公司 图像处理方法、处理装置、以及图像显示方法、显示装置
CN114339305A (zh) * 2021-12-22 2022-04-12 深信服科技股份有限公司 一种虚拟桌面图像处理方法及相关装置
CN114339226B (zh) * 2021-12-28 2024-02-09 山东云海国创云计算装备产业创新中心有限公司 一种提高画面的流畅度的方法、装置及介质
CN114663536B (zh) * 2022-02-08 2022-12-06 中国科学院自动化研究所 一种图像压缩方法及装置
CN114581544A (zh) * 2022-05-09 2022-06-03 哈尔滨工业大学(深圳)(哈尔滨工业大学深圳科技创新研究院) 图像压缩方法、计算机设备及计算机存储介质
CN116781906A (zh) * 2023-07-03 2023-09-19 深圳市青葡萄科技有限公司 一种图文清晰度优化方法、设备及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101075348A (zh) * 2006-11-30 2007-11-21 腾讯科技(深圳)有限公司 一种图像压缩方法和装置
CN101217668A (zh) * 2008-01-14 2008-07-09 浙江大学 基于块分类的混合图像压缩方法
US20090129684A1 (en) * 2007-11-15 2009-05-21 Seung Soo Lee Method and apparatus for compressing text and image

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101282478A (zh) * 2008-04-24 2008-10-08 上海华平信息技术股份有限公司 实现高清视频并行编码的方法及***
CN101316366A (zh) * 2008-07-21 2008-12-03 北京中星微电子有限公司 图像编/解码方法和图像编/解码装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101075348A (zh) * 2006-11-30 2007-11-21 腾讯科技(深圳)有限公司 一种图像压缩方法和装置
US20090129684A1 (en) * 2007-11-15 2009-05-21 Seung Soo Lee Method and apparatus for compressing text and image
CN101217668A (zh) * 2008-01-14 2008-07-09 浙江大学 基于块分类的混合图像压缩方法

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106878584A (zh) * 2015-12-11 2017-06-20 山东新北洋信息技术股份有限公司 金融票据图像的压缩方法及装置
WO2018103568A1 (zh) * 2016-12-08 2018-06-14 中兴通讯股份有限公司 云桌面内容编码与解码方法及装置、***
CN108184118A (zh) * 2016-12-08 2018-06-19 中兴通讯股份有限公司 云桌面内容编码与解码方法及装置、***
CN111145077A (zh) * 2019-12-02 2020-05-12 联想(北京)有限公司 运行方法、服务器及电子设备
CN111145077B (zh) * 2019-12-02 2022-05-31 联想(北京)有限公司 运行方法、服务器及电子设备
CN111787386A (zh) * 2020-06-01 2020-10-16 深圳市战音科技有限公司 动画压缩、显示方法、设备、动画处理***及存储介质
CN116437116A (zh) * 2023-03-03 2023-07-14 深圳市宏辉智通科技有限公司 一种音视频调度方法及***
CN116437116B (zh) * 2023-03-03 2024-01-30 深圳市宏辉智通科技有限公司 一种音视频调度方法及***

Also Published As

Publication number Publication date
CN104025561A (zh) 2014-09-03

Similar Documents

Publication Publication Date Title
WO2014079036A1 (zh) 图像压缩方法及图像处理装置
WO2019210822A1 (zh) 视频编解码方法、装置、***及存储介质
US10904408B2 (en) Picture file processing method, device, and computer storage medium
US6310979B1 (en) Method and apparatus for digital data compression
US7158681B2 (en) Feedback scheme for video compression system
RU2433478C2 (ru) Предварительная обработка данных изображения для улучшенного сжатия
CN107483934B (zh) 编解码方法、装置和***
KR101962990B1 (ko) 복잡도가 낮은 원격 프리젠테이션 세션 인코더
US20130114687A1 (en) Fixed intra run-level mode for cavlc in hevc
WO2020135357A1 (zh) 数据压缩方法及装置、数据编码/解码方法及装置
JP2000504911A (ja) ファクシミリ準拠画像圧縮法およびシステム
WO2021004153A1 (zh) 图像预测方法、编码器、解码器以及存储介质
WO2014050151A1 (en) System for signaling idr and bla pictures
WO2023020560A1 (zh) 视频编解码的方法、装置、电子设备及存储介质
US10225561B2 (en) Method and apparatus for syntax signaling in image and video compression
CN115118964A (zh) 视频编码方法、装置、电子设备及计算机可读存储介质
EP3073737B1 (en) Video coding device, video coding program, video coding method, and video coding and decoding system
KR102321895B1 (ko) 디지털 비디오의 디코딩 장치
US20120320993A1 (en) Apparatus and method for mitigating the effects of packet loss on digital video streams
WO2024078066A1 (zh) 视频解码方法、视频编码方法、装置、存储介质及设备
CN111225214B (zh) 视频处理方法、装置及电子设备
WO2020143348A1 (zh) 预测模式确定方法和装置
CN109413445B (zh) 一种视频传输方法及装置
GB2488094A (en) Image compression using sum and difference pixel replacement and lowest bit discarding
WO2021169817A1 (zh) 视频处理方法及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12888750

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12888750

Country of ref document: EP

Kind code of ref document: A1