use MATLAB to upload the following:
an image that you want to process (can be taken yourself or
downloaded from the internet)
a script that processes the image in TWO ways.
manipulates the colors
averages pixels together
Please make sure the script displays the images (like how I did
with the 40 and 80 pixel averaging) so I can easily compare them to
the original. Make sure to COMMENT your code as well.
Homework 13 Please upload the following: an image that you want to process (can be taken yourself or downloaded from the int a script that processes the image in TWO ways. • manipulates the colors • averages pixels together Please make sure the script displays the images (like how I did with the 40 and 80 pixel averaging sol can easily compare them to the original. Make sure to COMMENT your code as well 88 Background information for Image Processing 8% 3-D matrices $ 3-D matrices are no different than the matrices we have used thus far & the only difference is now we have three indices % Before we had (rows, columns) % Now we have (rows, columns, page/sheet) % Think of this third index like the pages of a book. % Rows and columns tell us the location on the page % the third index tells us WHICH page we are on For example, if we had (8, 5, 2) that would be % row 8 % column 5 # on the second page % Let’s use our friend randi, but now with 3-D matrices data=randi (10, 5, 5, 3); % what does our data look like? Describe the size of the matrix and the values * **PRACTICE** – Pull out single values (EG row 3 column 4 of sheet 2) Pull out subsets of the matrix (EG rows 3-4, columns 1-3, of sheets 2-3) % Pull out subsets of the matrix (EG rows 3-4, columns 1-3, of sheets 2-3) % For this class, we won’t need more than 3 pages. However, the skills % learned here are applicable to any number of pages 8% Unsigned 8-bit Integers We are going to be doing some image/color processing. Matlab (and many % other applications) store colors using unsigned 8-bit integers. Let’s break down what this means % Unsigned – no positive/negative sign % 8-bit – range from 0-255 (2^8 = 256 possible values) % Integers – Whole numbers new data-350*rand (5,5,3)-50; make new data with values between -50 and 300 % take a moment to look at this data انه vo in int_data-uint8 (new_data); $compare int_data to new_data. What did the “uint8” function do? $ We had data between -50 and 300 before. What are the bounds now? % Try to find a value that was not simply rounded. This might be impossible depending on the values of your randomized data imshow(int_data) o imshow(int_data) % Zoom in on the image. What happened? Why did this happen? % For the answers to those questions, we need to learn a bit about how % computers deal with images. 84 RGB – Red, Green, Blue % For a computer to display a pixel it needs three values: % 0-255 Red % 0-255 Green % 0-255 Blue * A value of 0 corresponds to no strength of the given color % A value of 255 corresponds to full strength of the given color % If all three values are O the pixel is black % If all three values are 255 the pixel is white % Take a look at the values in int_data and see if what I said corresponds % with the colors displayed on your image. 88 Making an image of your own design % We know how to make matrices of specified values (EG A=(1,5,2]) NOW I want you to use those tools, along with our new knowledge about 3-D matrices to make the following images, all 5 pixels by 5 pixels. Remember