0
0
Computer Visionml~20 mins

Color transforms (brightness, contrast, hue) in Computer Vision - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Color Transform Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of brightness adjustment code
What will be the pixel value of the center pixel after applying this brightness increase code on a grayscale image with pixel value 100?
Computer Vision
import numpy as np
image = np.full((3,3), 100, dtype=np.uint8)
brightness_increase = 50
result = np.clip(image.astype(np.int16) + brightness_increase, 0, 255).astype(np.uint8)
center_pixel = result[1,1]
print(center_pixel)
A150
B100
C50
D255
Attempts:
2 left
💡 Hint
Adding brightness increases pixel values but caps at 255.
🧠 Conceptual
intermediate
1:30remaining
Effect of contrast adjustment on pixel values
If you multiply all pixel values in an image by 1.5 and then clip to 255, what happens to pixels originally at 200?
AThey become 300
BThey become 255 due to clipping
CThey remain 200
DThey become 133
Attempts:
2 left
💡 Hint
Multiplying 200 by 1.5 gives 300, but pixel values cannot exceed 255.
Metrics
advanced
2:30remaining
Measuring hue shift effect
Which metric best measures the difference in hue between two images after a hue shift?
ACosine similarity on HSV hue channel
BMean Squared Error on RGB channels
CStructural Similarity Index (SSIM)
DPixel-wise absolute difference on grayscale
Attempts:
2 left
💡 Hint
Hue is a circular value best compared with angular similarity.
🔧 Debug
advanced
2:00remaining
Bug in contrast adjustment code
What error will this code raise? import numpy as np image = np.array([[50, 100], [150, 200]], dtype=np.uint8) contrast_factor = 1.2 result = image * contrast_factor print(result)
AOverflowError due to exceeding 255
BTypeError due to multiplying uint8 by float
CNo error, but result is float array
DValueError due to shape mismatch
Attempts:
2 left
💡 Hint
Multiplying a uint8 numpy array by a float returns a float array.
Model Choice
expert
3:00remaining
Choosing model for color transform robustness
Which model architecture is best suited to learn robustness to brightness, contrast, and hue changes in images?
ASimple fully connected network without normalization
BLinear regression on raw pixel values
CRecurrent Neural Network processing pixel sequences
DConvolutional Neural Network with batch normalization and data augmentation
Attempts:
2 left
💡 Hint
Robustness to color changes benefits from convolution and normalization.