0
0
SciPydata~10 mins

Why image processing transforms visual data in SciPy - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to load an image using scipy.

SciPy
from scipy import [1]
image = [1].face()
Drag options to blanks, or click blank then click option'
Andimage
Bfftpack
Csignal
Dmisc
Attempts:
3 left
💡 Hint
Common Mistakes
Using scipy.ndimage instead of scipy.misc
Trying to load image without importing misc
2fill in blank
medium

Complete the code to convert the image to grayscale using skimage.

SciPy
from skimage import [1]
gray_image = [1].rgb2gray(image)
Drag options to blanks, or click blank then click option'
Andimage
Bcolor
Cmisc
Dsignal
Attempts:
3 left
💡 Hint
Common Mistakes
Using scipy.misc for rgb2gray (it does not have it)
Trying to use ndimage for color conversion
3fill in blank
hard

Fix the error in the code to apply a Gaussian filter to the image.

SciPy
from scipy import ndimage
filtered_image = ndimage.[1](image, sigma=3)
Drag options to blanks, or click blank then click option'
Agaussian
Bgauss_filter
Cgaussian_filter
Dfilter_gaussian
Attempts:
3 left
💡 Hint
Common Mistakes
Misspelling the function name
Using a non-existent function like gauss_filter
4fill in blank
hard

Fill both blanks to create a dictionary of pixel intensities for pixels greater than 100.

SciPy
pixel_dict = {pixel: pixel[1]2 for pixel in image.flatten() if pixel [2] 100}
Drag options to blanks, or click blank then click option'
A**
B>
C<
D*
Attempts:
3 left
💡 Hint
Common Mistakes
Using *2 instead of **2 for squaring
Using < instead of > in the condition
5fill in blank
hard

Fill all three blanks to create a filtered dictionary with uppercase keys and values greater than 50.

SciPy
filtered_pixels = { [1]: [2] for [1], [2] in pixel_dict.items() if [2] [3] 50}
Drag options to blanks, or click blank then click option'
Apixel.upper()
Bvalue
C>
Dpixel
Attempts:
3 left
💡 Hint
Common Mistakes
Using pixel.upper() as key without defining pixel variable
Using < instead of > in condition