0
0
Computer Visionml~10 mins

Why OpenCV is the standard CV library in Computer Vision - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to import the OpenCV library in Python.

Computer Vision
import [1] as cv
Drag options to blanks, or click blank then click option'
Acv2
Bcv
Copencv
Dopencv-python
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'opencv' instead of 'cv2' causes import errors.
Trying to import 'opencv-python' directly is incorrect.
2fill in blank
medium

Complete the code to read an image file using OpenCV.

Computer Vision
image = cv.[1]('image.jpg')
Drag options to blanks, or click blank then click option'
Aload
Bimread
Copen
Dread_image
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'load' or 'open' causes attribute errors.
Trying 'read_image' is not a valid OpenCV function.
3fill in blank
hard

Fix the error in the code to convert an image to grayscale.

Computer Vision
gray = cv.cvtColor(image, [1])
Drag options to blanks, or click blank then click option'
Acv.COLOR_BGR2GRAY
Bcv.COLOR_RGB2GRAY
Ccv.COLOR_BGR2RGB
Dcv.COLOR_GRAY2BGR
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'COLOR_RGB2GRAY' causes wrong color conversion.
Using 'COLOR_BGR2RGB' changes color space but not to grayscale.
4fill in blank
hard

Fill both blanks to resize an image to 100x100 pixels.

Computer Vision
resized = cv.resize(image, ([1], [2]))
Drag options to blanks, or click blank then click option'
A100
B200
C50
D150
Attempts:
3 left
💡 Hint
Common Mistakes
Using different numbers for width and height changes aspect ratio.
Using values other than 100 does not meet the requirement.
5fill in blank
hard

Fill all three blanks to display an image window and wait for a key press.

Computer Vision
cv.imshow('[1]', [2])
cv.[3](0)
cv.destroyAllWindows()
Drag options to blanks, or click blank then click option'
Awindow
Bimage
CwaitKey
Dshow
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'show' instead of 'waitKey' causes errors.
Passing wrong variable names causes runtime errors.