CN102271251A - Lossless Image Compression Method - Google Patents

Lossless Image Compression Method Download PDF

Info

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
pixels
value
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
Application number
CN2010101972110A
Other languages
Chinese (zh)
Other versions
CN102271251B (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

  • Image Processing (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

The invention discloses a distortion-free 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 undistorted image compression method comprises the steps of selecting continuous N pixels from an image, wherein N is a positive integer greater than or equal to 2, and is less than the width W of the image; executing a difference pulse code modulation means to obtain N non-negative difference values corresponding to the N pixels according to the values of the N pixels; calculating to obtain coding parameters according to the N nonnegative difference values; and coding the N nonnegative difference values according to the coding parameters.

Description

无失真的图像压缩方法Lossless Image Compression Method

技术领域 technical field

本发明关于一种无失真的图像压缩方法,尤其是一种需要较少内存空间的无失真的图像压缩方法。The invention relates to a distortion-free image compression method, in particular to a distortion-free image compression method requiring less memory space.

背景技术 Background technique

随着电子以及信息技术的进步,在计算机或各式各样的电子装置上处理以及显示图像的技术发展也越来越普遍。早期的电子信息技术只能储存或处理较低像素的数字图像。然而,人们对高质量图像的需求越来越多,如何处理以及储存高质量图像也成为非常热门的重点。为了得到高质量图像,在进行图像压缩时常采用无失真的压缩方式。With the advancement of electronics and information technology, the development of technologies for processing and displaying images on computers or various electronic devices is becoming more and more common. Early electronic information technology could only store or process digital images with relatively low pixels. However, people's demand for high-quality images is increasing, and how to process and store high-quality images has become a very hot focus. In order to obtain high-quality images, a lossless compression method is often used in image compression.

然而无失真的高质量图像需要储存较高的像素,对于计算器的运算速度以及储存媒体的容量也形成一大挑战。例如在无失真压缩算法中,无失真静态图像压缩标准(Joint photographic experts group Lossless,JPEG-LS)是利用预测和前文模式(context modeling)来达到较好的压缩比。前文模式需要至少暂存图像的一整排的像素才能够进行各种模式下的预测,因此需要大量的运算和储存空间,而使得编码器(encoder)所需的成本上升。且JPEG-LS对于不需要高压缩率的应用来说,演算复杂度还是较高,而增加编码器的负担。However, a high-quality image without distortion needs to store relatively high pixels, which also poses a big challenge to the calculation speed of the calculator and the capacity of the storage medium. For example, in the lossless compression algorithm, the joint photographic experts group Lossless (JPEG-LS) uses prediction and context modeling to achieve a better compression ratio. The aforementioned mode requires at least one entire row of pixels of the image to be predicted in various modes, thus requiring a large amount of computing and storage space, which increases the cost of the encoder. Moreover, for applications that do not require a high compression rate, JPEG-LS still has high computational complexity, which increases the burden on the encoder.

再加上使用者对于图像的分辨率的要求越来越高,亦增加了图像压缩时的负担。若使用现有的无失真的压缩方式,一旦图像的分辨率提高,编码器更得要耗费漫长的时间以及更大量的储存空间才能处理为高质量图像。换句话说,现有的无失真的压缩方式具有运算复杂度太高而导致运算效率低落,以及所需暂存空间庞大的问题。In addition, users have higher and higher requirements for image resolution, which also increases the burden of image compression. If the existing lossless compression method is used, once the resolution of the image is increased, it will take a long time and a large amount of storage space for the encoder to process it into a high-quality image. In other words, the existing lossless compression methods have the problems of high computational complexity resulting in low computational efficiency and huge temporary storage space required.

因此,如何设计一种无失真的压缩方法,能够兼顾高视觉质量、低运算复杂度以及低暂存空间的需求是工业界相当重要的。Therefore, how to design a lossless compression method that can take into account the requirements of high visual quality, low computational complexity and low temporary storage space is very important in the industry.

发明内容Contents of the invention

为解决上述问题,本发明提供一种无失真(lossless,亦称为无损)的图像压缩方法。无失真的图像压缩方法仅需使用较少的内存空间,且能以较快的速度处理具有多个像素的一图像。其中图像的一图像宽度为W。无失真的图像压缩方法包括下述步骤:(a)由图像中选取连续的N个像素,其中N为大于或等于2的正整数,且N小于图像宽度W;(b)执行一差异脉冲码调制(Differential pulse code modulation,DPCM)手段,以依据此N个像素的值,得到对应此N个像素的N个非负数差值;(c)依据此N个非负数差值,计算得到一编码参数(coding parameter);以及(d)依据编码参数,将此N个非负数差值进行编码。In order to solve the above problems, the present invention provides a lossless (lossless, also referred to as lossless) image compression method. The lossless image compression method requires less memory space and can process an image with multiple pixels at a faster speed. An image width of the image is W. The image compression method without distortion comprises the following steps: (a) select consecutive N pixels from the image, wherein N is a positive integer greater than or equal to 2, and N is less than the image width W; (b) execute a difference pulse code Modulation (Differential pulse code modulation, DPCM) means to obtain N non-negative difference values corresponding to the N pixels based on the values of the N pixels; (c) calculate a code based on the N non-negative difference values A parameter (coding parameter); and (d) encoding the N non-negative difference values according to the encoding parameter.

为了压缩整张图像,无失真的图像压缩方法另可包括下述步骤:(e)接续选取图像的下N个连续的像素;以及(f)返回步骤(b),直到压缩完图像的所有像素。In order to compress the entire image, the image compression method without distortion may further include the following steps: (e) continuously select the next N consecutive pixels of the image; and (f) return to step (b) until all pixels of the image are compressed .

其中步骤(a)可由一缓存器直接接收图像中被选取的N个像素。In step (a), a buffer may directly receive the selected N pixels in the image.

而步骤(b)的差异脉冲码调制手段可包括:依据此N个像素的值,得到分别对应于此N个像素的N个像素差值;以及分别对此N个像素差值执行一变换(mapping)手段,以得到分别对应于此N个像素差值的N个非负数差值。And the difference pulse code modulation means of step (b) can comprise: according to the value of these N pixels, obtain N pixel difference values corresponding to these N pixels respectively; And carry out a conversion to this N pixel difference values respectively ( mapping) to obtain N non-negative difference values respectively corresponding to the N pixel difference values.

根据本发明的一实施范例,依据此N个像素的值,得到分别对应于此N个像素的N个像素差值的步骤可包括:将此N个像素中的第一个像素的值P0作为第一个像素差值d0;以及分别计算此N个像素中的第i个像素的值Pi与其前一个像素的值Pi-1的差,作为其它N-1个像素差值,其中i为正整数,且0<i<N。According to an embodiment of the present invention, according to the values of the N pixels, the step of obtaining N pixel difference values respectively corresponding to the N pixels may include: the value P of the first pixel in the N pixels as the first pixel difference value d 0 ; and respectively calculating the difference between the value P i of the i-th pixel in the N pixels and the value P i-1 of the previous pixel, as the other N-1 pixel difference values, Wherein i is a positive integer, and 0<i<N.

变换手段则可包括:当此N个像素差值中的第i个像素差值di大于或等于零时,对应的第i个非负数差值ni为像素差值di乘以2,其中0=<i<N;以及当此N个像素差值中的第i个像素差值di小于零时,对应的第i个非负数差值ni为像素差值di乘以2再减1。The transformation means may include: when the i-th pixel difference d i among the N pixel differences is greater than or equal to zero, the corresponding i-th non-negative difference n i is the pixel difference d i multiplied by 2, wherein 0=<i<N; and when the i-th pixel difference d i among the N pixel differences is less than zero, the corresponding i-th non-negative number difference n i is the pixel difference d i multiplied by 2 and then minus 1.

用以编码此N个非负数差值的编码参数可以是

Figure GSA00000139062500021
其中ni为此N个非负数差值中的第i个非负数差值。The encoding parameters used to encode the N non-negative difference values can be
Figure GSA00000139062500021
Where n i is the i-th non-negative difference value among the N non-negative difference values.

而上述步骤(d)可包括:依据编码参数,以哥伦布-莱斯编码(Golomb-Ricecode)将此N个非负数差值进行编码。The above step (d) may include: encoding the N non-negative difference values with Golomb-Rice code according to the encoding parameters.

综上所述,根据本发明的无失真的图像压缩方法选取图像中的N个像素,并以可变长度编码将此N个像素的值编码。处理此N个像素时并不需要用到图像中的其它像素,因此编码器的缓存器不需保存其它像素的值。故无失真的图像压缩方法具有节省大量的暂存空间,且压缩方式简单有效率等优点。To sum up, according to the distortion-free image compression method of the present invention, N pixels in the image are selected, and the values of the N pixels are encoded by variable length coding. No other pixels in the image are needed to process the N pixels, so the encoder's buffer does not need to save the values of other pixels. Therefore, the image compression method without distortion has the advantages of saving a large amount of temporary storage space, and the compression method is simple and efficient.

附图说明 Description of drawings

图1为根据本发明一实施范例的图像的示意图;FIG. 1 is a schematic diagram of an image according to an embodiment of the present invention;

图2为根据本发明一实施范例的无失真的图像压缩方法的流程图;FIG. 2 is a flowchart of a method for image compression without distortion according to an embodiment of the present invention;

图3为根据本发明一实施范例的差异脉冲码调制手段的流程图;FIG. 3 is a flowchart of a differential pulse code modulation method according to an embodiment of the present invention;

图4为根据本发明一实施范例的步骤S41的流程图;FIG. 4 is a flowchart of step S41 according to an embodiment of the present invention;

图5为根据本发明一实施范例的变换手段的流程图;以及Fig. 5 is the flowchart of the conversion means according to an embodiment of the present invention; And

图6为根据本发明另一实施范例的无失真的图像压缩方法的流程图。FIG. 6 is a flowchart of a method for image compression without distortion according to another embodiment of the present invention.

其中,附图标记:Among them, reference signs:

20图像20 images

22处理窗22 processing window

具体实施方式 Detailed ways

以下在实施方式中详细叙述本发明的详细特征以及优点,其内容足以使任何本领域的技术人员了解本发明的技术内容并据以实施,且根据本说明书所公开的内容、权利要求及附图,任何本领域的技术人员可轻易地理解本发明相关的目的及优点。The detailed features and advantages of the present invention are described in detail below in the embodiments, the content of which is sufficient to enable any person skilled in the art to understand the technical content of the present invention and implement it accordingly, and according to the disclosed content, claims and accompanying drawings of this specification , any person skilled in the art can easily understand the related objects and advantages of the present invention.

本发明提供一种无失真(lossless,亦称为无损)的图像压缩方法,用以处理具有多个像素的一图像,以将图像压缩。无失真的图像压缩方法可实作于一编码器(encoder)。The present invention provides a lossless (also called lossless) image compression method for processing an image with a plurality of pixels to compress the image. The lossless image compression method can be implemented in an encoder.

请参照图1与图2,其分别为根据本发明一实施范例的图像的示意图与无失真的图像压缩方法的流程图。Please refer to FIG. 1 and FIG. 2 , which are respectively a schematic diagram of an image and a flow chart of a distortion-free image compression method according to an embodiment of the present invention.

图像20具有W×L个像素,其中W为图像20的一图像宽度,L为一图像长度。例如图像20以具有640×480个像素,或是128×128个像素的;则图像宽度W则会是640(像素)或是128(像素)。由于处于图像20中同一排的像素彼此之间具有强大的关联性,因而可被利用于图像压缩。The image 20 has W×L pixels, where W is an image width of the image 20 and L is an image length. For example, the image 20 has 640×480 pixels or 128×128 pixels; then the image width W is 640 (pixels) or 128 (pixels). Since pixels in the same row in the image 20 have a strong correlation with each other, it can be exploited for image compression.

执行无失真的图像压缩方法时,首先由图像20中选取连续的N个像素(步骤S30);其中N为大于或等于2的正整数,且N小于图像宽度W。为了更有效率地执行无失真的图像压缩方法,可以取能整除图像宽度W的数值作为N。换句话说,N能够整除图像20的图像宽度W。例如当图像宽度W为128(像素)时,可取N为16。而选取连续N个像素的步骤S30可以以一处理窗22实作之。处理窗22的长度为N,被处理窗22所框选的N个像素便是依下述流程被压缩的N个像素。When performing the image compression method without distortion, first select N consecutive pixels from the image 20 (step S30); wherein N is a positive integer greater than or equal to 2, and N is smaller than the image width W. In order to implement the image compression method without distortion more efficiently, a value that can divide the image width W by an integer can be taken as N. In other words, N can divide the image width W of the image 20 evenly. For example, when the image width W is 128 (pixels), N can be taken as 16. The step S30 of selecting consecutive N pixels can be implemented with a processing window 22 . The length of the processing window 22 is N, and the N pixels framed by the processing window 22 are the N pixels compressed according to the following process.

编码器具有一缓存器(buffer),以将图像20中需要被处理的部分暂存于缓存器。更详细地说,图像20可以是被存放于内存中的文件,亦可以是由一图像撷取装置的一感光单元传送的图像数据。而步骤S30则可在由内存或是感光单元收到的图像20中选取连续的此N个像素,并由缓存器直接接收此N个像素的值P0~PN-1The encoder has a buffer for temporarily storing the part of the image 20 that needs to be processed in the buffer. In more detail, the image 20 can be a file stored in memory, or can be image data transmitted by a photosensitive unit of an image capture device. In step S30, the consecutive N pixels can be selected from the image 20 received by the memory or the photosensitive unit, and the values P 0 -P N-1 of the N pixels can be directly received by the register.

因此无失真的图像压缩方法压缩图像20时,仅需要用到处理窗22的N个像素,而不需用到图像20中的其它像素。因此编码器的缓存器中亦仅需要存有此N个像素即可,而不需存放图像20中整排的W个像素。Therefore, when the image 20 is compressed by the lossless image compression method, only N pixels of the processing window 22 need to be used, and other pixels in the image 20 do not need to be used. Therefore, it is only necessary to store the N pixels in the buffer of the encoder, instead of storing the entire row of W pixels in the image 20 .

选取连续的N个像素之后,对此N个像素执行一差异脉冲码调制(Differential pulse code modulation,DPCM)手段;以依据此N个像素的值P0~PN-1,得到对应此N个像素的N个非负数差值n0~nN-1(步骤S40)。像素的值例如可以是灰阶值、三原色值(RGB value)或是HSL色彩空间的色相(hue)、饱和度(saturation)、与亮度(lightness)。无失真的图像压缩方法并不对像素的值的内容有所限制。After selecting consecutive N pixels, perform a Differential Pulse Code Modulation (DPCM) method on the N pixels; to obtain the corresponding N pixels according to the values P 0 to P N-1 of the N pixels N non-negative difference values n 0 -n N-1 of pixels (step S40 ). The value of the pixel can be, for example, gray scale value, three primary color values (RGB value), or hue, saturation, and lightness of HSL color space. Lossless image compression methods do not place restrictions on the content of pixel values.

参照图3,其为根据本发明一实施范例的差异脉冲码调制手段的流程图。Referring to FIG. 3 , it is a flowchart of a differential pulse code modulation method according to an embodiment of the present invention.

无失真的图像压缩方法利用差异脉冲码调制手段得到对应于处理窗22的N个非负数差值n0~nN-1,以进行无失真的压缩。差异脉冲码调制手段可以先依据此N个像素的值P0~PN-1,得到分别对应于此N个像素的N个像素差值d0~dN-1(步骤S41)。接着再分别对此N个像素差值执行一变换(mapping)手段,以得到分别对应于此N个像素差值的N个非负数差值n0~nN-1(步骤S46)。The distortion-free image compression method utilizes differential pulse code modulation to obtain N non-negative difference values n 0 ˜n N-1 corresponding to the processing window 22 to perform distortion-free compression. The differential pulse code modulation means can obtain N pixel difference values d 0 ˜d N-1 respectively corresponding to the N pixels according to the values P 0 ˜P N-1 of the N pixels (step S41 ). Next, a mapping means is performed on the N pixel difference values to obtain N non-negative difference values n 0 -n N−1 respectively corresponding to the N pixel difference values (step S46 ).

请配合图3并参照图4以及图5,其分别为根据本发明一实施范例的步骤S41的流程图,以及步骤S46中的变换手段的流程图。Please cooperate with FIG. 3 and refer to FIG. 4 and FIG. 5 , which are respectively a flow chart of step S41 and a flow chart of the transformation means in step S46 according to an embodiment of the present invention.

于步骤S41中,可依据下述式1以及式2计算得到像素差值d0~dN-1In step S41, the pixel difference values d 0 -d N-1 can be calculated according to the following formulas 1 and 2.

d0=P0                               式1d 0 =P 0 Formula 1

di=Pi-Pi-1,0<i<N,且i为正整数    式2d i =P i -P i-1 , 0<i<N, and i is a positive integer Formula 2

其中P0为处理窗22中的N个像素中的第一个像素的值,Pi为处理窗22中的N个像素中的第i个像素的值。而d0为对应P0的像素差值,di为对应Pi的像素差值。Where P 0 is the value of the first pixel among the N pixels in the processing window 22, and P i is the value of the i-th pixel among the N pixels in the processing window 22. And d 0 is the pixel difference corresponding to P 0 , and d i is the pixel difference corresponding to P i .

式1将N个像素中的第一个像素的值P0作为第一个像素差值d0步骤S42)。式2分别计算此N个像素中的第i个像素的值Pi与其前一个像素的值Pi-1的差,作为其它N-1个像素差值d1~dN-1,其中0<i<N(步骤S43)。换句话说,像素差值d1~dN-1将相邻的像素的值P0~PN-1两两相减得到。Formula 1 uses the value P 0 of the first pixel among the N pixels as the first pixel difference value d 0 (step S42). Equation 2 respectively calculates the difference between the value P i of the i-th pixel among the N pixels and the value P i-1 of the previous pixel, as the difference values d 1 to d N-1 of the other N-1 pixels, where 0 <i<N (step S43). In other words, the pixel difference values d 1 -d N-1 are obtained by subtracting the values P 0 -P N-1 of adjacent pixels in pairs.

根据本发明的另一实施范例,可保存有图像20中处理窗22的第一个像素的前一个像素的值P-1。而对应处理窗22的第一个像素差值d0的值即为P0与P-1的差值。According to another embodiment of the present invention, the value P −1 of the pixel preceding the first pixel of the processing window 22 in the image 20 may be stored. The first pixel difference d0 corresponding to the processing window 22 is the difference between P0 and P −1 .

在步骤S41得到处理窗22对应的像素差值d0~dN-1之后,变换手段可先逐一判断这些像素差值di是否大于或等于0(步骤S47),再依下述式3以及式4计算得到非负数差值n0~nN-1After obtaining the pixel difference values d 0 to d N-1 corresponding to the processing window 22 in step S41, the conversion means can first judge whether these pixel difference values d i are greater than or equal to 0 (step S47), and then according to the following formula 3 and Formula 4 calculates non-negative difference values n 0 to n N-1 .

ni=2×di,if di≥0      式3n i =2×d i , if d i ≥0 Equation 3

ni=2×di-1,if di<0    式4n i =2×d i -1, if d i <0 Formula 4

其中ni为N个非负数差值n0~nN-1中的第i个像素的值,且0≤i<N。Where n i is the value of the i-th pixel among the N non-negative difference values n 0 ˜n N-1 , and 0≤i<N.

对于大于或等于0的像素差值di,式3将像素差值di乘以2作为非负数差值ni。也就是说非负数差值ni为像素差值di乘以2(步骤S48)。而对于小于0的像素差值di,式4将像素差值di乘以2再减1的值作为非负数差值ni。也就是说非负数差值ni为像素差值di乘以2再减1(步骤S49)。For the pixel difference d i greater than or equal to 0, Equation 3 multiplies the pixel difference d i by 2 as the non-negative difference n i . That is to say, the non-negative difference value n i is the pixel difference value d i multiplied by 2 (step S48 ). As for the pixel difference d i less than 0, Equation 4 multiplies the pixel difference d i by 2 and then subtracts 1 as the non-negative difference n i . That is to say, the non-negative difference value n i is the pixel difference value d i multiplied by 2 and then subtracted by 1 (step S49 ).

如此一来,便可在步骤S40中依据N个像素的值P0~PN-1,得到对应这N个像素的N个非负数差值n0~nN-1In this way, N non-negative difference values n 0 ˜n N-1 corresponding to the N pixels can be obtained in step S40 according to the values P 0 ˜P N -1 of the N pixels.

请回到图2。接着依据此N个非负数差值n0~nN-1,计算得到一编码参数(coding parameter)k(步骤S50);并依据编码参数k,将此N个非负数差值n0~nN-1进行编码(步骤S60)。Please go back to Figure 2. Then, according to the N non-negative difference values n 0 ~n N-1 , a coding parameter (coding parameter) k is calculated (step S50); and according to the coding parameter k, the N non-negative difference values n 0 ~n N-1 is encoded (step S60).

其中步骤S60可包括:依据编码参数k,以哥伦布-莱斯编码(Golomb-Ricecode)将此N个非负数差值n0~nN-1进行编码。The step S60 may include: encoding the N non-negative difference values n 0 ˜n N−1 by Golomb-Rice code according to the encoding parameter k.

用以处理此N个非负数差值的编码参数可以是 The encoding parameters used to process the N non-negative difference values can be

哥伦布-莱斯编码为一种可变长度编码(variable-length code,VLC),其将出现机率较高的值予以较短的编码。依据哥伦布-莱斯编码,先依据编码参数k设定一除数m。再将此N个非负数差值n0~nN-1除以除数m,得到对应的N个商数Q以及余数R。其中除数m为2的k次方(2k)。The Columbus-Rice code is a variable-length code (variable-length code, VLC), which encodes a value with a higher probability of occurrence to a shorter code. According to Columbus-Rice coding, a divisor m is first set according to the coding parameter k. Then divide the N non-negative difference values n 0 to n N-1 by the divisor m to obtain the corresponding N quotients Q and remainder R. The divisor m is 2 to the kth power (2 k ).

哥伦布-莱斯编码接着将得到的商数Q编码成一元码(unary code),并将于数R编码成k位长度的二进制代码(binary code)。The Columbus-Rice encoding then encodes the obtained quotient Q into a unary code, and encodes the quotient R into a k-bit binary code.

举例而言,假设非负数差值n0为163,编码参数k为5。因此可以算出非负数差值n0的商数Q为5,余数R为3。则非负数差值n0的商数Q可以以一元码被编码成111110,余数R则以二进制代码被编码成00011。For example, assume that the non-negative difference value n 0 is 163, and the encoding parameter k is 5. Therefore, it can be calculated that the quotient Q of the non-negative difference n 0 is 5, and the remainder R is 3. Then the quotient Q of the non-negative difference value n 0 can be coded as 111110 in unary code, and the remainder R can be coded as 00011 in binary code.

如此一来,处理窗22内的N个像素的值P0~PN-1即可被压缩成无失真的可变长度编码。而整个图像20能够被无失真的图像压缩方法压缩。请参照图6,其为根据本发明另一实施范例的无失真的图像压缩方法的流程图。In this way, the values P 0 ˜P N−1 of the N pixels in the processing window 22 can be compressed into a distortion-free variable-length code. Instead, the entire image 20 can be compressed by a lossless image compression method. Please refer to FIG. 6 , which is a flowchart of a lossless image compression method according to another embodiment of the present invention.

执行步骤S30到步骤S60将处理窗22的N个像素压缩后,另可判断是否压缩完图像20的所有像素(步骤S70)。若图像20尚未完全被压缩完成,则接续选取图像20的下N个连续的像素(步骤S80),并以步骤S40、S50以及S60处理于步骤S80中被选取的N个像素。若图像20已被压缩完成为一压缩图像文件,则可结束。After performing step S30 to step S60 to compress the N pixels of the processing window 22, it may also be determined whether all the pixels of the image 20 have been compressed (step S70). If the image 20 has not been fully compressed, continue to select the next N consecutive pixels of the image 20 (step S80), and process the N pixels selected in step S80 with steps S40, S50 and S60. If the image 20 has been compressed into a compressed image file, the process can end.

也就是说,无失真的图像压缩方法在于步骤S30中被选取的N个像素的后接续选取另外N个像素,且可将另外选取的N个像素作为新的处理窗22在处理之。That is to say, in the image compression method without distortion, another N pixels are selected after the N pixels selected in step S30 , and the other N pixels selected can be used as a new processing window 22 for processing.

综上所述,根据本发明的无失真的图像压缩方法选取图像中N个像素,并将选取的像素的值以可变长度编码进行编码。由于在压缩时并不需要用到图像中的其它像素,因此编码器的缓存器仅需保存此N个像素的值,而能够节省大量的暂存空间。且无失真的图像压缩方法仅逐一处理各图像窗内的N个像素值到压缩完整个图像,而具有压缩方式简单有效率的优点。To sum up, according to the distortion-free image compression method of the present invention, N pixels in the image are selected, and the values of the selected pixels are encoded by variable length coding. Since other pixels in the image do not need to be used during compression, the buffer of the encoder only needs to store the values of the N pixels, which can save a lot of temporary storage space. Moreover, the image compression method without distortion only processes N pixel values in each image window one by one to compress the entire image, and has the advantage of simple and efficient compression method.

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.
6. undistorted method for compressing image as claimed in claim 1 is characterized in that this coding parameter is
Figure FSA00000139062400021
N wherein iBe the i in this N the nonnegative number difference this nonnegative number difference.
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.
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 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)

