Bird
0
0

What is wrong with this code to apply a median filter? median_filter(image, size=3)

medium📝 Debug Q7 of 15
SciPy - Image Processing (scipy.ndimage)
What is wrong with this code to apply a median filter? median_filter(image, size=3)
AMedian filter does not accept size parameter
BSize parameter should be called sigma
CImage must be converted to grayscale first
DThe function median_filter is not imported or prefixed
Step-by-Step Solution
Solution:
  1. Step 1: Check function usage

    median_filter must be called with correct import or prefix like scipy.ndimage.median_filter.
  2. Step 2: Validate parameters and image type

    Size is correct parameter, grayscale not mandatory, and median_filter accepts size.
  3. Final Answer:

    The function median_filter is not imported or prefixed -> Option D
  4. Quick Check:

    Function call error = Missing import or prefix [OK]
Quick Trick: Always import or prefix median_filter before use [OK]
Common Mistakes:
  • Calling function without import
  • Confusing size with sigma
  • Assuming grayscale needed

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SciPy Quizzes