Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exercise 1: DCT Based Compression In this exercise, we will perform DCT based compression. For this aim, we will first calculate the DCT coefficients of
Exercise 1: DCT Based Compression In this exercise, we will perform DCT based compression. For this aim, we will first calculate the DCT coefficients of an image and remove the high frequency components. Input Image Output DCT Zigzag Mask Inverse Zigzag IDCT Image Figure 1: Block diagram of the given exercise. 1) Load the Lena image file by using imread function. 2) Carry out the Forward DCT on the subblocks of image with size 8 x 8. You may use dct2.m and blockproc.m as in the following code. B = 8; fun = @(block_struct) dct2 (block_struct.data); dct_transform = blockproc (img_org, [B, B], fun); 3) You can use ZigzagMtx2Vector.m that is provided to you to perform zigzag scanning 4) Try to remove higher frequency components by using a mask matrix consisting of l's at the lower frequencies and 0's in the higher frequencies. 5) Use Vector2ZigzagMtx.m for iZigzag. 6) Perform inverse DCT to obtain the output image. 7) Display the input and the output images in a single figure. 8) Perform this experiment by removing %15, %45 and %85 of the DCT coefficients. Exercise 1: DCT Based Compression In this exercise, we will perform DCT based compression. For this aim, we will first calculate the DCT coefficients of an image and remove the high frequency components. Input Image Output DCT Zigzag Mask Inverse Zigzag IDCT Image Figure 1: Block diagram of the given exercise. 1) Load the Lena image file by using imread function. 2) Carry out the Forward DCT on the subblocks of image with size 8 x 8. You may use dct2.m and blockproc.m as in the following code. B = 8; fun = @(block_struct) dct2 (block_struct.data); dct_transform = blockproc (img_org, [B, B], fun); 3) You can use ZigzagMtx2Vector.m that is provided to you to perform zigzag scanning 4) Try to remove higher frequency components by using a mask matrix consisting of l's at the lower frequencies and 0's in the higher frequencies. 5) Use Vector2ZigzagMtx.m for iZigzag. 6) Perform inverse DCT to obtain the output image. 7) Display the input and the output images in a single figure. 8) Perform this experiment by removing %15, %45 and %85 of the DCT coefficients
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started