65
Basic Image Compression Concepts Presenter Guan-Chen Pan Research Advisor Jian-Jiun Ding , Ph. D. Assistant professor Digital Image and Signal Processing Lab Graduate Institute of Communication Engineering National Taiwan University 1

Basic Image Compression Concepts Presenter : Guan-Chen Pan Research Advisor : Jian-Jiun Ding, Ph. D. Assistant professor Digital Image and Signal Processing

Embed Size (px)

Citation preview

PowerPoint

Basic Image Compression Concepts

PresenterGuan-Chen PanResearch AdvisorJian-Jiun Ding , Ph. D.Assistant professor

Digital Image and Signal Processing LabGraduate Institute of Communication EngineeringNational Taiwan University

11OutlinesIntroductionsBasic concept of image compressionProposed method for arbitrary-shapeimage segment compressionImprovement of the boundary region by morphologyJPEG2000Triangular and trapezoid regions and modified JPEG image compression

2IntroductionLossless or lossy(widely used)

3YCbCr Ythe luminance of the image which represents the brightnessCbthe chrominance of the image which represents the difference between the gray and blueCrthe chrominance of the image which represents the difference between the gray and red

4Chrominance SubsamplingThe name of the format is not always related to the subsampling ratio.

567Reduce the Correlation between PixelsTransform coding Coordinate rotationKarhunen-Loeve transformDiscrete cosine transformDiscrete wavelet transformPredictive coding8Coordinate rotation

HeightWeight9do the inverse transform to get the data and reduce the correlation

10Karhunen-Loeve transform(KLT)1112Discrete cosine transformThe DCT is an approximation of the KLT and more widely used in image and video compression.The DCT can concentrate more energy in the low frequency bands than the DFT.13Discrete wavelet transformWavelet transform is very similar to the conventional Fourier transform, but it is based on small waves, called wavelet, which is composed of time varying and limited duration waves.We use 2-D discrete wavelet transform in image compression.14

15Predictive CodingPredictive coding means that we transmit only the difference between the current pixel and the previous pixel.The difference may be close to zero.However, the predictive coding algorithm is more widely used in video.EX. Delta modulation (DM), Adaptive DM. DPCM ,Adaptive DPCM (ADPCM)16Quantization17Luminance quantization matrix

Chrominance quantization matrix

Removes the high frequencies1611101624405161121214192658605514131624405769561417222951878062182237566810910377243555648110411392496478871031211201017292959811210010399

18Entropy Coding AlgorithmsHuffman CodingDifference Coding (DC)Zero Run Length Coding (AC)Arithmetic CodingGolomb Coding

19Huffman CodingHuffman coding is the most popular technique for removing coding redundancy.Unique prefix propertyInstantaneous decoding propertyOptimalityJPEG(fixed, not optimal)20

21Difference Coding22Zero Run Length CodingEncode each value which is not 0, than add the number of consecutive zeroes in front of it EOB (End of Block) = (0,0)Only 4-bit value[57,45,0,0,0,0,23,0,-30,-16,0,,0][(0,57)(0,45)(4,23)(1,-30)(0,16)EOB]Eighteen zeroes, 3 (15,0) ; (2,3)where (15,0) is 16 consecutive zeroes

23

24Arithmetic Coding25

26SymbolProbabilitySub-intervalk0.05[0.00,0.05)l0.2[0.05,0.25)u0.1[0.25,0.35)w0.05[0.35,0.40)e0.3[0.40,0.70)r0.2[0.70,0.90)?0.1[0.90,1.00)

27SymbolProbabilitySub-intervalk0.05[0.00,0.05)l0.2[0.05,0.25)u0.1[0.20,0.35)w0.05[0.35,0.40)e0.3[0.40,0.70)r0.2[0.70,0.90)?0.1[0.90,1.00)0.071334 LSymbolProbabilitySub-intervalk0.05[0.05,0.06)l0.2[0.06,0.1)u0.1[0.1,0.12)w0.05[0.12,0.13)e0.3[0.13,0.19)r0.2[0.19,0.23)?0.1[0.23,0.25)For interval 0.05~0.250.071334 L28Golomb Coding293031Encoding of quotient partqoutput bits00110211031110411110511111061111110::N0Encoding of remainder partroffsetbinaryoutput bits00000000011000100122001001033001101144010010055010110161211001100713110111018141110111091511111111Decode 101111

q = 1, r = 9 a = 10*1+9 = 19

32Without codeword tableFlexibility and adaptationHuffmanNOGOODGolomb YESMIDDLEAdaptive GolombYESGOOD33Proposed Method for Arbitrary-Shape Image Segment Compression

An arbitrary-shape image segment f and its shape matrix.34Standard 8x8 DCT bases with the shape of f

