Question: Please code this in Julia. 3 . ( Compressing a Grayscale Image ) Download the file 'lion.jpg ' , and import it into Julia using

Please code this in Julia. 3.(Compressing a Grayscale Image) Download the file 'lion.jpg', and import it into Julia using 'img=load("lion.jpg")'. Convert the image into a grayscale image with 'img2=Gray.(img)'. Then convert the image into a matrix A.
(a) After level shifting the matrix, and applying the DCT to each 8 x 8 block, apply a low pass filter by letting \( y_{i j}=0\) whenever \( i \pm j \geq 4\). Use the Inverse DCT and then undo the level shifting to construct an approximation matrix \(\bar{A}\). Compare the compressed image with the original image.
(b) Construct another approximation matrix \(\overline{\bar{A}}\) by using the singular value decomposition to compute a rank 30 approximation of \( A \). Repeat with a rank 20 approximation. Compare both compressed images with the original image.
Please code this in Julia. 3 . ( Compressing a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!