Image Processing
Image Files
Searching Images
Checkpoint
Thresholding
Edge Detection
Template Matching
Summary
Checkpoint
Click on the Edit in Repl.it button in the upper right corner of the terminal below. This will take you to the repl.it website, where you can create a free account (recommended, if you haven't already). Then, you can write, run, and save your own code to answer the questions below (also provided as comments on the repl.it site):
You will be applying what you've learned to this image of holiday cookies.
-
Right-click and save the image as "cookies.jpg" and upload it to Repl.it.
-
Find the dimensions (shape) of the image using NumPy
-
Use array slicing to select just the part of the image that shows the snowman cookie
-
Use NumPy to identify where the maximum and minimum values of the image occur. What kind of features do they correspond to?

1 # Now it's your turn! Write in your solutions below the appropriate comment
2 # Click the run button at the top to check your answers
3 # Solutions will be provided when you complete the entire lesson
4 # Reminder: In order to see any output, commands must be wrapped in print() statements (e.g. "print(1 + 2)" will print 3 to the dark console while "1 + 2" will not have any output)
5 #import necessary packages
6 import numpy as np
7 import matplotlib.pyplot as plt
8 from skimage import io
9 #read in image
10 imagefile = io.imread('cookies.jpg', as_gray = True)
11
12 #Show the image using matplotlib
13
14 #Find the shape of the image using NumPy
15
16 #Use array slicing to select the part of the image that shows the snowman cookie, and check that your answer is correct by plotting with Matplotlib
17
18 #use NumPy to identify where the maximum and minimum values of the image occur. 19 What kind of features do they correspond to?