CN102271251B - Lossless image compression method - Google Patents

Lossless image compression method Download PDF

Info

Publication number
CN102271251B
CN102271251B CN 201010197211 CN201010197211A CN102271251B CN 102271251 B CN102271251 B CN 102271251B CN 201010197211 CN201010197211 CN 201010197211 CN 201010197211 A CN201010197211 A CN 201010197211A CN 102271251 B CN102271251 B CN 102271251B
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.)
Expired - Fee Related
Application number
CN 201010197211
Other languages
Chinese (zh)
Other versions
CN102271251A (en
Inventor
詹振宏
周宏隆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Altek Corp
Original Assignee
Altek Corp
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 Altek Corp filed Critical Altek Corp
Priority to CN 201010197211 priority Critical patent/CN102271251B/en
Publication of CN102271251A publication Critical patent/CN102271251A/en
Application granted granted Critical
Publication of CN102271251B publication Critical patent/CN102271251B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Image Processing (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

Undistorted method for compressing image
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, also more and more general in the technical development of computer or electronic installation miscellaneous processing and demonstration image.Early stage electronic information technology can only store or process the digital picture of low pixel.Yet people are more and more to the demand of high quality graphic, and how processing and store high quality graphic also becomes very popular emphasis.In order to obtain high quality graphic, often adopt undistorted compress mode carrying out image compression.
Yet undistorted high quality graphic need to store higher pixel, also forms a major challenge for the arithmetic speed of calculator and the capacity of Storage Media.For example in the Lossless Compression algorithm, undistorted Static Picture Compression standard (Joint photographic experts group Lossless, JPEG-LS) is to utilize prediction and preamble pattern (context modeling) to reach preferably compression ratio.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 so that 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 is still higher, and increases the burden of encoder.
Add the user more and more higher for the requirement of the resolution of image, 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 an image that can have a plurality of pixels with velocity process faster.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) carry out a difference pulse code modulated (Differential pulse code modulation, DPCM) means, with the value according to this N pixel, obtain N nonnegative number difference of corresponding this N pixel; (c) according to this N nonnegative number difference, calculate a coding parameter (coding parameter); And (d) according to coding parameter, this N nonnegative number difference encoded.
In order to compress whole image, undistorted method for compressing image can comprise the steps: lower N the continuous pixel that (e) continues and choose image in addition; And (f) return step (b), until compressed all pixels of 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 respectively i pixel in this N pixel iThe value P of pixel previous with it I-1Poor, as other N-1 pixel value difference, wherein i is 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 again 1.
Coding parameter in order to this N the nonnegative number difference of encoding can be
Figure GSA00000139062500021
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 processing this N pixel, so the buffer of encoder need not preserved the value of other pixel.Therefore having, undistorted method for compressing image saves a large amount of temporarily providing rooms, and the 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 process 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.
Image 20 has W * L pixel, and wherein W is a picture traverse of image 20, and L is an image length.For example image 20 to be having 640 * 480 pixels, or 128 * 128 pixels; Then picture traverse W then can be 640 (pixels) or 128 (pixels).Have each other powerful relevance owing to being in the pixel of same row in the image 20, thereby can be used in image compression.
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 more efficiently undistorted method for compressing image, can get the numerical value of aliquot picture traverse W 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 (pixel), desirable N was 16.And choose a N continuous pixel step S30 can with one process window 22 implementations it.The length of processing 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 20 of being received by internal memory or photosensitive unit, and is directly received the value P of this N pixel by buffer 0~P N-1
Therefore during undistorted method for compressing image compressed image 20, only need to use N pixel processing 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 the 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 processes window 22 0~n N-1, to carry out undistorted compression.Difference pulse code modulated means can be first 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 positive integer formula 2
P wherein 0For processing the value of first pixel in N the pixel in the window 22, P iFor processing 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.
Formula 1 is with the value P of first pixel in N the pixel 0As first pixel value difference d 0Step S42).Formula 2 is calculated respectively the value P of i pixel in this N pixel iThe value P of pixel previous with it I-1Poor, as other N-1 pixel value difference d 1~d N-1, 0<i<N (step S43) wherein.In other words, pixel value difference d 1~d N-1Value P with adjacent pixel 0~P N-1Subtract each other in twos and obtain.
Implement example according to of the present invention another, can preserve the value P of the previous pixel of first pixel of processing window 22 in the image 20 -1And first pixel value difference d of alignment processing window 22 0Value be P 0With P -1Difference.
Obtain processing the pixel value difference d of window 22 correspondences at step S41 0~d N-1Afterwards, shift means can be judged first these pixel value differences d one by one iWhether more than or equal to 0 (step S47), calculate nonnegative number difference n according to following formula 3 and formula 4 again 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 again 1 value as nonnegative number difference n iThat is to say nonnegative number difference n iBe pixel value difference d iMultiply by 2 and subtract again 1 (step S49).
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 processing this N nonnegative number difference can be
Figure GSA00000139062500061
Columbus-Lai Si is encoded to a kind of variable length code (variable-length code, VLC), and it the higher value of probability will occur and give shorter coding.According to Columbus-Lai Si coding, set a divisor m according to coding parameter k first.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 code (unary code) with the quotient Q that obtains, and will be encoded in several R the binary code (binary code) of k bit length.
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 code, remainder R then is encoded into 00011 with binary code.
Thus, process the value P of N pixel in the window 22 0~P N-1Can be compressed into undistorted variable length code.And whole 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 process N pixel compression of window 22 to step S60, can judge whether to have compressed in addition all pixels (step S70) of image 20.If image 20 is compressed finishing not yet fully, lower N the continuous pixel (step S80) that then continues and choose image 20, and process N the pixel that in step S80, is selected with step S40, S50 and S60.If compressed the finishing of image 20 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 not needing to use other pixel in the image in when 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 processed in each image window one by one arrives complete image of compression, and has the simple efficient advantage of compress mode.

