1. Trang chủ
  2. » Cao đẳng - Đại học

Slide đa phương tiện chương 2 image

52 12 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Nội dung

Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi c om Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology ng th an co ng Digital Image Communication cu u du o Tien Pham Van, Dr rer nat Hanoi University of Science and Technology CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi cu u du o ng th an co ng • Image processing • Image coding • Image communications c om Agenda CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi cu u du o ng th an co ng c om Image processing CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi c om What are images? cu u du o ng th an co ng • An image is a 2-d rectilinear array of pixels CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi c om Pixels as samples cu u du o ng th an co ng • A pixel is a sample of a continuous function CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi c om Images are Ubiquitous ng • Input du o • Output ng th an co – Optical photoreceptors – Digital camera CCD array – Rays in virtual camera cu u – TVs – Computer monitors – Printers CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi c om Properties of Images ng • Spatial resolution th • Intensity resolution an co – Width pixels/width cm and height pixels/ height cm ng – Intensity bits/intensity range (per channel) du o • Number of channels cu u – RGB is channels, grayscale is one channel CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi c om Image errors • Spatial aliasing co ng – Not enough spatial resolution an • Intensity quantization cu u du o ng th – Not enough intensity resolution CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi c om Two issues • Sampling and reconstruction an co ng – Creating and displaying images while reducing spatial aliasing errors th • Halftoning techniques cu u du o ng – Dealing with intensity quantization CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi cu u du o ng th an co ng c om Sampling and reconstruction CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi c om Summary ng • Images are discrete objects th an co – Pixels are samples – Images have limited resolution du o ng • Sampling and reconstruction cu u – Reduce visual artifacts caused by aliasing – Filter to avoid undersampling – Blurring (and noise) are preferable to aliasing CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi cu u du o ng th an co ng c om Encoding 39 CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi Why JPEG co ng c om • The compression ratio of lossless methods (e.g., Huffman, Arithmetic, LZW) is not high enough for image and video compression • JPEG uses transform coding, it is largely based on the following observations: cu u du o ng th an – Observation 1: A large majority of useful image contents change relatively slowly across images, i.e., it is unusual for intensity values to alter up and down several times in a small area, for example, within an x image block A translation of this fact into the spatial frequency domain, implies, generally, lower spatial frequency components contain more information than the high frequency components which often correspond to less useful details and noises – Observation 2: Experiments suggest that humans are more immune to loss of higher spatial frequency components than loss of lower frequency components 40 CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi JPEG Coding Steps Involved: DCT Quantization Discrete Cosine Transform of each 8x8 8x8 8x8 pixel array f(x,y) T F(u,v) Quant… Quantization using a table or using a constant Tables Coding Zig-Zag scan to exploit Zig Zag redundancy Tables Scan Differential Pulse Code Modulation(DPCM) on the DC component and Run length Coding of the DPCM AC components Entropy Coding Entropy coding RLC (Huffman) of the final output Fq(u, v) F(u, v) c om f(i, j) ng du o u Data cu Header Tables th an co ng Cr Cb Y 41 CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi DCT : Discrete Cosine Transform c om DCT converts the information contained in a block(8x8) of pixels from spatial domain to the frequency domain ng th an co ng – A simple analogy: Consider a unsorted list of 12 numbers between and -> (2, 3, 1, 2, 2, 0, 1, 1, 0, 1, 0, 0) Consider a transformation of the list involving two steps (1.) sort the list (2.) Count the frequency of occurrence of each of the numbers ->(4,4,3,1 ) : Through this transformation we lost the spatial information but captured the frequency information – There are other transformations which retain the spatial information E.g., Fourier transform, DCT etc Therefore allowing us to move back and forth between spatial and frequency domains 1-D Inverese DCT: F(ω) = a(u) N −1 ∑ n=0 cu u du o 1-D DCT: (2n+1)ωπ f(n)cos 16 f'(n) = a(u) a(0) = a(p) =1 [ p ≠ N −1 ∑ F(ω )cos ω=0 (2n+1)ωπ 16 ] 42 CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi 2-D DCT • Images are two-dimensional; How you perform 2-D DCT? c om – Two series of 1-D transforms result in a 2-D transform as demonstrated in the figure below th ng 1-D Columnwise 8x8 8x8 cu u 8x8 du o 1-D Rowwise an co ng f(i, j) r F(u, v) F(0,0) is called the DC component and the rest of F(i,j) are called AC components 43 CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi Quantization • Why? To reduce number of bits per sample c om F’(u,v) = round(F(u,v)/q(u,v)) ng • Example: 101101 = 45 (6 bits) Truncate to bits: 1011 = 11 (Compare 11 x =44 against 45) Truncate to bits: 101 = (Compare x =40 against 45) co Note, that the more bits we truncate the more precision we lose an • Quantization error is the main source of the Lossy Compression • Uniform Quantization: th – q(u,v) is a constant ng • Non-uniform Quantization Quantization Tables cu u du o – Eye is most sensitive to low frequencies (upper left corner in frequency matrix), less sensitive to high frequencies (lower right corner) – Custom quantization tables can be put in image/scan header – JPEG Standard defines two default quantization tables, one each for luminance and chrominance 44 CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi Zig-Zag Scan 8x8 cu u du o ng th an co ng c om • Why? to group low frequency coefficients in top of vector and high frequency coefficients at the bottom • Maps x matrix to a x 64 vector 1x64 45 CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi Quantization in JPEG co ng c om Quantization is the step where we actually throw away data Luminance and Chrominance Quantization Table lower numbers in the upper left direction large numbers in the lower right direction The performance is close to the optimal condition 11 10 16 24 40 51 26 58 60 57 87 69 80 u 12 14 19 13 16 24 17 22 29 40 51 22 37 56 35 55 64 68 109 103 81 104 113 cu  16   12  14  14 QY =   18   24  49   72 du o ng th an  F (u , v)  Quantization F (u , v)Quantization = round   Q ( u , v )   Dequantization F (u , v ) deQ = F (u , v )Quantization × Q (u , v ) 64 78 87 103 121 120 92 95 98 112 100 103 CuuDuongThanCong.com 61   55  56   62  77   92  101  99   17   18  24  47 QC =   99   99  99   99 18 24 47 99 99 99 99   21 26 66 99 99 99 99  26 56 99 99 99 99 99   66 99 99 99 99 99 99  99 99 99 99 99 99 99   99 99 99 99 99 99 99  99 99 99 99 99 99 99   99 99 99 99 99 99 99  https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi ng c om JPEG Modes Sequential Mode: • Each image is encoded in a single left-toright, top-to-bottom scan cu u du o ng th an co – The technique we have been discussing so far is an example of such a mode, also referred to as the Baseline Sequential Mode 47 CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi JPEG Modes th an co ng c om Lossless Mode: • Truly lossless • It is a predictive coding mechanism as opposed to the baseline mechanism which is based on DCT and quantization(the source of the loss) • Here is the simple block diagram of the technique: cu u du o ng Predictive Difference Huffman EnCoder Lossless Coding 48 CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi Lossless Mode (Contd ) Predictive Difference: th an co ng c om – For each pixel a predictor (one of possible) is used that best predicts the value contained in the pixel as a combination of up to neighboring pixels – The difference between the predicted value and the actual value (X)contained in the pixel is used as the predictive difference to represent the pixel – The predictor along with the predictive difference are encoded as the pixel’s content – The series of pixel values are encoded using huffman coding A u B P3 C P4 A+B-C P5 A + (B-C)/2 P6 B + (A-C)/2 P7 (A+B)/2 cu CB AX P2 ng P1 Prediction du o Predictor Notes: r The very first pixel in location (0, 0) will always use itself r Pixels at the first row always use P1, r Pixels at the first column always use P2 r The best (of the 7) predictions is always chosen for any pixel 49 CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi JPEG Modes u du o ng th an co ng Spectral Selection : Send DC component and first few AC coefficients first, then gradually some more ACs cu – c om Progressive Mode: It allows a coarse version of an image to be transmitted at a low rate, which is then progressively improved over subsequent transmissions Image Pixels Spectral Selection: First Scan: Second Scan: Third Scan: Nth Scan: 50 CuuDuongThanCong.com https://fb.com/tailieudientucntt Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi Hierarchical Mode c om ng I4 Encode co 4x4 I Encoding 4x4 I’4 2x2 Encode Decode + + 2x2 + - CuuDuongThanCong.com Decode th du o ng 2x2 I 2x2 + L4 an Decode u • Used primarily to support multiple resolutions of the same image which can be chosen from depending on the target’s capabilities The figure here shows a description of how a 3-level hierarchical encoder/decoder works: cu • L2 Decode + I’2 2x2 L1 Encode Decode + Decoding https://fb.com/tailieudientucntt I’ 51 Pham Van Tien, Dr rer nat , Embedded Networking Research Group Faculty of Elec and Telecom, Hanoi University of Science and Technology Email: tienpv-fet@mail.hut.edu.vn C9-411 Dai Co Viet str 1, Hanoi Homework cu u du o ng th an co ng c om • Investigate JPEG decoder • Investigate JPEG2000 standard CuuDuongThanCong.com https://fb.com/tailieudientucntt ... condition 11 10 16 24 40 51 26 58 60 57 87 69 80 u 12 14 19 13 16 24 17 22 29 40 51 22 37 56 35 55 64 68 109 103 81 104 113 cu  16   12  14  14 QY =   18   24  49   72 du o ng th an... 103 121 120 92 95 98 1 12 100 103 CuuDuongThanCong.com 61   55  56   62  77   92  101  99   17   18  24  47 QC =   99   99  99   99 18 24 47 99 99 99 99   21 26 66... Encoding 4x4 I’4 2x2 Encode Decode + + 2x2 + - CuuDuongThanCong.com Decode th du o ng 2x2 I 2x2 + L4 an Decode u • Used primarily to support multiple resolutions of the same image which can be

Ngày đăng: 07/09/2021, 11:00

w