Bird
0
0

Which of the following is the correct way to import the erosion function from scipy's ndimage module?

easy📝 Conceptual Q12 of 15
SciPy - Image Processing (scipy.ndimage)
Which of the following is the correct way to import the erosion function from scipy's ndimage module?
Afrom scipy.ndimage import erosion
Bfrom scipy.ndimage import binary_erosion
Cimport scipy.ndimage.erosion
Dfrom scipy import erosion
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct function name

    The function for erosion on binary images is named binary_erosion in scipy.ndimage.
  2. Step 2: Check import syntax

    Correct import is from scipy.ndimage import binary_erosion. Other options are invalid or incorrect names.
  3. Final Answer:

    from scipy.ndimage import binary_erosion -> Option B
  4. Quick Check:

    Correct import = binary_erosion [OK]
Quick Trick: Use binary_erosion for erosion in scipy.ndimage [OK]
Common Mistakes:
  • Using wrong function name 'erosion'
  • Incorrect import syntax
  • Trying to import from scipy root

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SciPy Quizzes