0
0
Drone Programmingprogramming~10 mins

Why computer vision enables intelligent flight in Drone Programming - 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.

Drone Programming
image = cv2.[1]('drone_view.jpg')
Drag options to blanks, or click blank then click option'
Aresize
Bimread
Cimwrite
Dimshow
Attempts:
3 left
💡 Hint
Common Mistakes
Using imshow instead of imread, which only displays images.
2fill in blank
medium

Complete the code to convert the image to grayscale for easier processing.

Drone Programming
gray_image = cv2.cvtColor(image, [1])
Drag options to blanks, or click blank then click option'
Acv2.COLOR_BGR2GRAY
Bcv2.COLOR_RGB2BGR
Ccv2.COLOR_GRAY2BGR
Dcv2.COLOR_BGR2RGB
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing color space conversions that do not produce grayscale images.
3fill in blank
hard

Fix the error in the code to detect edges using the Canny method.

Drone Programming
edges = cv2.Canny([1], 100, 200)
Drag options to blanks, or click blank then click option'
Aedges
Bimage
Cgray_image
Dcv2
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the original color image instead of the grayscale image.
4fill in blank
hard

Fill both blanks to create a dictionary of detected objects with their confidence scores.

Drone Programming
detected_objects = [1](object_name: confidence for object_name, confidence in [2].items() if confidence > 0.5)
Drag options to blanks, or click blank then click option'
Adict
Blist
Cdetections
Dset
Attempts:
3 left
💡 Hint
Common Mistakes
Using list or set instead of dict, or wrong variable name for detections.
5fill in blank
hard

Fill all three blanks to train a simple neural network model for flight path prediction.

Drone Programming
model = Sequential()
model.add(Dense([1], activation='relu', input_shape=([2],)))
model.add(Dense([3], activation='softmax'))
Drag options to blanks, or click blank then click option'
A64
B10
C100
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up input shape and number of neurons, or wrong output layer size.