Challenge - 5 Problems
Gaussian Blur Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediateOutput of Gaussian blur on a simple 3x3 image
Given the following 3x3 grayscale image and a Gaussian kernel, what is the output after applying Gaussian blur?
Signal Processing
import numpy as np from scipy.ndimage import gaussian_filter image = np.array([[10, 20, 30], [20, 30, 40], [30, 40, 50]], dtype=float) blurred = gaussian_filter(image, sigma=1) print(np.round(blurred, 1))
Attempts:
2 left
💡 Hint
Gaussian blur smooths the image by averaging nearby pixels weighted by a Gaussian function.
✗ Incorrect
The gaussian_filter with sigma=1 applies a weighted average that smooths the image values. The output is a blurred version with values between the original pixel intensities.
🧠 Conceptual
intermediateEffect of increasing sigma in Gaussian blur
What happens to an image when the sigma value in Gaussian blur is increased?
Attempts:
2 left
💡 Hint
Think about how the Gaussian kernel size and spread change with sigma.
✗ Incorrect
Increasing sigma increases the spread of the Gaussian kernel, causing more smoothing and blurring of details.
🔧 Debug
advancedIdentify the error in Gaussian blur application code
What error will this code produce when applying Gaussian blur?
import numpy as np
from scipy.ndimage import gaussian_filter
image = np.array([[100, 150], [200, 250]])
blurred = gaussian_filter(image, sigma=-1)
print(blurred)
Attempts:
2 left
💡 Hint
Sigma controls the spread of the Gaussian kernel and cannot be negative.
✗ Incorrect
The gaussian_filter function requires sigma to be zero or positive. Negative sigma values cause a ValueError.
❓ data_output
advancedResulting shape after Gaussian blur on a 5x5 image
If you apply Gaussian blur with sigma=1 to a 5x5 image using scipy.ndimage.gaussian_filter, what is the shape of the output?
Attempts:
2 left
💡 Hint
Gaussian blur does not change the image size by default.
✗ Incorrect
The gaussian_filter function returns an output of the same shape as the input image.
🚀 Application
expertChoosing sigma for edge-preserving smoothing
You want to smooth an image to reduce noise but keep edges sharp. Which sigma value strategy is best?
Attempts:
2 left
💡 Hint
Small sigma values apply gentle smoothing.
✗ Incorrect
Small sigma values smooth noise while preserving edges better than large sigma values.
