0
0
Drone Programmingprogramming~30 mins

Object detection from aerial view in Drone Programming - Mini Project: Build & Apply

Choose your learning style9 modes available
Object detection from aerial view
📖 Scenario: You are programming a drone to detect objects from an aerial view. The drone captures images and identifies objects by their color codes.
🎯 Goal: Build a simple program that stores detected objects with their color codes, sets a detection threshold, filters objects based on this threshold, and prints the filtered objects.
📋 What You'll Learn
Create a dictionary with object names and their color codes
Add a detection threshold variable
Use a dictionary comprehension to filter objects with color codes above the threshold
Print the filtered dictionary
💡 Why This Matters
🌍 Real World
Drones use object detection to identify cars, trees, buildings, and people from above, helping in mapping, surveillance, and rescue operations.
💼 Career
Understanding how to filter and process detected objects is important for drone software developers and engineers working on aerial imaging and autonomous navigation.
Progress0 / 4 steps
1
DATA SETUP: Create detected objects dictionary
Create a dictionary called detected_objects with these exact entries: 'car': 120, 'tree': 80, 'building': 150, 'person': 60, 'road': 100
Drone Programming
Need a hint?

Use curly braces {} to create a dictionary with keys and values separated by colons.

2
CONFIGURATION: Set detection threshold
Create a variable called detection_threshold and set it to 90
Drone Programming
Need a hint?

Just assign the number 90 to the variable detection_threshold.

3
CORE LOGIC: Filter objects above threshold
Create a new dictionary called filtered_objects using dictionary comprehension that includes only items from detected_objects where the color code is greater than detection_threshold
Drone Programming
Need a hint?

Use dictionary comprehension with for obj, code in detected_objects.items() and an if condition.

4
OUTPUT: Print filtered objects
Write a print statement to display the filtered_objects dictionary
Drone Programming
Need a hint?

Use print(filtered_objects) to show the filtered dictionary.