EIE4435
Image and Audio Processing
Semester 1, 2023/24
Q1 . (a) What is the difference between the HSI color model and the RGB color model? (2 marks)
(b) Use a median filter of size 3×3 to compute the median filtering output of the following image.
Hence, what is the primary purpose of using a median filter in image processing? (4marks)
(c) An image of YUV format has a frame resolution of 1920×1080 with a 4:1:1 color sub-sampling
format, and 8 bits for each component. Determine the storage requirement of the image. (3 marks)
(d) Let us consider a 3-bit image with dimensions of 64 × 32 pixels. The image’s intensity distribution, as shown in Table Q1, consists of intensity levels rk (where k = 0, 1, . . ., 7) . These intensity levels are integers ranging from 0 to 7. In Table Q1, nk denotes the number of pixels that have intensity rk.
Table Q1
By using Table Q1, derive the discrete form of the global histogram equalization transformation function. Comments on the image before and after global histogram equalization. (11 marks)
Q2 . (a) The Two-dimensional Discrete Cosine Transform (2D DCT) is a coding method adopted in the
JPEG standard. It aims to transform the intensity values of a grayscale image into a transform. domain, which consists of a DC coefficient and AC coefficients. The following two 8×8 blocks of intensities, namely f(x,y) and g(x,y), undergo the 2D DCT process, resulting in their respective transformation domain representations, denoted as F(u,v) and G(u,v), respectively.
Describe the pattern of the coefficients in F(u,v) and G(u,v) and label the positions of the DC and AC coefficients. Explain how their appearances correspond to the patterns of the intensities. (Note: No calculations of the coefficients are necessary for this explanation.) (5 marks)
(b) Figure Q2a shows a 256 gray-level image which consists of four 4×4 blocks. The image is encoded using a JPEG baseline encoder. The 16 quantized Discrete Cosine Transform (DCT) coefficients of the four 4×4 blocks in the image are given in Figure Q2a. Each block consists of a DC coefficient and 15 AC coefficients.
Figure Q2a
(i) Using the DC Coding Table and the AC Coding Table in Table Q2a and Table Q2b, respectively, find the output bitstream for the whole image. (11 marks)
(ii) Determine the compression ratio of the image. (2 marks)
Table Q2a: DC Coding Table
Table Q2b: AC Coding Table
(c) If you were to compress (i) a photograph of a dog and (ii) a comic strip cartoon drawing, which
file format (GIF or JPEG) would you select? Please provide a rationale for your choice. (2 marks)
Q3 . (a) Draw the medial axis of the shaded object shown in Figure Q3a. The bold black line shows the
boundary of the object. Determine whether the center of square ABCD is on the medial axis of the shaded object. Answer this question in the attached answer sheet.
Figure Q3a
(6 marks)
(b) Represent the contour of the object shown in Figure Q3b in a clockwise direction with an 8- directional chain code. The resultant chain code should be normalized with respect to the orientation of the object and then the starting point of the chain code.
Figure Q3b
(4 marks)
(c) Figure Q3c shows a 7×6 digital image of 3-bit amplitude resolution. The allowable gray levels for this image range from 0 to 7.
Figure Q3c
(i) Apply the thresholding technique to segment the image depicted in Fig. Q3c. Determine an appropriate threshold value and perform image thresholding accordingly. Set the initial threshold to the average of pixel intensities. Adhere to the following rule during thresholding or grouping: assign pixel (i,j) to group A if I(i, j) ≤ the current threshold T; otherwise, assign pixel (i, j) to group B, where I(i, j) is the intensity value of pixel (i,j) . (7 marks)
(ii) Identify a limitation of the thresholding technique and propose a potential solution to overcome it. (3 marks)
Q4 . A perceptual audio codec is used to compress an audio signal. The codec extracts windowed segments from the audio signal and carries out a spectrum analysis on each of them. According to the result of the spectrum analysis, it groups every 4 barks into a subband and then allocates bits to different subbands based on a psychoacoustic model. All samples in the same subband are quantized with the same quantizer, and the bit resolution of which is determined by the codec .
Figure Q4a shows the frequency spectrum of a windowed segment of the audio signal. The psychoacoustic model shown in Figure Q4b is used in the audio codec to derive the masking threshold for the audio segment.
Figure Q4a
Figure Q4b
(a) Locate the potential maskers. Mark them in the attached answer sheet. (1 mark)
(b) Based on the given psychoacoustic model, derive the masking threshold and show it in the attached answer sheet. (6 marks)
(c) Derive the signal-to-mask ratio of each subband. (3 marks)
(d) Suppose allocating one additional bit to each sample of a subband results in a 5dB drop of the noise floor in that subband. Allocate an appropriate number of bits per sample to individual subbands. You can assume that there is no bit budget constraint. (2 marks)
(e) The original windowed segment of the audio signal covers 1000 time samples per stereo channel. If we extend the window to cover 2000 time samples per stereo channel, what will be its impact on the coding performance of the codec? (4 marks)
(f) If the available bit budget for the windowed segment of the audio signal is 2 bits less than the required number of bits computed in (d), adjust your bit allocation result to optimize the signal- to-noise ratio of the segment of the signal. (4 marks)
Q5 . Figure Q5a shows the block diagram of a circuit that is designed to quantize a sampled analog audio signal.
Figure Q5a
Figure Q5b
(a) Derive the z-domain transfer function of the module shown in Figure Q5b. (5 marks)
(b) Based on the result obtained in Q5(a), derive the z-domain transfer function of the circuit shown in Figure Q5a. Contrast its difference from a 2nd order sigma-delta modulator. (8 marks)
(c) The circuit is used to quantize a sampled analog audio signal to produce a digital audio signal. Explain why the circuit can help to improve the perceptual quality of the digital signal. (2 marks)
(d) The module shown in Figure Q5c is designed to handle an input in range [0,1] . Its quantizer produces its output based on its input d as
If the input signal of the module is a periodic sequence and its period is {4/6, 5/6}, what will be the output sequence of the module? You can assume that the initial quantizer error is 0. (5 marks)
Figure Q5c