0
0
Computer Visionml~20 mins

Blurring and smoothing (Gaussian, median, bilateral) in Computer Vision - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Blur Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of Gaussian Blur on a simple image array
Given the following 3x3 grayscale image array and applying a Gaussian blur with kernel size 3 and sigma 1, what is the center pixel value after blurring?
Computer Vision
import cv2
import numpy as np

image = np.array([[10, 20, 30],
                  [20, 30, 40],
                  [30, 40, 50]], dtype=np.uint8)

blurred = cv2.GaussianBlur(image, (3, 3), 1)
center_pixel = blurred[1, 1]
print(center_pixel)
A30
B28
C29
D31
Attempts:
2 left
💡 Hint
Gaussian blur smooths pixels weighted by a Gaussian kernel; center pixel is a weighted average.
🧠 Conceptual
intermediate
1:30remaining
Effect of median blur on salt-and-pepper noise
Which statement best describes the effect of applying a median blur filter on an image corrupted with salt-and-pepper noise?
AMedian blur replaces each pixel with the average of its neighbors, smoothing the noise.
BMedian blur replaces each pixel with the median of its neighbors, effectively removing salt-and-pepper noise.
CMedian blur sharpens edges while reducing noise.
DMedian blur applies a Gaussian weighted average, which is ineffective against salt-and-pepper noise.
Attempts:
2 left
💡 Hint
Think about how median values handle extreme pixel values.
Model Choice
advanced
1:30remaining
Choosing the best smoothing filter for edge preservation
You want to smooth an image to reduce noise but keep edges sharp and clear. Which filter is the best choice?
ABilateral filter
BMedian blur
CGaussian blur
DAverage blur
Attempts:
2 left
💡 Hint
Consider which filter uses both spatial and intensity information.
Hyperparameter
advanced
1:30remaining
Effect of increasing sigma in Gaussian blur
What happens to the image when you increase the sigma value in a Gaussian blur filter while keeping the kernel size constant?
AThe filter ignores pixels farther from the center.
BThe image noise increases due to less smoothing.
CThe image becomes sharper with more details preserved.
DThe image becomes more blurred with stronger smoothing effect.
Attempts:
2 left
💡 Hint
Sigma controls the spread of the Gaussian kernel.
🔧 Debug
expert
2:00remaining
Identifying error in bilateral filter usage
What error will this code produce when applying bilateral filter with the given parameters? import cv2 import numpy as np image = np.ones((5,5), dtype=np.uint8)*100 blurred = cv2.bilateralFilter(image, d=0, sigmaColor=75, sigmaSpace=75) print(blurred)
Computer Vision
import cv2
import numpy as np

image = np.ones((5,5), dtype=np.uint8)*100
blurred = cv2.bilateralFilter(image, d=0, sigmaColor=75, sigmaSpace=75)
print(blurred)
ANo error, prints the blurred image array
Bcv2.error: d must be positive or -1
CTypeError: unsupported operand type(s) for *: 'int' and 'str'
DValueError: sigmaColor must be less than 50
Attempts:
2 left
💡 Hint
Check the meaning of parameter d in bilateralFilter.