Starting from:

$34.99

EE5537 Homework 0 Solution

• In this assignment, you will be working with grayscale images. Download images from Universityof Southern California’s image database at http://sipi.usc.edu/database/database.php?volume= misc.
• Do not use built-in functions for the binary morphology questions. Use matplotlib to read and plot images - https://matplotlib.org/tutorials/introductory/images.html.
• Please turn in Python Notebooks with the following notation for the file name: your-roll-numberhw0.ipynb.
• Do not turn in images. Please use the same names for images in your code as in the database (and asmentioned in the problem statement below). The TAs will use these images to test your code.
1 The Human Eye (5)
1. In this problem you will implement the contrast sensitivity function (CSF) based living room design. Write a Python script that accepts the TV specifications (size, resolution), the available distance for the couch placement (from the TV), and outputs the “optimal” distance. Assume that the couch is placed directly in front of the TV. You are expected to handle corner cases gracefully. (5)
2 The Basics (10)
For this part, work with the images aerial, airplane, APC. Write a program to do the following:
1. Read the contents of an image into an array I (recall from class that digital images are represented as an array of numbers). (1)
2. Display the image I. (1)
3. Print the maximum and minimum pixel values of I. Based on these values, how many bits are needed (used) per pixel? (1)
4. What is the resolution of I? (1)
5. What is the size of the compressed image you downloaded? (1)
6. Based on the previous answers and assuming 256 gray levels, how efficienctly is the image compressed for storage? (1)
7. Display each bitplane of the image I as a binary image. (1)
8. Starting with the lowest bitplane, set each bitplane to 0 and display the resulting gray scale image(you will ultimately display a black image). Can you draw any conclusions on the importance of one bitplane over another? (1)
9. Starting with 256 gray levels (8 bits per pixel), decrease the quantization level by 1 bit per pixel untilyou reach 2 gray levels. Re-quantize at each rate and display the resulting image. (2)
1
3 Binary Morphology (20)
For this part, work with the images airplane, truck, airport, APC.
1. Write a function to compute the histogram of an image and plot the same. What is the modality of thehistogram for the images mentioned above? (2)
2. Binarize I using the above histogram following the modal thresholding approach discussed in class. Compare this image with the binary image in the last step of the previous problem. (2)
3. Implement the connected components algorithm and use it to label the binarized version of I. (5)
4. Implement minor blob removal to get rid of minor blobs. (2)
5. Now implement the following filters that take a binary image I and window B as inputs: DILATE, ERODE, MEDIAN. Filter the above binary image using the following windows B = CROSS(5), B = SQUARE(3). (3)
6. Implement the compound operators OPEN and CLOSE using the basic filters implemented above.Filter the binary image from the problem before last using the same windows as above. (2)
7. Finally, implement OPEN-CLOS and CLOS-OPEN. Filter the binary image using the same windowsas above. (2)
8. For the APC image, count the number of pixels in the object of interest - i.e., the military vehicle. (2)
2

More products