Claims (6)

1. undistorted method for compressing image, an image that has a plurality of pixels in order to processing, 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, with the value according to this N pixel, obtain N nonnegative number difference that should 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,
Wherein 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, obtaining corresponding respectively to this N nonnegative number difference of this N pixel value difference,
Wherein this shift means comprises: the 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 this pixel value difference d of the i in this N pixel value difference iLess than zero the time, corresponding i this nonnegative number difference n iBe this pixel value difference d iMultiply by 2 and subtract again 1.
2. undistorted method for compressing image as claimed in claim 1 is characterized in that, other comprises:
E, lower N this continuous pixel that continues and choose this image; And
F, return step b, until compressed all these pixels of this image.
3. undistorted method for compressing image as claimed in claim 1 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 respectively the value P of i this pixel in this N pixel iThe value P of this pixel previous with it I-1Poor, as other N-1 this pixel value difference, wherein i is positive integer, and 0<i<N.
4. undistorted method for compressing image as claimed in claim 1 is characterized in that, this coding parameter is N wherein iBe the i in this N the nonnegative number difference this nonnegative number difference.
5. undistorted method for compressing image as claimed in claim 1 is characterized in that, this steps d comprises:
According to this coding parameter, with Columbus-Lai Si coding this N nonnegative number difference encoded.
6. 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.
CN 201010197211 2010-06-02 2010-06-02 Lossless image compression method Expired - Fee Related CN102271251B (en)

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 CN102271251A (en) 2011-12-07
CN102271251B true 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)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102271252B (en) * 2010-06-04 2013-10-16 华晶科技股份有限公司 Image compression method having variable quantization parameters
CN103369312B (en) * 2012-03-27 2017-04-12 富士通株式会社 Method and device for compressing image
WO2014031240A2 (en) * 2012-08-21 2014-02-27 Emc Corporation Lossless compression of fragmented image data
CN105323588B (en) * 2014-06-16 2019-06-21 敦泰电子股份有限公司 A kind of image compression system of dynamically adapting compression parameters
CN112470472B (en) * 2018-06-11 2023-03-24 无锡安科迪智能技术有限公司 Blind compression sampling method and device and imaging system
TWI709326B (en) * 2019-06-14 2020-11-01 元智大學 Lossless image compression method

Citations (5)

* Cited by examiner, † Cited by third party
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
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 (3)

* Cited by examiner, † Cited by third party
Title
一种快速高效的CT投影数据无损压缩方案;金鑫等;《中国体视学与图像分析》;20090331;第14卷(第1期);全文 *
赵丽红等.DPCM与小波变换结合的医学图像无损压缩.《东北大学学报(自然科学版)》.2007,第28卷(第10期),全文. *
金鑫等.一种快速高效的CT投影数据无损压缩方案.《中国体视学与图像分析》.2009,第14卷(第1期),全文.

Also Published As

Publication number Publication date
CN102271251A (en) 2011-12-07

Similar Documents

Publication Publication Date Title
CN102271251B (en) Lossless image compression method
US20140072239A1 (en) Image Compression Using Sub-Resolution Images
US9019399B2 (en) Two-dimensional signal encoding device
CN105100814B (en) Image coding and decoding method and device
US8351693B2 (en) Image compression apparatus and computer-readable recording medium recorded with image compression program
US7248735B2 (en) Compression and decompression method of image data
CN109889846B (en) Method and device for compressing and decompressing Demura table data and coding and decoding system
CN107105208A (en) A kind of lossless coding and coding/decoding method of Bayer images
CN112118449B (en) Method and device for compressing and decompressing image
JP6498858B2 (en) Image coding method
CN114584773A (en) Image compression device, method, electronic device, and computer-readable storage medium
CN108200429B (en) Bayer image compression method and device
CN106717006B (en) Method for selecting a compression algorithm according to the type of image
US20110299790A1 (en) Image compression method with variable quantization parameter
WO2010005360A1 (en) Method for compressing images and a format for compressed images
CN107172425B (en) Thumbnail generation method and device and terminal equipment
US20110242112A1 (en) Display device and driving circuit thereof
CA2989785A1 (en) Adaptive precision and quantification of a wavelet transformed matrix
Kim et al. Implementation of DWT-based adaptive mode selection for LCD overdrive
CN102271252B (en) Image compression method having variable quantization parameters
CN116132759B (en) Audio and video stream synchronous transmission method and device, electronic equipment and storage medium
CN102300085B (en) Image compressing method with variable quantization parameter and variable coding parameter
TWI432031B (en) Distortion-free image compression method
JP6672363B2 (en) Encoding device, display device, encoding device control method, and control program
EP2887665A1 (en) Method and device for encoding a high-dynamic range image

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