Digital Image Processing

IMAGE – PART2

Hamid R. Rabiee Fall 2015 Predictive Techniques 2

 Previous methods doesn’t consider correlation between pixels. However, in real word images we always expect some kind of correlation in images.  The philosophy underlying predictive techniques is to remove mutual redundancy between successive pixels and encode only the new DPCM (differential PCM) 3

 For each pixel 풖 풏 a quantity 풖 .(풏) an estimate of 풖.(풏) (decoded sample), is predicted from the previously decoded samples

 Now it is sufficient to code the prediction error:

 If 풆.(풏) is the quantized value of 풆(풏) then: DPCM scheme 4 Feedforward Prediction 5

 In DPCM the prediction is based on the output rather than the input, so that the quantizer error at a given step is fed back to the quantizer input at the next step.

 If the prediction rule is based on the past inputs the signal reconstruction error would depend on all the past and present quantization errors in the feedforward prediction-error sequence. Feedback Versus Feedforward 6 Prediction Example Delta 7

 The simplest of the predictive coders uses a one-step delay function as a predictor and a 1-bit quantizer, giving a 1-bit representation of the signal: Other DPCM Variants 8

 Line-by-Line DPCM:

 In this method each scan line of the image is coded independently by the DPCM technique.  Two-Dimensional DPCM: Adaptive Techniques for DPCM 9

 To improve DPCM performance we can adapt the quantizer or predictor to variations in the local statistics of the image data such as:

 Adaptive gain control

 Adaptive classification Adaptive gain control 10

 A simple adaptive quantizer updates the variance of the prediction error at each step and adjusts the spacing of the quantizer levels accordingly.

 This can be done by normalizing the prediction error by its updated standard deviation and designing the quantizer levels for unit variance inputs Adaptive classification 11

 These schemes segment the image into different regions according to spatial detail, or activity, and different quantizer characteristics are used for each activity class (e. g. the variance of the pixels in the neighborhood of the pixel). of images 12

1. Divide the given image (푴 × 푵) into small rectangular blocks of size 풑 × 풒 and transform each block to obtain 푽풊, 풊 = ퟏ, … , 푰 − ퟏ, 푰 = 푴푵/풑풒. ퟐ 2. Calculate the transform coefficient variances 흈풌,풍 and allocate bits based on:

3. Design the quantizers:

 The dc coefficient distribution is modeled by the Rayleigh density.

 For the remaining tranform coefficients, Laplacian or Gaussian densities are used to design their quantizers.

4. Code the output into code words and transmit or store.

5. Assuming a noiseless channel, reproduce the coefficients at the decoder as: Transform Coding Example 13 Transform Coding Performance 14 Zonal Versus Threshold Coding 15

 We define a zonal mask as the array: Hybrid coding and vector DPCM 16 Case Study: JPEG basline 17

1. The first step is to level shift each input image pixel by subtracting integer 128 from it to create a two’s complement image representation.

2. Next, non-overlapping pixel blocks are extracted from the YCbCr components of the color image.

3. Each block then undergoes a ퟖ × ퟖ discrete cosine transform.

4. The transform coefficients are quantized by division by ퟖ × ퟖ quantization array.

5. The next step in the encoder is symbol coding of the quantized coefficients

6. This step is followed by Huffman entropy coding of the coefficient symbols to create the compressed image. JPEG system scheme 18

1. The first step is to level shift each input image pixel by subtracting integer 128 from it to create a two’s complement image representation.

2. Next, non-overlapping pixel blocks are extracted from the YCbCr components of the color image.

3. Each block then undergoes a ퟖ × ퟖ discrete cosine transform.

4. The transform coefficients are quantized by division by ퟖ × ퟖ quantization array.

5. The next step in the encoder is symbol coding of the quantized coefficients

6. This step is followed by Huffman entropy coding of the coefficient symbols to create the compressed image. JPEG baseline default quantization arrays 19

JPEG baseline default luminance quantization array JPEG baseline default chrominance quantization array JPEG DC coefficient encoding 20

 The symbol coding process for DC coefficients begins with the generation of the difference of the DC coefficient of the present block from the DC coefficient of the corresponding previously processed block of the same type

 There are 12 difference categories, denoted by the four bit index SSSS in the JPEG baseline standard.

 The DC difference can be coded by a category index Huffman code appended by an additional bits code. 21

JPEG baseline difference categories for DC coding 22

Luminance and chrominance DC difference Huffman codes JPEG AC coefficient encoding 23

 The symbol coding process for AC coefficients begins with the formation of a one dimensional array of the 63 AC coefficients by zigzag scanning of a block of DCT coefficients.

 The non-zero coefficients are run length coded to produce a code pair RRRR/SSSS

 RRRR denotes the run length of zeros before the next non-zero coefficients

 SSSS is the size of the next non-zero coefficient 24

JPEG baseline categories for AC coding JPEG2000 baseline image coding 25

1. The JPEG2000 standard specifies low pass and high pass analysis and synthesis finite impulse response (FIR) filters. They are the so called Daubechies (9,7) 9-tap and 7-tap FIR biorthogonal spline filters.

2. The JPEG 2000 standard specifies uniform scalar quantization of subband coefficients with a step size of ∆풃 and a zero-level step dead-zone width of ퟐ∆풃 .The quantization operation is governed by

and s.t.

3. Then the quantized coefficients are converted to sign-magnitude format for (which is out of our scope). JPEG2000 Discrete Wavelet Filters 26 JPEG2000 vs. JPEG 27 End of Lecture 16 – part2

Thank You!

images and materials are taken from Jain and Pratt book.