Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Image Compression Exercises Instructions. The following problems on be done interactively or by writing the e n ds in in M file (or by a

image text in transcribed

image text in transcribed

Image Compression Exercises Instructions. The following problems on be done interactively or by writing the e n ds in in M file (or by a combination of the two). In the case, record all MATLAB input commands and output in a text document and edit it needing to the station of LABI and LAB 2. For problem 2, include a picture of the rank approximation. For problems, include picture of the rank 10 p oimation und for problem include a picture of the lower imation that, in your opinion, gives septable approximation to the signal picture Crop and remine the pictures so that they do not take up too much spend paste them into your Inb report in the appropriate order. Step 1. Download the file gauss.jpg and save it to your working MATLAB directory Then load it into MATLAB with the command A = israad 'gaus.PE'); note the semicolon ! The semicolon is acessary so that MATLAB does not print out man serentals of data The reult is a matrix of grande valor corresponding to black and white picture of dog. The matrix ans 279198 tries). Now. A ctually 446 x 620 x 3 Torte image from the matrix A, MATLAB use the three values Ali,,1:3) in the RGB values to use to color the pixel in the i-th row and j-th colum. We have a black and white picture so AC:,:,1) = A(...2) = A(:,:,3) and we only need to work with A(:, :,1). Step 2. We need to do some initial processing. Type B = doublo (A:.:,1)); % don't forget the semicolon which couverts A into the double-precision format that is needed for the singular value decomposition. Now type B = B/255; % semicolon! [USV) syd (): % semicolon! This decomposition is just Eq. (1). The guy senle from 0 to 255 in a black-and-white JPEG image. We divide Bly 2:55 to obtain val between 0 and 1, which is required for MATLAB's image routine which we will use Inter PROBLEM 1. What are the dimensions of U, S, and V? Find out by typing size(U) - without the colon-A likewise for the others) Here Shu more o n the rows, infinet emne 447 to 62 are alwo When A has more than To, we pads on the right with con to tu Sito mx matrix). Otherwise, with this modification, the SVD is just like Eq. 1. PROBLEM 2. Compute the best run-1 paciention to Band store it in the matrix Tank 1 Use the commands given in the E mple parts and (b) omge2 but applied to the matrix Brother than A. Make sure you sure the output) Step 3. Let's visualiserank1. To do that first create C = zeros(size(A)): semicolon! This creates an array of eros, C, of the same dimension is the original image matrix A. Step 4. Copy the rank-l image into C as follows: CC:,:,1) CC: 2) CC,,3) ranki: = ranki: rank 1: Include the code and the figure in your report Step 5: We armot done, except for one bitch. MATLAB deel its swinging values from to land maps them to wes between O d 255 for the phishardware Lower rank approximation to the actualm e n have bees that are slightly less than and greater than 1. So we will trane te them to fit, as follows: C = max(O.sin(1.c)): Step 6. Vis the resulting images image (C). aris isage I no sonicolon PROBLEM 3. Create and view k-10 approximation to the original picture (Use Steps 46 but with rank 10 instead of rank1. If you miss up-for example, you all-black picture the start over from Step 3.) It is convenient to create an M file with for loop to evaluate UV +... Vi Include the code and the figure. PROBLEM 4. Repent with monk-20, 30 and 40 proximations and any other uns that you'd like to experiment with). What is the smallest rank that, it your opinion, gives an acceptable proximation to the original picture? In your lab write-up, include only the code that gives an aceptable approximation and the corresponding picture. PROBLEM 5. What runk-r approacimation exactly reproduces the original picture? You only need to swer the question. Do not include the picture. Hind: Think about the original picture. Do not just swer this question by looking at the figures und guessing PROBLEM 6. (0) Suppe that a rank approximation, for me, give an acceptable approximation How much data is needed to represent the rank approximation? Your newer should be expression in terms of km nad n. Hint: you need a columns of Uk columns of V, and a singular values of S. (ii) The ratio of the amount of data ased for the approximation which you found in part ()) and the amount of data of the original format of the picture is the compression rute. Find the compression rate for the line of the rank you determined in Problem 4. What does the compression rate represent? Hint: After finding the comm on rite for the wale of the rank you determined in Problem you may want to present this ber a percentage. Think about how this percentage relates to the amount of data of the original appuimation. TANTSUDAD MATNE SAD. TIDADES DOUTRO S PROBLEM 7. If we use a high nunk approximation, then the mount of data needed for the approximation may exceed the amount of data wed in the original representation of the picture. Find the smallest value of k such that the rank approaciation of the matrix use these or more amount of data w the picture. Apiciatis with rank higher than this k inot be used for image compression since they defent the purpose of singles data than in the original representation Hint: Use the comp o rte formule you found in Problem wart), Whi you mastitute the number for mand, your valse will be a decimal beni. Since registrank, it must be an integer Think wont whether you should round down BE Image Compression Exercises Instructions. The following problems on be done interactively or by writing the e n ds in in M file (or by a combination of the two). In the case, record all MATLAB input commands and output in a text document and edit it needing to the station of LABI and LAB 2. For problem 2, include a picture of the rank approximation. For problems, include picture of the rank 10 p oimation und for problem include a picture of the lower imation that, in your opinion, gives septable approximation to the signal picture Crop and remine the pictures so that they do not take up too much spend paste them into your Inb report in the appropriate order. Step 1. Download the file gauss.jpg and save it to your working MATLAB directory Then load it into MATLAB with the command A = israad 'gaus.PE'); note the semicolon ! The semicolon is acessary so that MATLAB does not print out man serentals of data The reult is a matrix of grande valor corresponding to black and white picture of dog. The matrix ans 279198 tries). Now. A ctually 446 x 620 x 3 Torte image from the matrix A, MATLAB use the three values Ali,,1:3) in the RGB values to use to color the pixel in the i-th row and j-th colum. We have a black and white picture so AC:,:,1) = A(...2) = A(:,:,3) and we only need to work with A(:, :,1). Step 2. We need to do some initial processing. Type B = doublo (A:.:,1)); % don't forget the semicolon which couverts A into the double-precision format that is needed for the singular value decomposition. Now type B = B/255; % semicolon! [USV) syd (): % semicolon! This decomposition is just Eq. (1). The guy senle from 0 to 255 in a black-and-white JPEG image. We divide Bly 2:55 to obtain val between 0 and 1, which is required for MATLAB's image routine which we will use Inter PROBLEM 1. What are the dimensions of U, S, and V? Find out by typing size(U) - without the colon-A likewise for the others) Here Shu more o n the rows, infinet emne 447 to 62 are alwo When A has more than To, we pads on the right with con to tu Sito mx matrix). Otherwise, with this modification, the SVD is just like Eq. 1. PROBLEM 2. Compute the best run-1 paciention to Band store it in the matrix Tank 1 Use the commands given in the E mple parts and (b) omge2 but applied to the matrix Brother than A. Make sure you sure the output) Step 3. Let's visualiserank1. To do that first create C = zeros(size(A)): semicolon! This creates an array of eros, C, of the same dimension is the original image matrix A. Step 4. Copy the rank-l image into C as follows: CC:,:,1) CC: 2) CC,,3) ranki: = ranki: rank 1: Include the code and the figure in your report Step 5: We armot done, except for one bitch. MATLAB deel its swinging values from to land maps them to wes between O d 255 for the phishardware Lower rank approximation to the actualm e n have bees that are slightly less than and greater than 1. So we will trane te them to fit, as follows: C = max(O.sin(1.c)): Step 6. Vis the resulting images image (C). aris isage I no sonicolon PROBLEM 3. Create and view k-10 approximation to the original picture (Use Steps 46 but with rank 10 instead of rank1. If you miss up-for example, you all-black picture the start over from Step 3.) It is convenient to create an M file with for loop to evaluate UV +... Vi Include the code and the figure. PROBLEM 4. Repent with monk-20, 30 and 40 proximations and any other uns that you'd like to experiment with). What is the smallest rank that, it your opinion, gives an acceptable proximation to the original picture? In your lab write-up, include only the code that gives an aceptable approximation and the corresponding picture. PROBLEM 5. What runk-r approacimation exactly reproduces the original picture? You only need to swer the question. Do not include the picture. Hind: Think about the original picture. Do not just swer this question by looking at the figures und guessing PROBLEM 6. (0) Suppe that a rank approximation, for me, give an acceptable approximation How much data is needed to represent the rank approximation? Your newer should be expression in terms of km nad n. Hint: you need a columns of Uk columns of V, and a singular values of S. (ii) The ratio of the amount of data ased for the approximation which you found in part ()) and the amount of data of the original format of the picture is the compression rute. Find the compression rate for the line of the rank you determined in Problem 4. What does the compression rate represent? Hint: After finding the comm on rite for the wale of the rank you determined in Problem you may want to present this ber a percentage. Think about how this percentage relates to the amount of data of the original appuimation. TANTSUDAD MATNE SAD. TIDADES DOUTRO S PROBLEM 7. If we use a high nunk approximation, then the mount of data needed for the approximation may exceed the amount of data wed in the original representation of the picture. Find the smallest value of k such that the rank approaciation of the matrix use these or more amount of data w the picture. Apiciatis with rank higher than this k inot be used for image compression since they defent the purpose of singles data than in the original representation Hint: Use the comp o rte formule you found in Problem wart), Whi you mastitute the number for mand, your valse will be a decimal beni. Since registrank, it must be an integer Think wont whether you should round down BE

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intermediate Accounting Volume 2

Authors: Thomas Beechy, Joan Conrod, Elizabeth Farrell, Ingrid McLeod-Dick

7th Edition

1259108023, 9781259108020

More Books

Students also viewed these Accounting questions

Question

15.2 Explain the costs associated with employee turnover.

Answered: 1 week ago