0
0
SciPydata~20 mins

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

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Image Processing Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Effect of Gaussian Blur on an Image Array
What is the output shape and type after applying Gaussian blur to a 5x5 image array using scipy?
SciPy
import numpy as np
from scipy.ndimage import gaussian_filter

image = np.arange(25).reshape(5,5)
blurred = gaussian_filter(image, sigma=1)
print(type(blurred), blurred.shape)
A<class 'list'> (5, 5)
B<class 'list'> (25,)
C<class 'numpy.ndarray'> (25,)
D<class 'numpy.ndarray'> (5, 5)
Attempts:
2 left
💡 Hint
Gaussian blur keeps the image shape but smooths pixel values.
data_output
intermediate
2:00remaining
Histogram Equalization Effect on Pixel Intensity Distribution
After applying histogram equalization to a grayscale image array, what is the sum of all pixel intensities?
SciPy
import numpy as np
from skimage import exposure

image = np.array([[50, 80, 90], [30, 60, 70], [20, 40, 100]], dtype=np.uint8)
equalized = exposure.equalize_hist(image)
sum_pixels = equalized.sum()
print(round(sum_pixels, 2))
A1.5
B4.5
C3.0
D6.0
Attempts:
2 left
💡 Hint
Histogram equalization redistributes intensities but total sum depends on normalization.
visualization
advanced
2:00remaining
Visualizing Edge Detection on a Sample Image
Which option shows the correct edge detection output using Sobel filter on a 3x3 image array?
SciPy
import numpy as np
from scipy import ndimage

image = np.array([[10, 10, 10], [10, 50, 10], [10, 10, 10]])
edge_sobel = ndimage.sobel(image)
print(edge_sobel)
A
[[ 0 40  0]
 [40  0 40]
 [ 0 40  0]]
B
[[ 0  0  0]
 [ 0  0  0]
 [ 0  0  0]]
C
[[40 40 40]
 [40  0 40]
 [40 40 40]]
D
[[10 10 10]
 [10 50 10]
 [10 10 10]]
Attempts:
2 left
💡 Hint
Sobel filter highlights edges by calculating gradient magnitude.
🧠 Conceptual
advanced
1:30remaining
Why Transform Visual Data in Image Processing?
Which reason best explains why image processing transforms visual data?
ATo convert images into text documents automatically
BTo enhance features and remove noise for better analysis
CTo increase the file size of images for storage
DTo make images invisible to the human eye
Attempts:
2 left
💡 Hint
Think about the purpose of improving image quality.
🔧 Debug
expert
2:30remaining
Identify the Error in Image Thresholding Code
What error does the following code raise when thresholding an image array? import numpy as np image = np.array([[100, 150], [200, 250]]) threshold = 180 binary = image > threshold result = binary.astype(np.int) print(result)
SciPy
import numpy as np
image = np.array([[100, 150], [200, 250]])
threshold = 180
binary = image > threshold
result = binary.astype(int)
print(result)
AAttributeError: module 'numpy' has no attribute 'int'
BTypeError: unsupported operand type(s) for >: 'list' and 'int'
CSyntaxError: invalid syntax in line with astype
DNo error, prints binary array correctly
Attempts:
2 left
💡 Hint
Check if np.int is deprecated or removed in recent numpy versions.