* Cited by examiner, † Cited by third party
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 旭曜科技股份有限公司 An Image Compression System Dynamically Adapting to Compression Parameters
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)

* 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 (2)

* Cited by examiner, † Cited by third party
Title
赵丽红等: "DPCM与小波变换结合的医学图像无损压缩", 《东北大学学报(自然科学版)》 *
金鑫等: "一种快速高效的CT投影数据无损压缩方案", 《中国体视学与图像分析》 *

Cited By (10)

* Cited by examiner, † Cited by third party
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 旭曜科技股份有限公司 An Image Compression System Dynamically Adapting to Compression Parameters
CN105323588B (en) * 2014-06-16 2019-06-21 敦泰电子股份有限公司 Image compression system dynamically adapting to 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
CN102271251A (en) Lossless Image Compression Method
US8254700B1 (en) Optimized method and system for entropy coding
CN107105208A (en) A kind of lossless coding and coding/decoding method of Bayer images
CN106165418A (en) For selecting the system and method for quantization parameter (QP) in display stream compression (DSC)
US7373001B2 (en) Compressed moving image decompression device and image display device using the same
EP2787738A1 (en) Tile-based compression and decompression for graphic applications
CN102246503A (en) Image encoding and decoding device
US8559741B2 (en) Lossless image compression method
WO2011064073A1 (en) Method, device and system for image compression and decompression using support vector regression
WO2022252222A1 (en) Encoding method and encoding device
CN108200429B (en) Bayer image compression method and device
US20110299790A1 (en) Image compression method with variable quantization parameter
JP2011234363A (en) Image processing system and method
JP2008527809A (en) Process for image compression and decompression acceleration
CN107172425B (en) Thumbnail generation method and device and terminal equipment
TWI432031B (en) Distortion-free image compression method
Shi et al. A spatio-temporal video denoising co-processor with adaptive codec
JP2011109172A (en) Video encoder and data processing method for the same
US20170201772A1 (en) Image processing apparatus and method
CN101742279B (en) Compression ratio adjustment method and electronic device of JPEG (Joint Photographic Experts Group) image
TWI401965B (en) Image Compression Method with Variable Quantization Parameters
CN116132759B (en) Audio and video stream synchronous transmission method and device, electronic equipment and storage medium
US20240212216A1 (en) Data compression method and image noise reduction method
TWI384862B (en) Image decoding apparatus and method using the same
TWI484829B (en) System and method for processing 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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20130116

Termination date: 20170602