Bird
0
0

Which of the following is the correct syntax to zoom an image array img by a factor of 1.5 using scipy.ndimage.zoom?

easy📝 Syntax Q3 of 15
SciPy - Image Processing (scipy.ndimage)
Which of the following is the correct syntax to zoom an image array img by a factor of 1.5 using scipy.ndimage.zoom?
Ascipy.ndimage.zoom(img, 1.5)
Bscipy.ndimage.zoom(img, zoom=1.5)
Cscipy.ndimage.zoom(img, factor=1.5)
Dscipy.ndimage.zoom(img, scale=1.5)
Step-by-Step Solution
Solution:
  1. Step 1: Recall zoom function signature

    The scipy.ndimage.zoom function accepts the zoom factor as the second positional argument without needing the parameter name.
  2. Step 2: Check each option

    scipy.ndimage.zoom(img, 1.5) correctly uses the zoom factor as a positional argument. scipy.ndimage.zoom(img, zoom=1.5) is invalid because the function does not have a named parameter 'zoom'. Options C and D use incorrect parameter names.
  3. Final Answer:

    scipy.ndimage.zoom(img, 1.5) -> Option A
  4. Quick Check:

    Zoom factor passed as positional argument [OK]
Quick Trick: Pass zoom factor as second positional argument [OK]
Common Mistakes:
  • Using wrong parameter names
  • Omitting parameter name causing confusion
  • Using scale or factor instead of zoom

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SciPy Quizzes