0
0
Computer Visionml~20 mins

First image processing program in Computer Vision - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Image Processing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this image processing code?
Consider this Python code that loads an image, converts it to grayscale, and prints the shape of the resulting image array. What will be printed?
Computer Vision
import cv2
image = cv2.imread('sample.jpg')
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
print(gray_image.shape)
A(width, height)
B(height, width, 3)
CError: cv2.cvtColor requires 3-channel input
D(height, width)
Attempts:
2 left
💡 Hint
Grayscale images have only one channel, so the shape has two dimensions.
Model Choice
intermediate
2:00remaining
Which model is best for simple image classification?
You want to classify images of cats and dogs with a small dataset. Which model is the best choice?
AA decision tree using image file names as features
BA simple logistic regression model using raw pixel values
CA pretrained convolutional neural network with transfer learning
DA deep convolutional neural network with many layers trained from scratch
Attempts:
2 left
💡 Hint
Using pretrained models helps when data is limited.
Hyperparameter
advanced
2:00remaining
Which hyperparameter change will most reduce overfitting in image classification?
You trained a CNN that performs well on training images but poorly on new images. Which hyperparameter adjustment will most likely reduce overfitting?
AAdd dropout layers with a dropout rate of 0.5
BIncrease the number of convolutional layers
CDecrease the batch size to 1
DRemove data augmentation
Attempts:
2 left
💡 Hint
Dropout randomly disables neurons during training to prevent memorization.
Metrics
advanced
2:00remaining
Which metric is best to evaluate image segmentation quality?
You built a model to segment objects in images. Which metric best measures how well the predicted segments match the true segments?
AAccuracy
BIntersection over Union (IoU)
CMean Squared Error
DPrecision
Attempts:
2 left
💡 Hint
This metric compares the overlap between predicted and true segments.
🔧 Debug
expert
2:00remaining
What error does this image processing code raise?
This code tries to resize an image but raises an error. What is the error?
Computer Vision
import cv2
image = cv2.imread('nonexistent.jpg')
resized = cv2.resize(image, (100, 100))
Acv2.error: OpenCV(…) error: (-215:Assertion failed) !ssize.empty() in function 'resize'
BFileNotFoundError: No such file or directory: 'nonexistent.jpg'
CTypeError: 'NoneType' object is not subscriptable
DValueError: invalid literal for int() with base 10
Attempts:
2 left
💡 Hint
cv2.imread returns None if the file is missing, causing resize to fail.