35The 37 arbitrary-shape orthonormal DCT bases by Gram-Schmidt process

36Quantization

37Improvement of the Boundary Region by Morphology

38JPEG2000JPEG 2000 is a new standard and it can achieve better performance in image compression.AdvantagesEfficient lossy and lossless compressionSuperior image qualityAdditional features such as spatial scalability and region of interest.Complexity39JPEG 2000 encoder

JPEG 2000 decoder

Embedded Block Coding with Optimized Truncation(EBCOT) : Tier-1+Tier-240

41Irreversible component transform (ICT)

42Reversible component transform (RCT)Reversible and integer-to-integer

43

44Irreversible , Daubechies 9/7 filter

Analysis Filter CoefficientsSynthesis Filter CoefficientsnLowpass Filter Highpass Filter Lowpass Filter Highpass Filter 00.6029490182361.1150870524561.1150870524560.602949018236310.266864118442-0.0591271763110.591271763114-0.26686411844282-0.078223266528-0.057543526228-0.057543526228-0.07822326652893-0.01686411844280.091271763114-0.09127176311420.016864118442840.0267487574100.026748757410845

46Tier-1 Encoder

Each Fractional Bit-plane coding will generate the Context (CX) and the Decision (D), which are used for arithmetic coding.zero codingsign coding magnitude refinement codingrun length coding47Bit-plane ConversionConverts the quantized wavelet coefficients into several bit-planesFirst bit-plane is the sign planeThe other planes are the magnitude plane, from MSB to LSB

4817223348648096112222838526781961123338486275861001164852627083961101256467758396108118132808186961081171281429696100110118128140150112112116125132142150160

17 = 000100012160 = 10100000249Stripe and Scan Order

50Zero Coding

D : current encode data, binary : 0 or 1h :0~2v :0~2d :0~4

dvdhDhdvd51Sign Coding

vhDhv52Magnitude Refinement Coding[x,y] is initialized to 0, and it will become 1 after the first time of the magnitude refinement coding is met at [x,y]

53Run-Length CodingFor four zeros : (CX,D) is (0,0)Else is (0,1), and use 2 uniform(CX=18) to record the 1s position(0110)The first nonzero position is (01)2 (0,1), (18,0), (18,1) 54

D(0,1) CX(total 19)Arithmetic encoderCompressed data55Why Called Fractional

56Tier-2 EncoderRate/Distortion optimized truncation

57Triangular and Trapezoid Regions and Modified JPEG Image CompressionDivide an image into 3 parts: Lower frequency regionsTraditional image blocks and The arbitrarily-shaped image blocks

5811111111100111111111011111111001111111000011011110001001110000000011000000001100

1 sections1 sections1 sections1 sections2 sections2 sections1 sections1 sections

Zone 1Zone 2Zone 359-distance < threshold

60

Corner too close

Trapezoid inside the zone 61

N = K(m) + K(M-1-m)

N = 1062

