ECE 5554 / ECE 4554: Computer Vision Fall 2018Instructions
Short programming example (100 points)Each of the following short programming worths 10 points. Please use the provided “hokiebird.jpg” as your input. 1) Plot the R, G, B values along the scanline on the 250th row of the image.
2) Stack the R, G, B channels of the hokiebird image vertically. This will be an image with width of 600 pixels and height of 1116 pixels.
3) Load the input color image and swap its red and green color channels.
4) Convert the input color image to a grayscale image.
5) Take the R, G, B channels of the image. Compute an average over the three channels. Note that you may need to do the necessary typecasting (uint8 and double) to avoid overflow.
6) Take the grayscale image in (4), obtain the negative image (i.e., mapping 255 to 0 and 0 to 255).
7) First, crop the original hokie bird image into a squared image of size 372 x 372. Then, rotate the image by 90, 180, and 270 degrees and stack the four images (0, 90, 180, 270 degreess) horizontally.
8) Create another image with the same size as the hokie bird image. First, initialize this image as zero everywhere. Then, for each channel, set the pixel values as 255 when the corresponding pixel values in the hokie bird image are greater than 127.
9) Report the mean R, G, B values for those pixels marked by the mask in (8). 10) Take the grayscale image in (3). Create and initialize another image as all zeros. For each 5 x 5 window in the grayscale image, find out the maximum value and set the pixels with the maximum value in the 5x5 window as 255 in the new image.
Some useful functions: title, subplot, imshow, mean, imread, imwrite, rgb2gray, find . Use help in MATLAB to learn more about these functions. AcknowledgementsThis homework is adapted from the projects developed by Devi Parikh (GaTech) |