Bird
Raised Fist0
Drone Programmingprogramming~10 mins

Surveying and mapping with photogrammetry in Drone Programming - Step-by-Step Execution

Choose your learning style10 modes available
Concept Flow - Surveying and mapping with photogrammetry
Plan flight path
↓
Drone flies and takes photos
↓
Collect images
↓
Upload images to software
↓
Software processes images
↓
Generate 3D map and measurements
↓
Review and export results
The drone flies a planned path taking photos, which are processed to create maps and measurements.
Execution Sample
Drone Programming
def photogrammetry_survey(area):
    flight_path = plan_path(area)
    images = drone_capture(flight_path)
    map_3d = process_images(images)
    return map_3d
This code plans a flight, captures images with a drone, processes them, and returns a 3D map.
Execution Table
StepActionInputOutputNotes
1Plan flight patharea coordinatesflight_path coordinatesDefines where drone will fly
2Drone flies and captures photosflight_pathimages setPhotos taken at intervals
3Upload images to softwareimages setimages ready for processingPrepare images for mapping
4Process imagesimages ready3D map dataSoftware matches points and builds map
5Return 3D map3D map data3D map outputFinal map ready for use
💡 All steps complete, 3D map generated from drone images
Variable Tracker
VariableStartAfter Step 1After Step 2After Step 3After Step 4Final
areagivengivengivengivengivengiven
flight_pathnonecoordinatescoordinatescoordinatescoordinatescoordinates
imagesnonenonephotos setphotos setphotos setphotos set
map_3dnonenonenonenone3D map data3D map output
Key Moments - 3 Insights
Why do we need to plan the flight path before flying?
Planning the flight path (Step 1) ensures the drone covers the entire survey area systematically, which is shown in the execution_table row 1.
What happens if images are not uploaded correctly to the software?
If images are not uploaded (Step 3), the software cannot process them to create the 3D map, so the process stops before Step 4 as shown in the execution_table.
Why does the drone take many photos instead of just one?
Multiple photos from different angles help the software match points and build an accurate 3D map, as explained in Step 4 of the execution_table.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the output after Step 2?
Aflight_path coordinates
Bimages set
C3D map data
Dphotos ready for processing
💡 Hint
Check the 'Output' column for Step 2 in the execution_table.
At which step does the software create the 3D map?
AStep 4
BStep 3
CStep 1
DStep 5
💡 Hint
Look at the 'Action' and 'Output' columns in the execution_table for where '3D map data' is produced.
If the flight path is not planned correctly, which variable will be affected first?
Aimages
Bmap_3d
Cflight_path
Darea
💡 Hint
Refer to variable_tracker to see which variable changes after Step 1.
Concept Snapshot
Surveying with photogrammetry:
1. Plan drone flight path over area.
2. Drone captures overlapping photos.
3. Upload images to processing software.
4. Software builds 3D map from images.
5. Export and use map for measurements.
Full Transcript
Surveying and mapping with photogrammetry involves planning a drone flight path over the survey area. The drone flies this path and takes many photos from different angles. These images are uploaded to special software that processes them by matching points in overlapping photos. This process creates a detailed 3D map of the area. The final map can be reviewed and exported for use in measurements and analysis. Each step changes variables like flight_path, images, and map_3d as shown in the execution table and variable tracker.

Practice

(1/5)
1. What is the main purpose of using photogrammetry in drone surveying?
easy
A. To create maps and 3D models from overlapping photos
B. To control the drone's battery life
C. To improve the drone's flight speed
D. To reduce the number of photos taken

Solution

  1. Step 1: Understand photogrammetry basics

    Photogrammetry uses many overlapping photos to build maps and 3D models.
  2. Step 2: Identify the main goal in drone surveying

    The goal is to create accurate maps and 3D models from the photos taken by the drone.
  3. Final Answer:

    To create maps and 3D models from overlapping photos -> Option A
  4. Quick Check:

    Photogrammetry = maps and 3D models [OK]
Hint: Photogrammetry means building maps from photos [OK]
Common Mistakes:
  • Confusing photogrammetry with drone battery management
  • Thinking photogrammetry speeds up flight
  • Assuming photogrammetry reduces photo count
