Challenge - 5 Problems
Image Processing Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2: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)
Attempts:
2 left
💡 Hint
Gaussian blur keeps the image shape but smooths pixel values.
✗ Incorrect
The gaussian_filter returns a numpy array of the same shape as input, smoothing the image but not changing its dimensions or type.
❓ data_output
intermediate2: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))
Attempts:
2 left
💡 Hint
Histogram equalization redistributes intensities but total sum depends on normalization.
✗ Incorrect
equalize_hist normalizes pixel values between 0 and 1, so sum is roughly number of pixels times average intensity (~3.0).
❓ visualization
advanced2: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)
Attempts:
2 left
💡 Hint
Sobel filter highlights edges by calculating gradient magnitude.
✗ Incorrect
The Sobel filter detects edges by computing gradients; the center pixel with higher intensity creates edges around it with value 40.
🧠 Conceptual
advanced1:30remaining
Why Transform Visual Data in Image Processing?
Which reason best explains why image processing transforms visual data?
Attempts:
2 left
💡 Hint
Think about the purpose of improving image quality.
✗ Incorrect
Image processing transforms images to highlight important features and reduce noise, making analysis easier and more accurate.
🔧 Debug
expert2: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)
Attempts:
2 left
💡 Hint
Check if np.int is deprecated or removed in recent numpy versions.
✗ Incorrect
np.int is deprecated and removed in recent numpy versions; use int or np.int32 instead.