0
0
Computer Visionml~10 mins

SIFT features in Computer Vision - Interactive Code Practice

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

Complete the code to create a SIFT detector using OpenCV.

Computer Vision
import cv2
sift = cv2.[1]()
Drag options to blanks, or click blank then click option'
ASiftDetector
BSIFT_create
CcreateSIFT
Dcreate_sift
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'createSIFT' which is not a valid OpenCV function.
Trying 'SiftDetector' which does not exist.
2fill in blank
medium

Complete the code to detect keypoints and descriptors from an image using SIFT.

Computer Vision
keypoints, descriptors = sift.[1](image, None)
Drag options to blanks, or click blank then click option'
AfindKeypoints
Bdetect
Ccompute
DdetectAndCompute
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'detect' only detects keypoints but does not compute descriptors.
Using 'compute' requires keypoints as input and does not detect them.
3fill in blank
hard

Fix the error in the code to draw keypoints on the image using OpenCV.

Computer Vision
output_image = cv2.drawKeypoints(image, keypoints, [1], flags=cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS)
Drag options to blanks, or click blank then click option'
ANone
Bimage
Ckeypoints
Doutput_image
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the input image as the third argument, which causes errors.
Passing keypoints or output_image which are invalid here.
4fill in blank
hard

Fill both blanks to create a dictionary of keypoint coordinates and their sizes.

Computer Vision
kp_dict = {kp.pt: kp.{{BLANK_2}} for kp in keypoints}
Drag options to blanks, or click blank then click option'
Aangle
B{kp.pt
Csize
Dresponse
Attempts:
3 left
💡 Hint
Common Mistakes
Using angle or response instead of size for the value.
Not starting the dictionary comprehension with a curly brace.
5fill in blank
hard

Fill all three blanks to filter keypoints by their response and create a list of their coordinates.

Computer Vision
filtered_points = [kp.[1] for kp in keypoints if kp.[2] > [3]]
Drag options to blanks, or click blank then click option'
Apt
Bresponse
C0.01
Dsize
Attempts:
3 left
💡 Hint
Common Mistakes
Using size instead of response for filtering.
Using the wrong attribute for the list elements.