program讲解、Python程序语言调试、辅导Python设计

- 首页 >> Database作业
Homework 2
The College of Engineering Deans office has decided to make a new Associate Dean of Branding. Their first mission is to create a new mascot the Golden Zebra. While activly trying to procure a Golden Zebra they have tasked you with fabricating an image of our new mascot for immediate publication in the Resolve Magazine. Follow the instructions to create our new mascot.
Please use the offical Lehigh colors.
Useful functions:
logical_or logical_and
Step 1: Download the original image file
Step 2: Load and plot the original image
Step 3 Initial color-based segmentation of image.
Recolor the numpy array of the zebra image using color thresholding to create a golden zebra.
Hint: Make a copy of the data using np.copy so you do not overwrite your data
Hint: It might be helpful to convert the image to grayscale for segmenting
Make sure to plot your result. It is unlikely that you will accuratly segment the Zebra using color thresholding.

Step 4: Improve the segmentation.
It is likely that you were unable to segment the image using just color thresholding. Likely you picked up some of the grass. To fix this, in part, use scikit-learn and the following proceedure.
1.Start with the previous segmentation of the zebra. Hint: it is helpful if this is in binary form.
2.Use a function to remove small objects in the image.
3.Use a dialation (pixel wise addition of a binary image) followed by an errosion (pixel wise subtraction of a binary image). This helps close objects with small gaps.
4.Fill the holes. Hint: You should use a function binary_fill_holes in scipy.ndimage
5.plot the binary mask of the zebra.
Step 5: Plot a histogram of the gray scale values of just the Zebra.
Hint: You can index with the binary mask.
Step 6: Use the histogram to recolor the zebra stripes to make a golden zebra. Use the official Lehigh Brown and Gold.

站长地图