0
0
Computer Visionml~10 mins

Why detection localizes objects in images 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 load an image using OpenCV.

Computer Vision
import cv2
image = cv2.[1]('image.jpg')
Drag options to blanks, or click blank then click option'
Aimwrite
Bimshow
Cimread
Dresize
Attempts:
3 left
💡 Hint
Common Mistakes
Using imshow instead of imread to load an image.
2fill in blank
medium

Complete the code to draw a rectangle around the detected object.

Computer Vision
cv2.rectangle(image, (x, y), (x + w, y + h), [1], 2)
Drag options to blanks, or click blank then click option'
A(255, 0, 0)
B(255, 255, 255)
C(0, 0, 255)
D(0, 255, 0)
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing red or blue which are other colors in BGR.
3fill in blank
hard

Fix the error in the code to correctly extract the bounding box coordinates.

Computer Vision
x, y, w, h = [1]
Drag options to blanks, or click blank then click option'
Adetected_object['bbox']
Bdetected_object['box']
Cdetected_object['coordinates']
Ddetected_object['location']
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect keys like 'box' or 'location' which do not exist.
4fill in blank
hard

Fill both blanks to create a dictionary of object labels and their confidence scores.

Computer Vision
results = {det['[1]']: det['[2]'] for det in detections}
Drag options to blanks, or click blank then click option'
Alabel
Bscore
Cbbox
Dclass
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'bbox' or 'class' which are not the correct keys for label or score.
5fill in blank
hard

Fill all three blanks to filter detections with confidence above 0.5 and create a list of bounding boxes.

Computer Vision
filtered_boxes = [det['[1]'] for det in detections if det['[2]'] [3] 0.5]
Drag options to blanks, or click blank then click option'
Abbox
Bscore
C>
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' or wrong keys for bounding boxes or scores.