Bird
0
0

Which of the following is the correct syntax to zoom an image array img by a factor of 2 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 2 using scipy.ndimage.zoom?
Azoomed_img = zoom(img, scale=2)
Bzoomed_img = zoom(img, zoom=2)
Czoomed_img = zoom(img, factor=2)
Dzoomed_img = zoom(img, 2)
Step-by-Step Solution
Solution:
  1. Step 1: Check scipy.ndimage.zoom function signature

    The function takes the input array and a zoom factor as the second positional argument.
  2. Step 2: Identify correct parameter usage

    The zoom factor is passed as the second argument without a keyword; 'zoom=2' or 'factor=2' are invalid.
  3. Final Answer:

    zoomed_img = zoom(img, 2) -> Option D
  4. Quick Check:

    Zoom factor is second positional argument [OK]
Quick Trick: Use zoom(array, factor) without keywords [OK]
Common Mistakes:
  • Using keyword arguments incorrectly
  • Passing zoom factor as 'zoom=2'
  • Using 'scale' or 'factor' keywords

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SciPy Quizzes