2. Which of the following is the correct syntax to define a flight path list in Python for drone photogrammetry?
easy
A. flight_path = {"point1", "point2", "point3"}
B. flight_path = ("point1", "point2", "point3")
C. flight_path = ["point1", "point2", "point3"]
D. flight_path = "point1", "point2", "point3"

Solution

  1. Step 1: Identify list syntax in Python

    Lists use square brackets [] with items separated by commas.
  2. Step 2: Check each option

    flight_path = ["point1", "point2", "point3"] uses square brackets and quotes correctly for strings.
  3. Final Answer:

    flight_path = ["point1", "point2", "point3"] -> Option C
  4. Quick Check:

    List syntax = square brackets [OK]
Hint: Lists use square brackets [] in Python [OK]
Common Mistakes:
  • Using parentheses instead of square brackets for lists
  • Using curly braces which create sets, not lists
  • Leaving out brackets and just separating by commas
3. What will be the output of this Python code snippet used in photogrammetry data processing?
photos = ["img1.jpg", "img2.jpg", "img3.jpg"]
processed = [photo.replace('.jpg', '.tif') for photo in photos]
print(processed)
medium
A. ["img1.tif", "img2.tif", "img3.tif"]
B. ["img1.jpg", "img2.jpg", "img3.jpg"]
C. ["img1.tif.jpg", "img2.tif.jpg", "img3.tif.jpg"]
D. SyntaxError

Solution

  1. Step 1: Understand list comprehension with string replace

    Each photo filename has '.jpg' replaced by '.tif'.
  2. Step 2: Apply replace to each item

    "img1.jpg" becomes "img1.tif", similarly for others.
  3. Final Answer:

    ["img1.tif", "img2.tif", "img3.tif"] -> Option A
  4. Quick Check:

    Replace '.jpg' with '.tif' = changed list [OK]
Hint: String replace in list comprehension changes extensions [OK]
Common Mistakes:
  • Expecting original list without changes
  • Thinking replace adds text instead of replacing
  • Confusing syntax causing errors
4. Identify the error in this Python code snippet for planning drone photo overlap:
overlap = 0.7
if overlap > 1:
    print("Overlap too high")
else
    print("Overlap acceptable")
medium
A. Incorrect comparison operator in if statement
B. Missing colon after else statement
C. Variable overlap should be an integer
D. Print statements must be outside if-else

Solution

  1. Step 1: Check syntax of if-else statements

    Python requires a colon ':' after else keyword.
  2. Step 2: Identify missing colon

    Code has 'else' without a colon, causing syntax error.
  3. Final Answer:

    Missing colon after else statement -> Option B
  4. Quick Check:

    else: needs colon [OK]
Hint: Always put colon after else in Python [OK]
Common Mistakes:
  • Forgetting colon after else
  • Thinking overlap must be integer
  • Misreading comparison operator
5. You want to generate a dictionary mapping photo filenames to their GPS coordinates after a drone flight. Which Python code correctly creates this dictionary from two lists: photos = ["img1.jpg", "img2.jpg", "img3.jpg"] and coords = [(34.5, -117.2), (34.6, -117.3), (34.7, -117.4)]?
hard
A. photo_coords = [photos, coords]
B. photo_coords = dict(zip(coords, photos))
C. photo_coords = {coords[i]: photos[i] for i in range(len(coords))}
D. photo_coords = {photos[i]: coords[i] for i in range(len(photos))}

Solution

  1. Step 1: Understand dictionary creation from two lists

    We want keys as photo names and values as coordinates.
  2. Step 2: Check each option

    photo_coords = {photos[i]: coords[i] for i in range(len(photos))} uses dictionary comprehension with matching indexes correctly.
  3. Final Answer:

    photo_coords = {photos[i]: coords[i] for i in range(len(photos))} -> Option D
  4. Quick Check:

    Dict keys=photos, values=coords [OK]
Hint: Use dict comprehension with index to pair lists [OK]
Common Mistakes:
  • Swapping keys and values in dict
  • Using zip with wrong order
  • Creating list instead of dict
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard