CN102271251A - Lossless image compression method - Google Patents
Lossless image compression method Download PDFInfo
- Publication number
- CN102271251A CN102271251A CN2010101972110A CN201010197211A CN102271251A CN 102271251 A CN102271251 A CN 102271251A CN 2010101972110 A CN2010101972110 A CN 2010101972110A CN 201010197211 A CN201010197211 A CN 201010197211A CN 102271251 A CN102271251 A CN 102271251A
- Authority
- CN
- China
- Prior art keywords
- pixel
- image
- difference
- value
- nonnegative number
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
Images
Landscapes
- Image Processing (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
- Compression Of Band Width Or Redundancy In Fax (AREA)
Abstract
The invention discloses a lossless image compression method, which is used for processing an image with a plurality of pixels, wherein the image width of the image is W. The lossless image compression method comprises the following steps of: selecting N continuous pixels from the image, wherein N is a positive integer more than or equal to 2 and less than the image width W; executing differential pulse code modulation means to obtain N nonnegative difference values corresponding to the N pixels according to values of the N pixels; computing coding parameters according to the N nonnegative difference values; and coding the N nonnegative difference values according to the coding parameters.
Description
Technical field
The present invention is about a kind of undistorted method for compressing image, especially a kind of undistorted method for compressing image that needs the little memory space.
Background technology
Along with the progress of electronics and information technology, the technical development of processing and display image is also more and more general on computer or electronic installation miscellaneous.Early stage electronic information technology can only store or handle the digital picture of low pixel.Yet people are more and more to the demand of high quality graphic, and how handling and store high quality graphic also becomes very popular emphasis.In order to obtain high quality graphic, adopt undistorted compress mode often carrying out image compression.
Yet undistorted high quality graphic need store higher pixel, also forms a major challenge for the arithmetic speed of calculator and the capacity of Storage Media.For example in undistorted compression algorithm, (Joint photographic experts group Lossless is to utilize prediction and preamble pattern (context modeling) to reach compression ratio preferably JPEG-LS) to undistorted still image compression standard.The preamble pattern needs a whole row's of register map picture pixel at least can carry out prediction under the various patterns, therefore needs a large amount of computing and storage area, and makes the required cost of encoder (encoder) rise.And JPEG-LS is for the application that does not need high compression rate, and the calculation complexity still is higher, and increases the burden of encoder.
It is more and more higher for the requirement of the resolution of image to add the user, the burden when also having increased image compression.If use existing undistorted compress mode, in case the resolution of image improves, encoder more must expend the very long time and more substantial storage area just can be treated to high quality graphic.In other words, it is too high and cause operation efficiency low that existing undistorted compress mode has a computational complexity, and the huge problem of required temporarily providing room.
Therefore, how to design a kind of undistorted compression method, the demand that can take into account high visual quality, low computational complexity and low temporarily providing room is that industrial quarters is considerable.
Summary of the invention
For addressing the above problem, the invention provides the method for compressing image of a kind of undistorted (lossless also is called harmless).Undistorted method for compressing image only need use less memory headroom, and can handle the image with a plurality of pixels with fast speeds.Wherein a picture traverse of image is W.Undistorted method for compressing image comprises the steps: (a) by choosing a continuous N pixel in the image, and wherein N is the positive integer more than or equal to 2, and N is less than picture traverse W; (b) (Differential pulse code modulation, DPCM) means with the value according to this N pixel, obtain N nonnegative number difference of corresponding this N pixel to carry out a difference pulse code modulated; (c), calculate a coding parameter (coding parameter) according to this N nonnegative number difference; And, this N nonnegative number difference encoded (d) according to coding parameter.
In order to compress whole image, undistorted method for compressing image can comprise the steps: following N the continuous pixel that (e) continues and choose image in addition; And (f) return step (b), up to all pixels of having compressed image.
Wherein step (a) can directly receive N the pixel that is selected in the image by a buffer.
And the difference pulse code modulated means of step (b) can comprise: according to the value of this N pixel, obtain corresponding respectively to N pixel value difference of this N pixel; And respectively this N pixel value difference is carried out a conversion (mapping) means, to obtain corresponding respectively to N nonnegative number difference of this N pixel value difference.
Implement example according to of the present invention one, according to the value of this N pixel, the step that obtains corresponding respectively to N pixel value difference of this N pixel can comprise: with the value P of first pixel in this N pixel
0As first pixel value difference d
0And the value P that calculates i pixel in this N pixel respectively
iThe value P of pixel previous with it
I-1Poor, as other N-1 pixel value difference, wherein i is a positive integer, and 0<i<N.
Shift means then can comprise: i pixel value difference d in this N pixel value difference
iMore than or equal to zero the time, i corresponding nonnegative number difference n
iBe pixel value difference d
iMultiply by 2, wherein 0=<i<N; And i pixel value difference d in this N pixel value difference
iLess than zero the time, i corresponding nonnegative number difference n
iBe pixel value difference d
iMultiply by 2 and subtract 1 again.
Coding parameter in order to this N the nonnegative number difference of encoding can be
N wherein
iI nonnegative number difference in N nonnegative number difference for this reason.
And above-mentioned steps (d) can comprise: according to coding parameter, with Columbus-Lai Si coding (Golomb-Ricecode) this N nonnegative number difference encoded.
In sum, undistorted method for compressing image according to the present invention is chosen N pixel in the image, and with the value coding of variable length code with this N pixel.Do not need to use other pixel in the image when handling this N pixel, so the buffer of encoder need not preserved the value of other pixel.So having, undistorted method for compressing image saves a large amount of temporarily providing rooms, and advantage such as compress mode is simple efficient.
Description of drawings
Fig. 1 is the schematic diagram of the image of one enforcement example according to the present invention;
Fig. 2 is the flow chart of the undistorted method for compressing image of one enforcement example according to the present invention;
Fig. 3 is the flow chart of the difference pulse code modulated means of one enforcement example according to the present invention;
Fig. 4 is the flow chart of the step S41 of one enforcement example according to the present invention;
Fig. 5 is the flow chart of the shift means of one enforcement example according to the present invention; And
Fig. 6 is another flow chart of implementing the undistorted method for compressing image of example according to the present invention.
Wherein, Reference numeral:
20 images
22 handle window
Embodiment
Below in execution mode, be described in detail detailed features of the present invention and advantage, its content is enough to make any those skilled in the art to understand technology contents of the present invention and implements according to this, and according to the disclosed content of this specification, claim and accompanying drawing, any those skilled in the art can understand purpose and the advantage that the present invention is correlated with easily.
The invention provides the method for compressing image of a kind of undistorted (lossless also is called harmless), an image that has a plurality of pixels in order to processing is with image compression.Undistorted method for compressing image can be implemented into an encoder (encoder).
Please refer to Fig. 1 and Fig. 2, it is respectively the schematic diagram of the image of one enforcement example according to the present invention and the flow chart of undistorted method for compressing image.
When carrying out undistorted method for compressing image, at first by choosing a continuous N pixel (step S30) in the image 20; Wherein N is the positive integer more than or equal to 2, and N is less than picture traverse W.In order to carry out undistorted method for compressing image more efficiently, the numerical value that can get aliquot picture traverse W is as N.In other words, N can be divided exactly the picture traverse W of image 20.For example when picture traverse W was 128 (pixels), desirable N was 16.And the step S30 that chooses a N continuous pixel can handle window 22 real works with one.The length of handling window 22 is N, and N pixel of 22 frame choosings of processed window is according to the compressed N of a following flow process pixel.
Encoder has a buffer (buffer), needing processed part to be temporary in buffer in the image 20.In more detail, image 20 can be the file that is stored in internal memory, can also be the view data by the photosensitive unit transmission of an image capturing device.Step S30 then can choose continuous this N pixel in the image of being received by internal memory or photosensitive unit 20, and is directly received the value P of this N pixel by buffer
0~P
N-1
During therefore undistorted method for compressing image compressed image 20, only need to use N pixel handling window 22, and need not use other pixel in the image 20.Therefore also only need to have this N pixel in the buffer of encoder and get final product, and need not deposit W the pixel of whole row in the image 20.
Choose after the continuous N pixel, this N pixel is carried out a difference pulse code modulated (Differential pulse code modulation, DPCM) means; With value P according to this N pixel
0~P
N-1, obtain N nonnegative number difference n of corresponding this N pixel
0~n
N-1(step S40).The value of pixel for example can be GTG value, tristimulus values (RGB value) or the form and aspect (hue) of HSL color space, saturation (saturation), with brightness (lightness).Undistorted method for compressing image does not limit to some extent to the content of the value of pixel.
With reference to Fig. 3, it is the flow chart of the difference pulse code modulated means of one enforcement example according to the present invention.
Undistorted method for compressing image utilization variance pulse code modulated means obtain corresponding to N the nonnegative number difference n that handles window 22
0~n
N-1, to carry out undistorted compression.Difference pulse code modulated means can be earlier according to the value P of this N pixel
0~P
N-1, obtain corresponding respectively to N pixel value difference d of this N pixel
0~d
N-1(step S41).Then respectively this N pixel value difference is carried out a conversion (mapping) means again, to obtain corresponding respectively to N nonnegative number difference n of this N pixel value difference
0~n
N-1(step S46).
Please cooperate Fig. 3 and with reference to Fig. 4 and Fig. 5, it is respectively according to the present invention one flow chart of implementing the step S41 of example, and the flow chart of the shift means among the step S46.
In step S41, can calculate pixel value difference d according to following formula 1 and formula 2
0~d
N-1
d
0=P
0 Formula 1
d
i=P
i-P
I-1, 0<i<N, and i is a positive integer formula 2
P wherein
0For handling the value of first pixel in N the pixel in the window 22, P
iFor handling the value of i pixel in N the pixel in the window 22.And d
0Be corresponding P
0Pixel value difference, d
iBe corresponding P
iPixel value difference.
Implement example according to of the present invention another, can preserve the value P of the previous pixel of first pixel of handling window 22 in the image 20
-1And first pixel value difference d of alignment processing window 22
0Value be P
0With P
-1Difference.
Obtain handling the pixel value difference d of window 22 correspondences at step S41
0~d
N-1Afterwards, shift means can be judged these pixel value differences d earlier one by one
iWhether, calculate nonnegative number difference n according to following formula 3 and formula 4 again more than or equal to 0 (step S47)
0~n
N-1
n
i=2 * d
i, if d
i〉=0 formula 3
n
i=2 * d
i-1, if d
i<0 formula 4
N wherein
iBe N nonnegative number difference n
0~n
N-1In the value of i pixel, and 0≤i<N.
For more than or equal to 0 pixel value difference d
i, formula 3 is with pixel value difference d
iMultiply by 2 as nonnegative number difference n
iThat is to say nonnegative number difference n
iBe pixel value difference d
iMultiply by 2 (step S48).And for less than 0 pixel value difference d
i, formula 4 is with pixel value difference d
iMultiply by 2 and subtract 1 value again as nonnegative number difference n
iThat is to say nonnegative number difference n
iBe pixel value difference d
iMultiply by 2 and subtract 1 (step S49) again.
Thus, just can be in step S40 according to the value P of N pixel
0~P
N-1, obtain N nonnegative number difference n of corresponding this N pixel
0~n
N-1
Please get back to Fig. 2.Then according to this N nonnegative number difference n
0~n
N-1, calculate a coding parameter (coding parameter) k (step S50); And according to coding parameter k, with this N nonnegative number difference n
0~n
N-1(step S60) encodes.
Wherein step S60 can comprise: according to coding parameter k, encode (Golomb-Ricecode) with this N nonnegative number difference n with Columbus-Lai Si
0~n
N-1Encode.
In order to the coding parameter of handling this N nonnegative number difference can be
Columbus-Lai Si is encoded to a kind of variable length code, and (variable-length code, VLC), it the higher value of probability will occur and give short coding.According to Columbus-Lai Si coding, set a divisor m according to coding parameter k earlier.Again with this N nonnegative number difference n
0~n
N-1Divided by divisor m, obtain corresponding N quotient Q and remainder R.Wherein divisor m is 2 k power (2
k).
Columbus-Lai Si coding then is encoded into monobasic sign indicating number (unary code) with the quotient Q that obtains, and will be encoded into the binary code (binary code) of k bit length in number R.
For example, suppose nonnegative number difference n
0Be 163, coding parameter k is 5.Therefore can calculate nonnegative number difference n
0Quotient Q be 5, remainder R is 3.Nonnegative number difference n then
0Quotient Q can be encoded into 111110 with the monobasic sign indicating number, remainder R then is encoded into 00011 with binary code.
Thus, handle the value P of N pixel in the window 22
0~P
N-1Can be compressed into undistorted variable length code.And entire image 20 can be compressed by undistorted method for compressing image.Please refer to Fig. 6, it is another flow chart of implementing the undistorted method for compressing image of example according to the present invention.
After execution in step S30 will handle N pixel compression of window 22 to step S60, can judge whether to have compressed all pixels (step S70) of image 20 in addition.If image 20 is not compressed fully as yet and finishes, following N the continuous pixel (step S80) that then continues and choose image 20, and handle N the pixel that in step S80, is selected with step S40, S50 and S60.If image 20 has been compressed and has finished is a compressed image file, then can finish.
That is to say, undistorted method for compressing image be N pixel being selected among the step S30 after continue and choose an other N pixel, and can be with N pixel choosing in addition as new processing window 22 in processing.
In sum, undistorted method for compressing image according to the present invention is chosen N pixel in the image, and the value of the pixel chosen is encoded with variable length code.Owing to the time do not need to use other pixel in the image in compression, so the buffer of encoder only need preserve the value of this N pixel, and can save a large amount of temporarily providing rooms.And N the pixel value that undistorted method for compressing image is only handled in each image window one by one arrives complete image of compression, and has the simple efficient advantage of compress mode.
Claims (8)
1. undistorted method for compressing image, in order to the image that processing has a plurality of pixels, wherein a picture traverse of this image is W, it is characterized in that, this undistorted method for compressing image comprises:
A, by choosing continuous N this pixel in this image, wherein N is the positive integer more than or equal to 2, and N is less than this picture traverse W;
B, carry out difference pulse code modulated means,, obtain N nonnegative number difference that should N pixel with value according to this N pixel;
C, according to this N nonnegative number difference, calculate a coding parameter; And
D, according to this coding parameter, this N nonnegative number difference encoded.
2. undistorted method for compressing image as claimed in claim 1 is characterized in that other comprises:
E, following N this continuous pixel that continues and choose this image; And
F, return step b, up to all these pixels of having compressed this image.
3. undistorted method for compressing image as claimed in claim 1 is characterized in that, these difference pulse code modulated means comprise:
According to the value of this N pixel, obtain corresponding respectively to N pixel value difference of this N pixel; And
Respectively this N pixel value difference is carried out a shift means, to obtain corresponding respectively to this N nonnegative number difference of this N pixel value difference.
4. undistorted method for compressing image as claimed in claim 3 is characterized in that, this is according to the value of this N pixel, and the step that obtains corresponding respectively to N pixel value difference of this N pixel comprises:
Value P with first this pixel in this N pixel
0As first this pixel value difference d
0And
Calculate the value P of i this pixel in this N pixel respectively
iThe value P of this pixel previous with it
I-1Poor, as other N-1 this pixel value difference, wherein i is a positive integer, and 0<i<N.
5. undistorted method for compressing image as claimed in claim 3 is characterized in that, this shift means comprises:
I in this N pixel value difference this pixel value difference d
iMore than or equal to zero the time, corresponding i this nonnegative number difference n
iBe this pixel value difference d
iMultiply by 2, wherein 0=<i<N; And
I in this N pixel value difference this pixel value difference d
iLess than zero the time, corresponding i this nonnegative number difference n
iBe this pixel value difference d
iMultiply by 2 and subtract 1 again.
7. undistorted method for compressing image as claimed in claim 1 is characterized in that, this steps d comprises:
According to this coding parameter, this N nonnegative number difference encoded with Columbus-Lai Si coding.
8. undistorted method for compressing image as claimed in claim 1 is characterized in that, this step a is directly received this N pixel that is selected in this image by a buffer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201010197211 CN102271251B (en) | 2010-06-02 | 2010-06-02 | Lossless image compression method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201010197211 CN102271251B (en) | 2010-06-02 | 2010-06-02 | Lossless image compression method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102271251A true CN102271251A (en) | 2011-12-07 |
CN102271251B CN102271251B (en) | 2013-01-16 |
Family
ID=45053393
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 201010197211 Expired - Fee Related CN102271251B (en) | 2010-06-02 | 2010-06-02 | Lossless image compression method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102271251B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102271252A (en) * | 2010-06-04 | 2011-12-07 | 华晶科技股份有限公司 | Image compression method having variable quantization parameters |
CN103369312A (en) * | 2012-03-27 | 2013-10-23 | 富士通株式会社 | Method and device for compressing image |
CN105323588A (en) * | 2014-06-16 | 2016-02-10 | 旭曜科技股份有限公司 | Image compression system of dynamic adaptation compression parameter |
CN110460851A (en) * | 2012-08-21 | 2019-11-15 | Emc公司 | The lossless compression of segmented image data |
TWI709326B (en) * | 2019-06-14 | 2020-11-01 | 元智大學 | Lossless image compression method |
CN112425158A (en) * | 2018-06-11 | 2021-02-26 | 无锡安科迪智能技术有限公司 | Monitoring camera system and method for reducing power consumption of monitoring camera system |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5708511A (en) * | 1995-03-24 | 1998-01-13 | Eastman Kodak Company | Method for adaptively compressing residual digital image data in a DPCM compression system |
JP2001095012A (en) * | 1999-09-21 | 2001-04-06 | Sony Corp | Image pickup unit and method for processing color image signal |
CN1322442A (en) * | 1999-07-20 | 2001-11-14 | 皇家菲利浦电子有限公司 | Encoding method for compression of video sequence |
CN1684495A (en) * | 2004-04-15 | 2005-10-19 | 微软公司 | Predictive lossless coding of images and video |
CN101715132A (en) * | 2008-09-30 | 2010-05-26 | 雅马哈株式会社 | Lossless compression-encoding device |
-
2010
- 2010-06-02 CN CN 201010197211 patent/CN102271251B/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5708511A (en) * | 1995-03-24 | 1998-01-13 | Eastman Kodak Company | Method for adaptively compressing residual digital image data in a DPCM compression system |
CN1322442A (en) * | 1999-07-20 | 2001-11-14 | 皇家菲利浦电子有限公司 | Encoding method for compression of video sequence |
JP2001095012A (en) * | 1999-09-21 | 2001-04-06 | Sony Corp | Image pickup unit and method for processing color image signal |
CN1684495A (en) * | 2004-04-15 | 2005-10-19 | 微软公司 | Predictive lossless coding of images and video |
CN101715132A (en) * | 2008-09-30 | 2010-05-26 | 雅马哈株式会社 | Lossless compression-encoding device |
Non-Patent Citations (2)
Title |
---|
赵丽红等: "DPCM与小波变换结合的医学图像无损压缩", 《东北大学学报(自然科学版)》 * |
金鑫等: "一种快速高效的CT投影数据无损压缩方案", 《中国体视学与图像分析》 * |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102271252A (en) * | 2010-06-04 | 2011-12-07 | 华晶科技股份有限公司 | Image compression method having variable quantization parameters |
CN102271252B (en) * | 2010-06-04 | 2013-10-16 | 华晶科技股份有限公司 | Image compression method having variable quantization parameters |
CN103369312A (en) * | 2012-03-27 | 2013-10-23 | 富士通株式会社 | Method and device for compressing image |
CN103369312B (en) * | 2012-03-27 | 2017-04-12 | 富士通株式会社 | Method and device for compressing image |
CN110460851A (en) * | 2012-08-21 | 2019-11-15 | Emc公司 | The lossless compression of segmented image data |
CN110460851B (en) * | 2012-08-21 | 2022-03-08 | Emc 公司 | Lossless compression system, method and storage medium for segmented image data |
CN105323588A (en) * | 2014-06-16 | 2016-02-10 | 旭曜科技股份有限公司 | Image compression system of dynamic adaptation compression parameter |
CN105323588B (en) * | 2014-06-16 | 2019-06-21 | 敦泰电子股份有限公司 | A kind of image compression system of dynamically adapting compression parameters |
CN112425158A (en) * | 2018-06-11 | 2021-02-26 | 无锡安科迪智能技术有限公司 | Monitoring camera system and method for reducing power consumption of monitoring camera system |
TWI709326B (en) * | 2019-06-14 | 2020-11-01 | 元智大學 | Lossless image compression method |
Also Published As
Publication number | Publication date |
---|---|
CN102271251B (en) | 2013-01-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102271251B (en) | Lossless image compression method | |
US9019399B2 (en) | Two-dimensional signal encoding device | |
CN101076125B (en) | Algorithm for optimizing RGB and YCbCr conversion computing in image compression | |
CN105100814B (en) | Image coding and decoding method and device | |
RU2567988C2 (en) | Encoder, method of encoding data, decoder, method of decoding data, system for transmitting data, method of transmitting data and programme product | |
US7248735B2 (en) | Compression and decompression method of image data | |
US8351693B2 (en) | Image compression apparatus and computer-readable recording medium recorded with image compression program | |
CN109889846B (en) | Method and device for compressing and decompressing Demura table data and coding and decoding system | |
JP2009010954A (en) | Method and system for processing image at high speed | |
US20080267495A1 (en) | Image compressing method and image compressing apparatus | |
CN107105208A (en) | A kind of lossless coding and coding/decoding method of Bayer images | |
CN114584773A (en) | Image compression device, method, electronic device, and computer-readable storage medium | |
CN112118449A (en) | Method and device for compressing and decompressing image | |
US20110299791A1 (en) | Lossless image compression method | |
US8712170B2 (en) | Image-processing method and program, and image-processing apparatus | |
US8428381B2 (en) | Image compression method with variable quantization parameter | |
CN102118616A (en) | Picture decoding method and picture decoder | |
CN106717006B (en) | Method for selecting a compression algorithm according to the type of image | |
WO2010005360A1 (en) | Method for compressing images and a format for compressed images | |
CN115767085A (en) | Data processing method and device | |
CN107172425B (en) | Thumbnail generation method and device and terminal equipment | |
CN114693818A (en) | Compression method suitable for digital ortho image data | |
JP2004135254A (en) | Image processing unit | |
CA2989785A1 (en) | Adaptive precision and quantification of a wavelet transformed matrix | |
CN102300085B (en) | Image compressing method with variable quantization parameter and variable coding parameter |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20130116 Termination date: 20170602 |
|
CF01 | Termination of patent right due to non-payment of annual fee |