Bird
0
0

What is wrong with this code snippet?

medium📝 Debug Q6 of 15
SciPy - Image Processing (scipy.ndimage)
What is wrong with this code snippet?
rotated = scipy.ndimage.rotate(img, 45, zoom=2)
AThe rotate function does not have a zoom parameter
BThe angle should be in radians, not degrees
CThe image array must be converted to float first
DThe zoom factor must be an integer
Step-by-Step Solution
Solution:
  1. Step 1: Check rotate function parameters

    scipy.ndimage.rotate does not accept a zoom parameter.
  2. Step 2: Identify correct usage

    Zooming must be done separately using scipy.ndimage.zoom.
  3. Final Answer:

    The rotate function does not have a zoom parameter -> Option A
  4. Quick Check:

    rotate() has no zoom parameter [OK]
Quick Trick: Use separate functions for rotate and zoom [OK]
Common Mistakes:
  • Passing zoom to rotate
  • Confusing degrees with radians
  • Assuming zoom must be integer

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SciPy Quizzes