Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / Questions Answered Lab 6 Q1 Applying The DCT Matrix to Images 25 Points Q1

Questions Answered Lab 6 Q1 Applying The DCT Matrix to Images 25 Points Q1

Computer Science

Questions Answered Lab 6 Q1 Applying The DCT Matrix to Images 25 Points Q1.1 5 Points Extract any sub-block of size 32 x 32 different from the one given and name it Xblock . Then, vectorize the block using xblock = Xblock(:) Code Snippet: Enter your answer here Save Answer Q1.2 10 Points Construct DCT matrix T of size ( ) by calling function DCT_for_vectorized_images(npixels) . The argument for the function should be: npixels = 32 . Verify that T is invertible, i.e. check that . Hint: use function inv() to compute inverse, and function matrix_error() to determine the error between two matrices.) Code Snippet: 32 2 × 32 2 1024 × 1024 TT −1 = T −1T = I Choose Files No fifififififififile chosen 11/2/22, 11:49 PM Submit Lab 6 | Gradescope https://www.gradescope.com/courses/417083/assignments/2308589/submissions/new 2/7 Enter your answer here Save Answer Q1.3 10 Points Apply DCT transform to xblock , denote new vector this as yblock and plot the resulting vector (with function stem() ). Now only plot the first 100 elements of the vector on the same plot. Add a title and include the stem plot in the submission. Add a title and include the stem plot in the submission. What do you notice about the first entry of the vector yblock ? Why might this be the case? Recall what we said about the DCT matrix from Lab 4. Explanation: Enter your answer here Code Snippet: Enter your answer here Image Upload (JPG Only): Please select file(s) Select file(s) Save Answer Choose Files No file chosen ö Choose Files No fififififififile chosen 11/2/22, 11:49 PM Submit Lab 6 | Gradescope https://www.gradescope.com/courses/417083/assignments/2308589/submissions/new 3/7 Q2 Vector Thresholding 10 Points You will implement an algorithm that takes a vector, and only keeps the K entries with the largest absolute value. Modify the provided Matlab code vector_thresholding , so that given a N dimensional vector, it returns a vector that keeps its K largest entries (in absolute value), and sets the remaining N - K to zero the remaining ones. You only need to complete lines 8, 14, 16 . Code Snippet: Copy all of vector_thresholding.m here Enter your answer here Save Answer Q3 Compressing Image Blocks 35 Points You will use results from Problems 6.1 and 6.2. Q3.1 5 Points Apply the code from Problem 6.2 to the vector yblock , and keep only 20% largest entries. Denote this thresholded vector as zblock . Code Snippet: Enter your answer here Save Answer Choose Files No fifififififififile chosen 11/2/22, 11:49 PM Submit Lab 6 | Gradescope https://www.gradescope.com/courses/417083/assignments/2308589/submissions/new 4/7 Q3.2 5 Points Report the value of K used, and plot the resulting thresholded vector zblock (again, using stem()). K value used: Enter your answer here Image Upload (JPG Only): Please select file(s) Select file(s) Save Answer Q3.3 10 Points Apply to zblock , then use the reshape() function to turn the vector back into a square matrix and denote this as Zblock . Use figure; and imshow() to show the image Zblock and Xblock in two separate figures. Is there any difference between the images? Save both images and title appropriately. Explanation: Enter your answer here Image Upload (JPG Only): Please select file(s) Select file(s) Save Answer Choose Files No fifile chosen ö T −1 Choose Files No file chosen ö Choose Files No fififififile chosen 11/2/22, 11:49 PM Submit Lab 6 | Gradescope https://www.gradescope.com/courses/417083/assignments/2308589/submissions/new 5/7 Q3.4 15 Points Repeat the previous parts for 5%, 10%, 30%, 50%. Submit images and report the matrix errors (using matrix_error() ) between original and reconstructed images. Submit the images for these new Zblock s, but don't upload the original Xblock image again. Use meaningful titles. Matrix Errors and K-values: Specify which K and which percentage correspond to each percentage. Enter your answer here Image Upload (JPG Only): Please select file(s) Select file(s) Save Answer Q4 Whole Image Compression 25 Points Q4.1 5 Points Apply DCT to whole image using Y = dct2(X) . The input and output X,Y are matrices of the same size. Vectorize y = Y(:) and keep its 20% largest entries using function in Problem 6.2. Code Snippet: Please select file(s) Select file(s) Save Answer Choose Files No fifififile chosen ö Choose Files No file chosen ö Choose Files No fififile chosen 11/2/22, 11:49 PM Submit Lab 6 | Gradescope https://www.gradescope.com/courses/417083/assignments/2308589/submissions/new 6/7 Q4.2 10 Points Reshape the resulting vector to be of size 512 × 512 and apply inverse transform using function idct2() . Denote this new matrix as Z . Display this as an image and save the figure and report the matrix error between Y and Z . Matrix Error: Enter your answer here Code Snippet: Enter your answer here Image Upload (JPG Only): Please select file(s) Select file(s) Save Answer Q4.3 10 Points Repeat this experiment for 0.1%, 1%, 5%, 10%, report images and the matrix error. Matrix Errors: Enter your answer here Code Snippet: ö 11/2/22, 11:49 PM Submit Lab 6 | Gradescope https://www.gradescope.com/courses/417083/assignments/2308589/submissions/new 7/7 Enter your answer here Image Upload (JPG Only): Please select file(s) Select file(s) Save Answer Q5 Code Submission 5 Points Submit start_script.m and vector_thresholding.m here. Matlab Files Only: Please select file(s) Select file(s) Save Answer Save All Answers Submit & View Submission T ö ö

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE