Challenge - 5 Problems
Geometric Transform Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of rotating an image by 90 degrees clockwise
Given a 3x3 grayscale image represented as a 2D list, what is the output after rotating it 90 degrees clockwise?
Computer Vision
import numpy as np image = np.array([[1,2,3],[4,5,6],[7,8,9]]) rotated = np.rot90(image, k=-1) print(rotated.tolist())
Attempts:
2 left
💡 Hint
Rotating 90 degrees clockwise means columns become rows from bottom to top.
✗ Incorrect
The numpy rot90 function with k=-1 rotates the array 90 degrees clockwise. The first column becomes the first row reversed.
❓ Model Choice
intermediate1:30remaining
Choosing the correct transform for horizontal flip
Which numpy operation correctly flips a 2D image array horizontally?
Attempts:
2 left
💡 Hint
Horizontal flip means flipping left to right.
✗ Incorrect
np.fliplr flips the array left to right (horizontally). np.flipud flips up and down (vertical flip).
🔧 Debug
advanced2:00remaining
Identify the error in cropping code
What error will this code raise when cropping a 2D image array?
Computer Vision
import numpy as np image = np.arange(16).reshape(4,4) cropped = image[1:3, 3:1] print(cropped)
Attempts:
2 left
💡 Hint
Check how slicing with start index greater than stop index behaves in numpy.
✗ Incorrect
Slicing with start > stop returns an empty slice, so cropped has shape (2,0) and prints []
❓ Hyperparameter
advanced1:30remaining
Effect of interpolation parameter in rotation
When rotating an image using OpenCV's cv2.warpAffine, which interpolation method preserves the most image quality for small rotations?
Attempts:
2 left
💡 Hint
Higher order interpolation methods produce smoother results.
✗ Incorrect
cv2.INTER_CUBIC uses bicubic interpolation which preserves quality better than linear or nearest neighbor for rotations.
❓ Metrics
expert2:30remaining
Evaluating effect of geometric transforms on classification accuracy
You apply random rotations and flips as data augmentation during training a CNN classifier. After training, which metric change best indicates the augmentation improved model generalization?
Attempts:
2 left
💡 Hint
Good augmentation reduces overfitting, so training accuracy may drop but validation improves.
✗ Incorrect
Data augmentation makes training harder, lowering training accuracy, but helps generalization, raising validation accuracy.