63Reference:J.D Huang "Image Compression by Segmentation and Boundary Description, " 2008.G. Roberts, "Machine Perception of Three-Dimensional Solids," in Optical and Electro- Optical Information Processing, J. T. T. e. al., Ed. Cambridge, MA: MIT Press, 1965, pp. 159-197.J. Canny, "A Computational Approach to Edge Detection," IEEE Trans. Pattern Analysis and Machine Intelligence, vol. 8, pp. 679-698, Nov. 1986.D. Comaniciu and P. Meer, "Mean Shift: A Robust Approach toward Feature Space Analysis, " IEEE Trans. Pattern Analysis and Machine Intelligence, vol. 24, pp. 603-619, 2002.J.J Ding, P.Y Lin, S.C Pei, and Y.H Wang, "The Two-Dimensional Orthogonal DCT Expansion in Triangular and Trapezoid Regions and Modified JPEG Image Compression, ",VCIP2010J.J Ding, S.C Pei, W.Y Wei, H.H Chen, and T.H Lee, "Adaptive Golomb Code for Joint Geometrically Distributed Data and Its Application in Image Coding", APSIPA 2010W.Y Wei, "Image Compression", available in http://disp.ee.ntu.edu.tw/tutorial.phpK. R. Rao and P. Yip, Discrete Cosine Transform, Algorithms, Advantage, Applications, New York: Academic, 1990.S.S. Agaian, Hadamard Matrices and Their Applications, New York, Springer-Verlag, 1985.H. F. Harmuth, Transmission of information by orthogonal functions, Springer, New York, 1970.64R. Koenen, Editor, Overview of the MPEG-4 Standard, ISO/IEC JTC/SC29/WG21, MPEG-99-N2925, March 1999, Seoul, South Korea.T. Sikora, MPEG-4 very low bit rate video, IEEE International Symposium on Circuits and Systems, ISCAS 97, vol. 2, pp. 1440-1443, 1997.T. Sikora and B. Makai, Shape-adaptive DCT for generic coding of video, IEEE Trans. Circuits Syst. Video Technol., vol. 5, pp. 59-62, Feb. 1995.W.K. Ng and Z. Lin, A New Shape-Adaptive DCT for Coding of Arbitrarily Shaped Image Segments, ICASSP, vol. 4, pp. 2115-2118, 2000.S. C. Pei, J. J. Ding, P. Y. Lin and T. H. H. Lee, Two-dimensional orthogonal DCT expansion in triangular and trapezoid regions, Computer Vision, Graphics, and Image Processing, Sitou, Taiwan, Aug. 2009.D. A. Huffman, "A method for the construction of minimum-redundancy codes," Proceedings of the IRE, vol. 40, no. 9, pp. 1098-1101, 1952.S. W. Golomb, "Run length encodings," IEEE Trans. Inf. Theory, vol. 12, pp. 399-401, 1966.R. Gallager and D. V. Voorhis, "Optimal source codes for geometrically distributed integer alphabets," IEEE Trans. Information Theory, vol. 21, pp. 228230, March 1975.R. F. Rice, "Some practical universal noiseless coding techniquespart I," Tech. Rep. JPL-79-22, Jet Propulsion Laboratory, Pasadena, CA, March 1979. G. Seroussi and M. J. Weinberger, "On adaptive strategies for an extended family of Golomb-type codes," Proc. DCC97, pp. 131-140, 1997. C. J. Lian JPEG2000 , DSP/IC design lab, GIEE, ntu 65Image

R

G

B

YCbCr ColorTransform

ChrominanceDownsampling(4:2:2 or 4:2:0)

8 8 FDCT

Quantizer

QuantizationTable

Zigzag &Run Length Coding

DifferentialCoding

HuffmanEncoding

HuffmanEncoding

Bit-stream

Y

Cb

Cr

W

W

W

H

H

H

Y

W

H

Y

W

H

Cb

W/2

H

Cr

W/2

H

Cb

W/2

H/2

Cr

W/2

H/2

(a) 4 : 4 : 4

(b) 4 : 2 : 2

(c) 4 : 2 : 0

Y

W

H

Cb

W/4

H

Cr

W/4

H

(d) 4 : 1 : 1

Original sequence X=(x0,x1)

New Height y0New Width y1

181.9713.416

203.4060.887

161.5540.560

183.844-1.220

141.512-3.223

206.133-2.999

173.823-3.111

120.721-5.152

89.159-7.112

2

2

2

2

2

2

Columns

Rows

LL2

LH2

LH1

HH1

HL1

HL2

HH2

a2

a6

a1

a4

a3

a5

Symbol

Probability

0.4

0.3

0.1

0.1

0.06

0.04

1

0.4

0.4

0.3

0.3

0.2

0.1

0.1

0.1

0.1

0.4

0.3

0.3

0.6

0.4

2

3

4

Code

1

00

011

0100

01010

01011

7596

105989910173856660

100978994876455

849490817166

9386948170

86868172

989778

105104

00001100

11111111

01111111

00111111

00111110

00011110

00011100

00011000

01234567

0

1

2

3

4

5

6

7

12345678910

11121314151617181920

21222324252627282930

31323334353637

ForwardComponentTransform

Quantization

Forward2D DWT

RateControl

Tier-1Encoder

Tier-2Encoder

OriginalImage

CodedImage

Tier-2Decoder

Tier-1Decoder

Dequantization

Inverse2D DWT

InverseComponentTransform

ReconstructedImage

CodedImage

DWT in each tile

Image Component

Tiling

2

2

2

2

2

2

Columns

Rows

Bit-planeConversion

FractionalBit-planeCoding

ArithmeticCoding

Tier-1 Encoder

Context

Decision

QuantizedDWTcoefficients

N

Sign

MSB

LSB

M

codingorder

0

0

1

0

0

1

1

MSB

LSB

First 1 appear

Insignificant

Significant

The bit to be coded

Trapezoid and triangular regions

Traditional 8X8 image blocks

8X8 SADCT image blocks

Zone 1

Zone 2-1

Zone 2-2

Zone 3

2 zones

1 zone

1 zone

(M-1)th row

(M-2)th row

1st row

0th row

.

.

.

.

.

.

m = M-1

m = M-2

m = 1

m = 0

.

.

.

.

.

.

n = 0 1 2

Region A

Region B

Rotation by 180

Region A

Region B

Rectangular Region

(a)

(b)