0
0
SciPydata~30 mins

Image filtering (gaussian_filter) in SciPy - Mini Project: Build & Apply

Choose your learning style9 modes available
Image filtering with gaussian_filter
📖 Scenario: You have a small grayscale image represented as a 2D list of pixel brightness values. You want to smooth the image to reduce noise and make it look softer, like when you blur a photo slightly.
🎯 Goal: Apply a Gaussian filter to the image data using scipy.ndimage.gaussian_filter to create a smooth version of the image.
📋 What You'll Learn
Create a 2D list called image with exact pixel values
Create a variable called sigma to set the blur strength
Use scipy.ndimage.gaussian_filter with image and sigma
Print the filtered image array
💡 Why This Matters
🌍 Real World
Image smoothing is used in photography and computer vision to reduce noise and improve image quality.
💼 Career
Understanding image filtering is important for roles in data science, machine learning, and computer vision engineering.
Progress0 / 4 steps
1
Create the image data
Create a 2D list called image with these exact pixel values: [[10, 20, 30], [20, 30, 40], [30, 40, 50]]
SciPy
Need a hint?

Think of image as a small grid of brightness numbers.

2
Set the blur strength
Create a variable called sigma and set it to 1 to control the amount of blur.
SciPy
Need a hint?

The sigma value controls how much the image will be blurred.

3
Apply the Gaussian filter
Import gaussian_filter from scipy.ndimage and create a variable called filtered_image by applying gaussian_filter to image with sigma.
SciPy
Need a hint?

Use gaussian_filter(image, sigma) to smooth the image.

4
Print the filtered image
Print the variable filtered_image to see the smoothed image values.
SciPy
Need a hint?

The printed output shows the smoothed pixel values as a NumPy array.