Method for compressing and uncompressing image based on color classification and cluster

A color classification and image compression technology, applied in the direction of image communication, television, electrical components, etc., can solve the problems of poor compression quality and slow compression speed, achieve high compression ratio, high efficiency, and reduce the loss of image information.

Active Publication Date: 2013-12-18
京北方信息技术股份有限公司
View PDF8 Cites 25 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] The purpose of the present invention is to propose an image compression and decompression method based on color classification

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for compressing and uncompressing image based on color classification and cluster
  • Method for compressing and uncompressing image based on color classification and cluster
  • Method for compressing and uncompressing image based on color classification and cluster

Examples

Experimental program
Comparison scheme
Effect test

no. 1 example

[0062] figure 1 is a flow chart of the method of the first embodiment of the present invention. Such as figure 1 As shown, the image compression method based on color classification and clustering in the embodiment of the present invention includes:

[0063] Step 11. Acquire the original image, and establish a marker matrix for the original image.

[0064] The acquisition of the original image, for a color image, is to acquire the R, G, and B values ​​of each pixel; for a grayscale image, it is to acquire its gray value.

[0065] Step 12: Perform color classification on the original image, and classify pixels with similar colors into one color category.

[0066] Step 13. Determine whether the number of color classifications is more than the preset number of color types. If yes, execute step 14; otherwise, directly execute step 15.

[0067] The number of preset color types is generally set to any integer value from 8 to 10 for color images, and is generally set to 3 or 4 fo...

Embodiment 2

[0076] figure 2 It is a flowchart of a method for compressing a color image according to the second embodiment of the present invention. Such as figure 2 As shown, the method for compressing a color image in this embodiment includes:

[0077] Step 21. Acquire an original image, and establish a marker matrix for the original image.

[0078] The original image is a color image. At this time, the R, G, and B values ​​of each pixel are obtained, and information such as the size and number of color bits of the original image is also obtained.

[0079] The flag matrix has the same size as the pixel matrix of the original image, and the initial value of the flag matrix is ​​set to 0.

[0080] Step 22, performing color classification on the original image, and classifying pixels with similar colors into one color category, the color classification specifically includes the following sub-steps:

[0081] Step 221. Set the first element of the flag matrix to 1, and obtain the pixel...

Embodiment 3

[0145] Correspondingly, this embodiment provides a method to decompress the compressed file generated through Embodiment 2, such as Figure 4 As shown, the color image decompression method described in this embodiment includes:

[0146] Step 31, obtain the compressed image.

[0147] From the compressed image, read in the length, width, number of color bits of the original image, the length of each flag array, the length and data of the compressed flag array zip_flag, the original length of each type of array, the length after transformation, and the length of DWT transformation. Series and low frequency component data of y, u and v.

[0148] Step 32, encoding and decompressing the compressed flag array and image data, including two sub-steps:

[0149] Step 32A, use the compressed flag array zip_flag as input to perform arithmetic coding decompression, and obtain f according to the length of each flag array read 1 , f 2 ... f p-1 (where p is the number of color types).

...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a method for compressing and uncompressing an image based on color classification and cluster. The method for compressing the image comprises the step of acquiring an original image and establishing a sign matrix for the original image; the step of classifying colors of the original image; the step of judging the number of types of the classified colors is larger than the number of the types of preset colors or not, wherein if yes, the excessive colors in color classification are clustered; the step of splitting pixel data and sign data of the original image according to the types of the color classification; the step of compressing the sign data based on the lossless compression algorithm and compressing the pixel data based on the loss algorithm; the step of writing compressed data into a file according to the preset sequence to obtain a compressed image. According to the method, the information of the colors of the image is classified and clustered, the lossless compression algorithm and the loss algorithm are combined, and the purpose of compressing the image at a high speed in a high-quality and high compression ratio is achieved.

Description

technical field [0001] The invention relates to the technical field of image compression, in particular to an image compression and decompression method based on color classification and clustering. Background technique [0002] Image compression refers to the technique of expressing the original pixel matrix with less bits lossy or lossless, also known as image coding. The reason why image data can be compressed is because there is redundancy in the data. The redundancy of image data is mainly manifested as: spatial redundancy caused by the correlation between adjacent pixels in the image; temporal redundancy caused by the correlation between different frames in the image sequence; correlation caused by different color planes or spectral bands. spectrum redundancy. The purpose of data compression is to reduce the number of bits required to represent data by removing these data redundancies. [0003] The current mainstream image compression methods mainly include JPEG (Jo...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): H04N7/26
Inventor 张修宝高昊江
Owner 京北方信息技术股份有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products