Teaching pack · UAT 307

A 15-week teaching plan, 5 worksheets, a scoring rubric and a map from the course description to the lessons, for instructors to evaluate and adapt before teaching.

Last updated: · 3(3-0-6) · Per week: lecture 3 h, lab 0 h, self-study 6 h; 45 contact hours per term

Coverage of the course description

The lessons fully teach 10 of 10 description topics. Each topic lists the modules and lesson sections that teach it, and incomplete topics say what is missing.

Description topicModulesWhere it is taughtStatus
Digital image processingM1Module 1: An image is an array of numbers, Edge detection with Sobel and Choosing a threshold with Otsu's methodCovered
Image enhancementM1Module 1: Image enhancement (Example 3, contrast stretching, histogram equalisation and a median versus mean filter, with lab step 5 using CLAHE)Covered
Feature extractionM1M2Module 1: Edge detection with Sobel · Module 2: Automatic keypoints and matching (Example 3, Harris corners and the ratio test, with lab step 5 using ORB and RANSAC) and Homography and DLTCovered
Object detection and classificationM3Module 3: How detection and classification work (Example 1, a classifier's softmax and decoding a YOLO-style box, with lab step 1) · UAT 306 Module 4: NMS and APCovered
Image segmentationM1Module 1: Choosing a threshold with Otsu's method (Example 2) and From thresholds to model-based segmentation (Example 4, score maps, per-class IoU and mIoU, with lab step 6)Covered
Object trackingM3Module 3: Predicting position with a Kalman filter (Example 2) and Association and MOTA (Example 3)Covered
Depth estimationM4Module 4: Stereo depth and Single-camera scaleCovered
Environmental perceptionM4M5Module 4: Choosing perception sensors · Module 5: Periods of lost tracking and Limitations of RGB and thermal imagesCovered
Sensor fusionM2M4M5Module 4: Fusing camera and IMU with a Kalman filter (Example 3, a three-state filter that estimates bias, with lab step 5) and Single-camera scale · Module 2: Camera–IMU time offset · Module 5: ATE and alignmentCovered
Applications to UAS missionsM2M3M4M5Module 2: measuring a landing pad from an oblique image · Module 3: tracking and counting cars in drone video · Module 4: sensor proposal for an under-bridge inspection drone · Module 5: operating conditions of the perception systemCovered

Weekly teaching plan

WeekTopicPre-classLectureLabEvidence
1 M1An image is an array of numbersRead module 1 up to 'An image is an array of numbers'Pixels, channels and reading images with OpenCV and NumPyIn class: open a drone image in a notebook, read pixel values and view the histogram · Self-study: Worksheet 1 part A, make the notebook that loads and displays the image reproducibleNotebook that loads and displays the image
2 M1Edge detection with Sobel and image enhancementRead the Sobel and image-enhancement sections; run Examples 1 and 3Convolution with the Sobel kernel; edges versus noise; contrast stretching, histogram equalisation, CLAHE and the median filterIn class: compare Example 1 with cv2.Sobel and apply Gaussian blur before edge detection · Self-study: Worksheet 1 part B, apply CLAHE and a median filter to a hazy or noisy image and compare with Example 3Edge images before and after blur, and images before and after enhancement
3 M1Otsu's threshold and model-based segmentationRead the Otsu and model-based segmentation sections; run Examples 2 and 4; take the module 1 quizHistograms and separating bright roofs from dark ground; cloud shadows and a single threshold; FCN and U-Net, and evaluation with per-class IoU and mIoUIn class: compare with cv2.THRESH_OTSU and adaptive threshold on a roof image with cloud shadow · Self-study: Worksheet 1 part C, run a pretrained segmentation model, hand-label one image, compute per-class IoU and mIoU and finish the Worksheet 1 reportWorksheet 1 report and quiz result
4 M2Homography and DLTRead module 2 on homography and DLTMapping an oblique image to the ground plane with known pointsIn class: estimate a homography with Example 1 from an oblique image prepared by the lecturer, with four ground targets of known spacing · Self-study: Worksheet 2 part A, record the reference target coordinates and the resulting homography matrixOblique image used and reference target coordinates
5 M2Measuring ground distance from an oblique image; automatic keypoints and RANSACRun Example 1; read the automatic keypoints and matching section; run Example 3Measurement error; Harris corners, SIFT and ORB descriptors, the ratio test, and the effect of wrong points on a homographyIn class: measure other ground distances from the image against the known distances, compare with cv2.findHomography and add one wrong point · Self-study: Worksheet 2 part B, match ORB keypoints between two overlapping images supplied by the lecturer with the ratio test and count matches before and after RANSACImage distances versus known distances, and match counts before and after the ratio test and RANSAC
6 M2Camera–IMU time offsetRead the time-offset section; run Example 2; take the module 2 quizFinding the offset by cross-correlation; the Kalibr approachIn class: estimate the time offset with Example 2 from gyro and video recorded by the lecturer while rotating the drone by hand (or synthetic data with a known offset) · Self-study: Worksheet 2 part C, study the Kalibr documentation and write the camera-IMU calibration procedureWorksheet 2 report and quiz result
7 M3How detection and classification work; predicting position with a Kalman filterRead module 3 on how detection and classification work and on the Kalman filter; run Examples 1 and 2Softmax; two-stage and one-stage detectors; YOLO's grid, boxes and class scores; small objects in drone images; position and velocity state and growing uncertainty while a car is hiddenIn class: run the UAT 306 detector on car-park video, save boxes for every frame and check one box by hand as in Example 1 · Self-study: Worksheet 3 part A, compare full-frame with tiled detection and make the per-frame box filePer-frame box file
8 M3IoU association and MOTA evaluationRead the association section; run Example 3Tracking-by-detection, two cars passing and identity switchesIn class: write the tracker with IoU association from Example 2 and label ground-truth tracks for the first 20 frames · Self-study: Worksheet 3 part B, label all 100 frames and compute MOTA with Example 3MOTA and identity-switch count
9 M3Tuning the tracker; midtermReview modules 1–3; take the module 3 quizMidterm examination (modules 1–3)The midterm takes the class period, so there is no in-class practice · Self-study: Worksheet 3 part C, vary the IoU threshold and allowed missing frames and count cars crossing a line against a manual countWorksheet 3 report and midterm score
10 M4Stereo depthRead module 4 on stereo depth; run Example 1Baseline, disparity and depth error that grows with rangeIn class: compute depth from disparity with Example 1 using stereo images recorded by the lecturer at 1–10 m and an image of a plain textureless wall · Self-study: Worksheet 4 part A, make the table of computed depth against true range and predictionMeasured depth versus true range and prediction
11 M4Single-camera scaleRead the scale section; run Example 2Estimating scale by least squares and why acceleration is neededIn class: use recorded camera and IMU data to estimate scale during acceleration and constant speed with Example 2 · Self-study: Worksheet 4 part B, make the scale table for both segments and explain the differenceScale table for both segments
12 M4Camera–IMU fusion and choosing perception sensorsRead the camera–IMU Kalman fusion and sensor-choice sections; run Example 3; take the module 4 quizPredicting with the IMU, correcting with the camera and estimating bias; EKF, MSCKF and ArduPilot EKF3; strengths and limits of stereo, LiDAR and camera with IMUIn class: test Example 3 with a camera dropout (remove camera corrections between seconds 10 and 15) · Self-study: Worksheet 4 part C, write a perception-sensor proposal for an under-bridge inspection droneFused-error plot during the camera dropout, worksheet 4 report and quiz result
13 M5ATE and alignmentRead module 5 on ATE; run Example 1ATE before and after alignment and how it differs from RPEIn class: test synthetic trajectories with various rotations and shifts as in Example 1 · Self-study: Worksheet 5 part A, compute ATE and RPE on the module 4 dataATE and RPE table
14 M5Lost tracking and limitations of RGB and thermal imagesRead both sections; run Example 2; take the module 5 quizReporting periods without output and surfaces that break perceptionIn class: find lost-tracking periods with Example 2 and inspect the frames for causes · Self-study: Worksheet 5 part B, compare the lost-tracking fraction over grass, road and water using datasets prepared by the lecturerLost-tracking fraction by surface
15 M5Perception mini-project presentationsPrepare the team's perception operating conditions and limitationsCourse wrap-up and project criteriaThe class period is used to present a fair evaluation of the perception system with evidence and answer questions · Self-study: revise the report and the operating-conditions document after the commentsMini-project report and presentation, scored with the rubric

Worksheets and instructor guide

One worksheet per module. Students open it on the web, print it or download the .docx. The instructor guide under each worksheet gives the class timing, expected results, discussion questions and notes for students with different backgrounds.

1Worksheet 1 From formula to OpenCV
Analysis activity · About 3 h of class time · CLO1, CLO2

Objective: Implement edge detection and thresholding from formulas, compare with OpenCV and decide when classical processing is enough; enhance images and evaluate model-based segmentation

Equipment

  • Computer with Python, NumPy and OpenCV
  • Drone roof images with cloud shadows
  • Example code from the module 1 lesson
  • A pretrained segmentation model and drone images prepared by the lecturer

Safety

  • Computer work only; no flying

Steps

  1. In class: run Example 1 and compare with cv2.Sobel on the same image
  2. In class: apply Gaussian blur before edge detection and note the effect on noise
  3. In class: run Example 2 and compare with cv2.threshold using THRESH_OTSU, then try the cloud-shadow roof image and compare a single threshold with adaptive threshold
  4. Self-study: apply cv2.createCLAHE and cv2.medianBlur to a hazy or noisy image and compare with Example 3
  5. Self-study: run a pretrained segmentation model on the lecturer's images, hand-label one image and compute per-class IoU and mIoU as in Example 4
  6. Self-study: summarise which tasks suit classical image processing and which need AI

Deliverables

  • Reproducible notebook
  • Comparison images of edges and thresholds
  • One-page summary of method choice
  • Before-and-after enhancement images, and a per-class IoU and mIoU table

Checklist

  • The notebook runs from top to bottom without edits and reproduces the values in Table 1 (Correctness of algorithms and code)
  • Every row of Table 1 has both own-code and OpenCV results and explains any difference (for example output size or how pixels equal to the threshold are counted) (Correctness of algorithms and code)
  • Table 3 gives IoU for every class and the mIoU, not pixel accuracy alone (Fair measurement and evaluation)
  • The method-choice summary cites at least two numbers or images from this worksheet (Interpretation and limitations)
  • Every comparison image has a caption, and no image shows outsiders at identification level (Communication and safe data use)

Instructor guide

Class timing 180 min

  1. Review images as arrays, Sobel and Otsu20 min
  2. Steps 1-2: Sobel versus cv2.Sobel and the effect of Gaussian blur40 min
  3. Step 3: Otsu versus THRESH_OTSU, and adaptive threshold on the cloud-shadow image40 min
  4. Step 4: contrast stretching, CLAHE and the median filter30 min
  5. Step 5: model segmentation, hand labelling and IoU40 min
  6. Wrap-up, questions and hand-in checklist10 min

Expected results

  1. Record: Table 1 Own code versus OpenCV for edges and thresholds (steps 1-3)Table 1 (Example 1's synthetic 12×12 image, left 60, right 180, one noise pixel of 200): own code gives a maximum gradient magnitude of 480 at output columns 4 and 5 and 24 pixels above 200 (20 on the real edge, 4 from the noise pixel); cv2.Sobel (ksize 3) gives the same maximum |Gx| of 480, but its output is 12×12 because it pads the border, so the edge sits at image columns 5 and 6 (shifted by one); interior values must match exactly. After a 3×3 Gaussian blur the maximum drops to 360, the noise peak falls from 280 to 105, and only the 20 real edge pixels stay above 200. Otsu: own code gives 120 with a bright fraction of 29.9%; THRESH_OTSU reports 119 or 120 depending on how pixels equal to the threshold are counted, but the binary image is identical. Accept a difference of 1 level.
  2. Record: Table 2 Image enhancement and noise removal results (step 4)Table 2 (Example 3's data): original range 99-149, roof brighter than ground by 14.1 levels; stretched 0-255 with a difference of 96.2 (6.8 times); equalised 0-255 with 111.1 (7.9 times). Noisy image 6.1% of pixels more than 20 from clean, 3×3 mean 5.1%, 3×3 median 0.0%. For CLAHE and cv2.medianBlur on a real image the numbers depend on the image: expect CLAHE to raise contrast less than global equalisation but with less amplified noise, and medianBlur to cut the share of bad pixels clearly without moving the edge.
  3. Record: Table 3 Per-class IoU of the segmentation (step 5)Table 3 (if Example 4's simulated scores are used): ground true 1110, predicted 1077, intersection 1038, union 1149, IoU 0.903; roof 330, 347, 297, 380, IoU 0.782; water 160, 176, 117, 219, IoU 0.534; mIoU 0.740 while pixel accuracy is 0.907. On the lecturer's real images the numbers will differ, but the pattern should be the same: small or thin classes (water, canals, narrow roads) get the lowest IoU. Check that IoU = intersection/union and that true pixels of all classes add up to the image size.
  4. Question 1: In Table 1, how many extra pixels above a gradient magnitude of 200 did the single noise pixel create, and how did the numbers change after the Gaussian blur? What does blurring cost you?The noise pixel adds 4 pixels above 200 (24 against 20), because Sobel is a derivative and responds to any sudden change, a real edge or a single pixel. After blurring only the 20 real edge pixels remain, but the real edge is also weaker (480 down to 360) and wider. A strong answer says the kernel size must suit the size of the detail wanted; a fine crack can vanish if you blur too much.
  5. Question 2: On the roof image with cloud shadow, where did one threshold for the whole image go wrong? Explain with the shape of the image's histogram, and say why the adaptive threshold fixes it.The histogram of the cloud-shadow image no longer has two clear peaks, because roofs in shadow become as dark as sunlit ground. One threshold therefore marks shaded roofs as ground, or sunlit ground as roof. An adaptive threshold computes a threshold from each pixel's neighbourhood, so it follows the lighting in each part of the image. A strong answer points to the wrong regions in the actual output image.
  6. Question 3: From Table 2, which filter removed the black and white specks best while keeping the edge, and why? Why must temperature or reflectance be measured on the original data, not on the enhanced image?The median filter is best (0.0% against 5.1% for the mean), because a single extreme value never becomes the median of a 3×3 neighbourhood, while the mean spreads the bad value over its neighbours; the median also picks a value that really exists nearby, so the edge does not move. Enhancement changes pixel values to make viewing easier, so they are no longer measurements; temperature must come from the original radiometric thermal data and reflectance from the original data only.
  7. Question 4: Compare pixel accuracy with the mIoU and per-class IoU in Table 3. If this were a flood survey, which figure should decide whether the model is ready to use?Pixel accuracy is high because a large class such as ground dominates the image (1110 of 1600 pixels in the example), which hides the water class with an IoU of only 0.534. A flood survey must be judged mainly on the water IoU, with mIoU as support. A strong answer proposes a minimum water IoU before use and says it must be tested on images from the real area.
  8. Question 5: From your results, give one drone task where classical image processing is enough and one that needs AI, with reasons drawn from what you measured.A strong answer: separating bright roofs from dark ground under even lighting, or finding road and roof edges, can use Otsu or Sobel, because brightness alone is enough and results are easy to check; separating water, roads and grey roofs of similar brightness needs a segmentation model, because it depends on context rather than brightness. The answer must cite the student's own tables, not opinion alone.

Discussion questions

  • If your own code disagrees with OpenCV, which do you trust, and how would you find the cause?
  • How does heavy JPEG compression in drone images affect edge detection, thresholding and segmentation?
  • Who should label the images used to measure IoU, and how do labelling mistakes make the evaluation less trustworthy?

Adapting to student background

Upper secondary (M.6)
Have them work out the Sobel response at one edge pixel by hand first ((1+2+1)×(180-60) = 480) before running code, linking school derivatives to the 3×3 kernel; pair them with a peer fluent in setting up Python.
Vocational certificate
Start from the output images before the numbers; give a notebook where only the parameters (kernel size, threshold) are edited, and fill the tables row by row. Explain IoU by drawing two overlapping shapes on paper.
Diploma
Extension: apply cv2.Canny to the real roof image, tune its two thresholds to get complete roof edges with the fewest false edges, and compare with Sobel after Gaussian blur.

Common student mistakes: Common mistakes in the module 1 lesson

2Worksheet 2 Geometric and temporal calibration
Analysis activity · About 3 h of class time · CLO1, CLO2

Objective: Estimate a homography from an oblique image to measure ground distances and estimate the camera–IMU time offset

Equipment

  • An oblique drone image with four ground targets of known spacing, prepared by the lecturer (or a synthetic image made from a known homography)
  • Two overlapping drone images prepared by the lecturer
  • Gyro and video data recorded by the lecturer while rotating the drone by hand (or synthetic data with a known offset)
  • Python and OpenCV
  • Kalibr documentation

Safety

  • Computer work only; students do not fly in this course
  • The lecturer's recordings must come from flights within CAAT conditions in visual line of sight with people kept clear, and propellers must be removed before rotating the drone by hand
  • Do not share images showing outsiders at identification level

Steps

  1. In class: estimate the homography with Example 1 from the oblique image with four targets of known spacing
  2. In class: measure other ground distances from the image and compare with the known distances
  3. In class: compare with cv2.findHomography; add one wrong point and observe RANSAC
  4. In class: estimate the offset with Example 2 from the gyro and video data
  5. Self-study: detect ORB keypoints in the two overlapping images, match them with the ratio test of Example 3 and estimate the homography with RANSAC
  6. Self-study: study the Kalibr documentation and write a camera–IMU calibration procedure for the training drone

Deliverables

  • Homography matrix and distance table
  • RANSAC experiment result
  • Time offset with plots
  • Camera–IMU calibration procedure
  • Match counts before and after the ratio test and RANSAC

Checklist

  • Every row of Table 1 has image and ground coordinates, distance and error with units, and one row checks that a pad corner maps back to its known position (Fair measurement and evaluation)
  • The DLT code matches cv2.findHomography on the same four points (to within 0.01 m) (Correctness of algorithms and code)
  • Table 2 has both without and with RANSAC on the same wrong point, and match counts before and after the ratio test (Fair measurement and evaluation)
  • The time-offset answer quotes Table 3 and states the resolution set by the sample rate (Interpretation and limitations)
  • The camera-IMU calibration procedure is in numbered steps, includes removing propellers before rotating the drone by hand, and the report shows no outsiders (Communication and safe data use)

Instructor guide

Class timing 180 min

  1. Review homography, DLT and time offset20 min
  2. Steps 1-2: estimate H and measure ground distances40 min
  3. Step 3: a wrong point and RANSAC30 min
  4. Step 4: time offset by cross-correlation35 min
  5. Step 5: ORB, ratio test and RANSAC40 min
  6. Wrap-up, Kalibr procedure assignment and hand-in checklist15 min

Expected results

  1. Record: Table 1 Ground distances from the homography versus known distances (steps 1-2)Table 1 (if Example 1's synthetic 10 × 20 m pad is used): A (960, 700) px maps to (4.98, 4.30) m, B (960, 450) px to (5.03, 16.97) m, distance A-B 12.67 m, and corner (1320, 402) maps back to exactly (10.00, 20.00) m. Ground per pixel is about 0.039 m near A and 0.065 m near B. On the lecturer's real image, clicking errors of 1-2 px give distance errors from a few centimetres to about 0.1 m (B clicked 2 px off changes the distance by 0.13 m, A by 0.08 m); much larger errors mean checking that the points lie on one ground plane.
  2. Record: Table 2 Effect of a wrong point, RANSAC and feature matching (steps 3 and 5)Table 2 (if Example 1 is extended with a fifth ground point at (5, 10) m, which should be at (959.6, 571.9) px but is clicked 40 px low): fitting H to all five points without RANSAC gives A-B = 12.51 m (0.16 m wrong) and moves corner (10, 20) to (9.37, 20.26) m; with RANSAC the wrong point is rejected, 4 inliers remain and A-B returns to 12.67 m. ORB match counts depend on the images but must fall at every stage (all matches > after the ratio test > RANSAC inliers), and there should be at least several tens of inliers so the images overlay correctly; very few inliers means checking that the images overlap enough.
  3. Record: Table 3 Camera-IMU time offset (step 4)Table 3 (if Example 2's synthetic data at 200 Hz with a true offset of 35 ms is used): the estimate is 40 ms with a 5 ms resolution, within one sample of the truth; heading error at 60 deg/s is 2.1 deg (true 35 ms) or 2.4 deg (estimated 40 ms). The lecturer's real data will give a different value; accept it when it is stable within ±1 sample across several data segments.
  4. Question 1: Points A and B are only 250 px apart in the image but more than 12 m apart on the ground, and one pixel covers more ground near B than near A. Why? If you mis-click by 2 px, which point causes the larger distance error?The top of an oblique image is farther from the camera, so one pixel covers more ground (0.065 against 0.039 m per px); distance per pixel is not constant, so convert with H before measuring. A mis-click at the far point B causes the larger error (0.13 against 0.08 m). A strong answer adds that H holds only for points on one plane; the top of a pole projects to the wrong place.
  5. Question 2: After adding one wrong point and fitting H to all points, how much did distance A-B and the pad corner move? What happened with RANSAC? Explain what RANSAC did with that point.One wrong point skews the whole least-squares solution (distance 0.16 m wrong, a corner moved by more than 0.6 m) because every point has equal weight. RANSAC repeatedly fits small random subsets, keeps the H that most points agree with, and rejects points beyond its threshold as outliers, so the result returns to that of the four correct points.
  6. Question 3: How close was your estimated offset to the true value, compared with the sampling resolution? If the drone yaws at 90 deg/s, how many degrees of heading error does this offset cause, and how could the resolution be improved?The estimate is within one sample of the truth (5 ms at 200 Hz). At 90 deg/s a 40 ms offset gives 3.6 deg of heading error (20 ms gives 1.8 deg, as in the lesson's exercise). Resolution improves by interpolating around the cross-correlation peak or sampling faster, and the drone should be rotated clearly at several rates.
  7. Question 4: How much did the match count in Table 2 fall after the ratio test and after RANSAC? Why does the ratio test matter for images of tiled roofs or solar panels?Counts must fall at every stage, for example several hundred raw matches, a fraction after the ratio test and fewer again after RANSAC. Repeated patterns put one keypoint almost equally close to several others (ratio 0.81 in Example 3, so it is rejected, while a distinctive point gives 0.10). Accepting ambiguous pairs gives roughly even odds of a wrong pair, which RANSAC would then have to remove.

Discussion questions

  • If you used a homography to measure cracks on a building wall instead of the ground, what conditions must hold?
  • Why must camera-IMU calibration be repeated, for both position and timing, after changing a lens or camera mount?
  • Visual navigation errors may come from image parameters, mounting position or timing. How would you design tests to tell the three apart?

Adapting to student background

Upper secondary (M.6)
Have them write the two equations from one point pair by hand, then count that 4 pairs give 8 equations for 8 unknowns, linking to linear systems from school; allow extra time on the OpenCV steps.
Vocational certificate
Let them measure on a printed oblique image with a ruler first to see that top and bottom pixels differ, then use a notebook with the dlt function ready and only enter the clicked coordinates.
Diploma
Extension: place targets on the classroom floor, take an oblique photo with a phone camera (no drone), measure with a tape and compare with distances from H.

Common student mistakes: Common mistakes in the module 2 lesson

3Worksheet 3 Tracking cars in drone video
Analysis activity · About 3 h of class time · CLO3

Objective: Build a tracking-by-detection tracker, evaluate it with MOTA and use it to count cars

Equipment

  • Drone video of a car park
  • Detector from UAT 306
  • Python and the module 3 example code
  • Labelling tool

Safety

  • Computer work only; no flying
  • Do not share video showing licence plates or outsiders

Steps

  1. In class: run the detector on every frame, save the boxes and check one box by hand as in Example 1
  2. Self-study: compare full-frame with tiled detection
  3. In class: write the tracker from Example 2 with IoU association
  4. In class: label ground-truth tracks for the first 20 frames
  5. Self-study: label all 100 frames and compute MOTA with Example 3
  6. Self-study: vary the IoU threshold and the missing-frame limit before closing a track
  7. Self-study: count cars crossing a line and compare with a manual count

Deliverables

  • Tracker code
  • MOTA and identity switches
  • Parameter sweep table
  • Car count versus manual count

Checklist

  • The tracker runs on all 100 frames and saves the track IDs of every frame to a file (Correctness of algorithms and code)
  • Ground truth is labelled for all 100 frames, and every row of Table 2 separates FN, FP, IDSW and the number of real objects (Fair measurement and evaluation)
  • Table 2 has at least four settings, changing one parameter at a time (Fair measurement and evaluation)
  • Table 3 names the cause of each miscount, citing the frame where it happened (Interpretation and limitations)
  • No image or video in the report shows readable licence plates or outsiders (blurred) (Communication and safe data use)

Instructor guide

Class timing 180 min

  1. Review softmax, box decoding, the Kalman filter and MOTA20 min
  2. Step 1: run the detector and check a box by hand30 min
  3. Step 3: write the tracker with IoU association50 min
  4. Step 4: label ground-truth tracks for the first 20 frames40 min
  5. Trial MOTA on 20 frames and one parameter change25 min
  6. Wrap-up, self-study assignment and hand-in checklist15 min

Expected results

  1. Record: Table 1 Checking detector boxes, and full frame versus tiles (steps 1-2)Table 1 (if Example 1's assumed outputs are used, 20×20 grid on a 640×640 frame, cell row 7, column 12): centre (396.8, 248.0) px, size 44.8 × 25.6 px, corners (374.4, 235.2) to (419.2, 260.8); car score 0.90 × 0.85 = 0.765, truck 0.108, motorcycle 0.027, so only car passes 0.25. On the real video, check that the centre lies in the predicting cell and the box covers the car. Tiled detection should find more small cars than full frame, at a higher processing cost.
  2. Record: Table 2 MOTA for different IoU thresholds and missing-frame limits (steps 5-6)Table 2 (Example 3, two cars passing over 5 frames): FN 1, FP 1, IDSW 2, 10 real objects, MOTA = 1 - (1+1+2)/10 = 0.60; check the formula with the lesson's exercise, FN 5, FP 3, IDSW 2 of 50 gives 0.80. On the real video values depend on the detector; accept any value computed correctly from the ground truth, but expect that an IoU threshold set too high raises FN and IDSW for fast cars, and a missing-frame limit set too long causes wrong matches when a new car comes close.
  3. Record: Table 3 Cars crossing the line versus counting by eye (step 7)Table 3: depends on the video. A good tracker's count should be within about 1-2 cars of the count by eye in a small car park, and every difference must be explained as an identity switch, a broken track restarted (double count) or a car never detected.
  4. Question 1: While a car was hidden in your tracker, how did the position uncertainty change compared with Example 2, and why must there be a maximum number of missing frames before a track is closed?Uncertainty grows every frame without a detection, because the predict step adds Q each frame and no update reduces it. In Example 2 the position standard deviation rises from 1.44 px (frame 4) to 2.00, 2.58 and 3.17 px in frames 5-7, and returns to 1.77 px when the car reappears. Without closing the track the filter keeps predicting, its search region widens, and it ends up matching another car.
  5. Question 2: Which setting in Table 2 gave the highest MOTA, and which of FN, FP or IDSW changed most as you varied the settings? Explain using how the cars move in the video.Depends on the student's data. A strong answer notes that fast cars or small boxes give low frame-to-frame IoU, so a high threshold fails to associate them, causing FN and broken tracks that appear as IDSW, while cars passing close together raise IDSW; it cites the actual frames in the video.
  6. Question 3: If a car is 30 px wide in a 4K frame (3840 px wide) and the frame is shrunk to 640 px, how wide is the car? How does this explain the full-frame versus tiled difference in Table 1?30 × 640/3840 = 5 px, too small for the detector to see as a car. Tiles the size of the detector input keep the car at about 30 px, so more are found. A strong answer notes the cost in processing time and cars cut across tile borders.
  7. Question 4: Why can counting cars by track ID go wrong if identity switches are not checked, and how does compensating for the drone's own motion relate to this count?After a switch, one car may be counted crossing in the wrong direction, or counted twice when a broken track restarts (in Example 3 the two swapped cars would both be counted the wrong way). Without compensating for the drone's motion the whole image shifts, so parked cars appear to move and may be counted as crossing the line.

Discussion questions

  • If a client wants cars counted in and out of a car park all day, is MOTA alone enough? What other figures should be reported?
  • How could appearance features (colour, shape) reduce identity switches, and what privacy risks do they bring?
  • Does a detector score of 0.9 mean a 90% chance of being right in our scene? How would you check?

Adapting to student background

Upper secondary (M.6)
Have them compute Example 1's softmax and box centre with a calculator and MOTA by hand from a small table before building the tracker; pair them with a confident programmer.
Vocational certificate
Have them label and count cars by eye before coding, so they see what FN, FP and IDSW look like in real video; then use a prepared tracker and change only the two parameters.
Diploma
Extension: use the Kalman filter's velocity in association (match to the predicted position, not the last one) and compare IDSW with the basic tracker.

Common student mistakes: Common mistakes in the module 3 lesson

4Worksheet 4 Depth and scale
Analysis activity · About 3 h of class time · CLO1, CLO3

Objective: Compute stereo depth, estimate monocular scale with an IMU and choose perception sensors for a task

Equipment

  • Stereo images recorded by the lecturer at 1–10 m with true ranges, and an image of a plain textureless wall
  • A small stereo camera for a lecturer demonstration in class (if available)
  • Recorded camera and IMU data
  • Python and the module 4 example code

Safety

  • Computer work only; no flying
  • If a camera is demonstrated in class, keep cables and tripods clear of walkways

Steps

  1. In class: compute depth from disparity at 1–10 m against true range and Example 1
  2. In class: use the plain textureless wall image and note the missing depth
  3. Self-study: make the table of computed depth against prediction
  4. In class: estimate scale with Example 2 from camera and IMU data, comparing acceleration with constant speed
  5. In class: run Example 3, remove camera corrections between seconds 10 and 15, and compare with a filter without bias in its state
  6. Self-study: write a perception-sensor proposal for an under-bridge inspection drone

Deliverables

  • Measured versus predicted depth table
  • Scale estimates for two segments
  • One-page sensor proposal
  • Fused-error plot during the camera dropout

Checklist

  • Table 1 has at least five ranges between 1 and 10 m with units, and states the f and B used (Fair measurement and evaluation)
  • The modified Example 3 code removing camera corrections from 10 to 15 s runs reproducibly, with error plots for both filters attached (Correctness of algorithms and code)
  • Table 2 says which segment accelerates and which is constant speed, with a residual RMS in every row (Fair measurement and evaluation)
  • The sensor proposal cites at least one number from Table 1 or 3 and states the conditions in which the chosen sensors fail (Interpretation and limitations)

Instructor guide

Class timing 180 min

  1. Review Z = fB/d, scale and the camera-IMU Kalman filter20 min
  2. Steps 1-2: stereo depth and the plain wall (lecturer camera demo if available)45 min
  3. Step 4: scale for two segments35 min
  4. Step 5: camera dropout from 10 to 15 s, comparing two filters50 min
  5. Discuss sensor choice and assign the proposal20 min
  6. Hand-in checklist10 min

Expected results

  1. Record: Table 1 Stereo depth versus true range and prediction (steps 1-3)Table 1 (if the camera matches Example 1: f = 640 px, B = 0.095 m, disparity error 0.25 px; if the classroom camera differs, use its own f and B): 1 m disparity 60.80 px, error about 0.004 m; 2 m 30.40 px, 0.016 m; 3 m 20.27 px, 0.037 m; 4 m 15.20 px, 0.066 m; 5 m 12.16 px, 0.103 m; 6 m 10.13 px, 0.148 m; 7 m 8.69 px, 0.201 m; 8 m 7.60 px, 0.263 m; 9 m 6.76 px, 0.333 m; 10 m 6.08 px, 0.411 m. Measured errors should be of the same order as predicted (within about a factor of 2); much larger errors mean checking calibration and matching.
  2. Record: Table 2 Monocular scale with the IMU (step 4)Table 2 (if Example 2's data with a true scale of 3.2 is used): the clearly accelerating segment gives a scale of 3.250 with a residual RMS of 0.034 m (a 10-unit visual path is 32.5 m). The lesson gives no fixed number for constant speed; expect the scale to scatter or differ from the accelerating segment, with a larger residual, because the IMU cannot clearly measure acceleration near zero.
  3. Record: Table 3 Fused camera-IMU error during a camera dropout (step 5)Table 3 (Example 3's code, bias 0.08 m/s², camera at 10 Hz with 5 cm noise): without dropout, the filter with bias in its state has an RMS of 0.026 m and estimates the bias as 0.076 m/s², the filter without bias 0.028 m; with the camera removed from 10 to 15 s, the bias-state filter has an RMS of 0.067 m and a largest dropout error of 0.19 m, the filter without bias an RMS of 0.231 m and a largest error of 1.03 m (against 16.08 m for IMU alone after 20 s). Accept rounding differences in the last digit.
  4. Question 1: From Table 1, how fast does depth error grow when range doubles, and at what range does the error exceed 5% of range? Explain with Z = fB/d.Error grows with the square of range: double the range, four times the error (0.103 m at 5 m to 0.411 m at 10 m), because depth is inversely proportional to disparity; at long range disparity is only a few pixels, so 0.25 px matters a lot. Error reaches 5% at about 12.2 m (Z = 0.05 × fB/δd = 12.16 m). A strong answer concludes that a small stereo camera suits close-range obstacle avoidance.
  5. Question 2: Where did depth disappear on the plain textureless wall, and why? What does this say about flying over water or smooth ground?Depth disappears over most of the wall, because disparity needs the same pattern to be matched in both images, and every spot on a plain wall looks alike. The same happens over water, smooth ground or reflective surfaces, so a backup source such as a rangefinder, or a flight with height margin, is needed.
  6. Question 3: How did the scale from the accelerating segment differ from the constant-speed segment (value and residual), and why?The accelerating segment gives a scale close to the truth (3.250 against 3.2) with a low residual; at constant speed the IMU measures displacement poorly from near-zero acceleration, the signal-to-noise ratio is low, and the scale scatters or drifts. A strong answer says VIO needs enough accelerating motion, and that a 5% scale error makes a 100 m path wrong by 5 m.
  7. Question 4: During the 5 s camera dropout, how different were the filters with and without bias in the state? Explain with ½bt² and say what it means for flying over water.The filter without bias drifts by about 1.0 m in 5 s, matching ½ × 0.08 × 5² = 1.0 m, because the bias is integrated twice with nothing to remove it. The bias-state filter has estimated the bias (0.076 m/s²) before the dropout, so it removes it and drifts only about 0.19 m. Over water, where the camera may lose tracking, the time allowed on IMU alone must be limited, and the filter must have estimated the bias before then.
  8. Question 5: In your sensor proposal for an under-bridge inspection drone, which sensors did you choose, with reasons from the working range, lighting and surfaces measured in this worksheet?A strong answer: under a bridge light is low and working range is short (a few metres); stereo is accurate enough at short range (about 0.1 m at 5 m from Table 1) but fails in darkness or on smooth surfaces; LiDAR measures range accurately regardless of light but is heavier and costlier; below is water, which visual perception cannot be trusted over, so at least two sensors with different weaknesses are needed, with stated conditions where they must not be used. The answer must cite worksheet results, not just list sensors.

Discussion questions

  • To measure accurately at 20 m with stereo, what would you change, and what does each option cost?
  • Why does VIO not close loops as SLAM does, and what does that mean for a mission that returns to its start?

Adapting to student background

Upper secondary (M.6)
Have them derive Z = fB/d from similar triangles and differentiate to get δZ ≈ Z²δd/(fB) before filling the table, linking to upper secondary maths.
Vocational certificate
Let them fill Table 1 with a calculator range by range from the given formula, then look at the curve to see error rising fast at distance; in step 5 they only change the dropout window in prepared code.
Diploma
Extension: if a stereo camera is available, measure the depth of a box at 1-5 m themselves, measure the true range with a tape and compare with the predictions in Table 1.

Common student mistakes: Common mistakes in the module 4 lesson

5Worksheet 5 Fair evaluation of perception
Analysis activity · About 4 h of class time · CLO3

Objective: Evaluate trajectories with ATE and RPE, report lost-tracking periods and write operating conditions for the perception system

Equipment

  • Dataset from worksheet 4
  • Images and logs recorded by the lecturer over grass, road and water
  • Python and the module 5 example code

Safety

  • Computer work only; no flying in this course
  • The lecturer's recordings must come from flights within CAAT conditions in visual line of sight, and flights over water need height margin in case perception fails

Steps

  1. In class: create synthetic reference and estimated trajectories; test Example 1 with various rotations and shifts
  2. Self-study: compute aligned ATE and 1-second RPE on the module 4 dataset
  3. In class: find lost-tracking periods with Example 2 and inspect the frames for causes
  4. Self-study: compare the lost-tracking fraction over grass, road and water from the lecturer-prepared data
  5. Self-study: write operating conditions and limitations of the team's perception system
  6. In class (week 15): present the evaluation and answer questions

Deliverables

  • ATE and RPE table
  • Lost-tracking periods with causes
  • Surface comparison table
  • Operating-conditions document

Checklist

  • Table 1 states the alignment used (rotation and translation, no scale) and includes the 1-second RPE of the module 4 data (Fair measurement and evaluation)
  • The Umeyama alignment code is reproducible, and the no-rotation, no-shift case gives nearly equal errors before and after alignment (Correctness of algorithms and code)
  • Every period in Table 2 has a cause backed by actual images or frames, not a guess (Interpretation and limitations)
  • The operating-conditions document states surfaces, lighting and the longest acceptable lost-tracking time, with the required system response (Interpretation and limitations)
  • The presentation has plots and tables and uses only the lecturer-prepared data, with no images of outsiders (Communication and safe data use)

Instructor guide

Class timing 240 min

  1. Review ATE, RPE, alignment and lost tracking20 min
  2. Step 1: synthetic trajectories and alignment for several cases40 min
  3. Step 2: ATE and RPE on the module 4 data40 min
  4. Step 3: find lost-tracking periods and inspect the images for causes40 min
  5. Steps 4-5: compare surfaces and draft operating conditions40 min
  6. Step 6: present results and answer questions60 min

Expected results

  1. Record: Table 1 ATE before and after alignment, and RPE (steps 1-2)Table 1 (Example 1's ellipse with 0.3 m noise): rotation 8 deg, shift (3, -2) m gives 4.22 m before and 0.42 m after alignment, rotation found -7.7 deg; no rotation or shift 0.43 and 0.42 m, 0.2 deg; 20 deg and (5, 5) m 9.04 and 0.42 m, -19.7 deg; 45 deg and (10, 0) m 15.65 and 0.42 m, -44.8 deg (the found rotation has the opposite sign because it undoes the rotation). Module 4 data (Example 3 without dropout, already in the same frame): ATE 0.026 m, 1-second RPE RMS 0.040 m; with the camera removed from 10 to 15 s, ATE 0.067 m and RPE 0.056 m (maximum 0.23 m), against an RPE of 0.92 m for IMU alone.
  2. Record: Table 2 Lost-tracking periods and causes (step 3)Table 2 (if Example 2's data is used, 20 Hz output for 30 s, gaps over 0.2 s): start 12.00 s, 1.60 s, 31 outputs missing; start 21.00 s, 0.40 s, 7 missing; total 2.00 s = 6.7% of the flight, 562 of 600 outputs present. The lecturer's real data will differ; check that each period has a cause from the images, such as no texture, glare or motion blur.
  3. Record: Table 3 Surface comparison (step 4)Table 3: the lesson gives no per-surface numbers, so values depend on the lecturer's data. Expect water to lose tracking most, uniform grass next, and a road with markings least. Check that share = time lost/flight time and that the longest gap does not exceed the total time lost.
  4. Question 1: Why does the error before alignment differ so much between the cases in Table 1 while ATE after alignment is almost the same for all? If alignment also adjusted scale, what problem of a camera-plus-IMU system would it hide?Most of the error before alignment comes from the frame difference (rotation and shift), not from the shape of the path. After alignment only the 0.3 m per-axis noise remains (about 0.42 m), so all cases agree. A camera-plus-IMU system should know its own scale; aligning with scale would hide the scale error of Module 4, so the alignment type must always be stated.
  5. Question 2: On the module 4 data, how do ATE and RPE answer different questions? If the team wants to know how fast the system drifts while the camera is lost, which should it report?ATE says how close the whole path is to the truth; RPE says how wrong motion over short intervals is, that is, how fast the system drifts. The drift-during-dropout question needs RPE, especially its maximum in that period (0.23 m per second against an RMS of 0.056 m), because a whole-flight average hides the bad period.
  6. Question 3: How long was your longest lost-tracking period? At 5 m/s, how far does the drone move without a visual position, and what should the system do when tracking is lost for longer than acceptable?In Example 2 the longest gap is 1.6 s; at 5 m/s the drone moves 8 m with no visual position. A strong answer sets the longest acceptable time from the clearance to obstacles and defines what the system must do beyond it, such as switching to a mode that does not need position, or holding and waiting.
  7. Question 4: Which surface in Table 3 lost tracking most, what cause do the images show, and which operating condition did you write from this result?Depends on the data. A strong answer usually finds water worst, because its surface has no fixed texture, reflects light and moves, and writes a checkable condition such as not relying on visual position over water, keeping height margin and a backup position source, citing the images or frames as evidence.

Discussion questions

  • A system with very low ATE in a demo video but frequent tracking loss over water: is it ready for use? What does it depend on?
  • How can a thermal image of a metal roof show the wrong temperature, and how should this limitation be written into the operating conditions?

Adapting to student background

Upper secondary (M.6)
Have them draw two paths on graph paper and rotate and shift one by hand to understand alignment before running code, and compute the lost-tracking share for one surface by hand.
Vocational certificate
Focus on inspecting the frames where tracking was lost and writing causes in their own words; use prepared code for ATE, RPE and gaps, and fill the tables from its printed output.
Diploma
Extension: write a lost-tracking response procedure (acceptable time, clearance margin, mode to switch to) for one mission and test it against the lecturer's over-water data.

Common student mistakes: Common mistakes in the module 5 lesson

Scoring rubric

For worksheets and the mini-project. Each criterion scores level (1–4) ÷ 4 × weight.

CriterionWeightExcellent (4)Good (3)Fair (2)Needs work (1)
Correctness of algorithms and code30%Correct, reproducible code matching OpenCV or predictions, with differences explainedNearly all correct and reproducibleSome errors or partly irreproducibleCode fails or results badly wrong
Fair measurement and evaluation30%Right metrics for the question (MOTA, ATE, RPE), with ground truth and failure periods reportedRight metrics with minor gapsMetrics mismatched or no ground truthNo evaluation
Interpretation and limitations20%Explains failures from image evidence and states clear operating conditionsMostly explainedVague, not evidence-basedLimitations not addressed
Communication and safe data use20%Clear report with figures and tables; data used within conditions and privacy protectedClear with minor flawsHard to follow or some safety points ignoredDoes not communicate or unsafe

Assessment map: CLOs and how they are assessed Draft

The CLOs are a web-team draft; the course owner sets the final ones (curriculum book, part 4). This table is built from the worksheet and module-quiz data, so it follows any change to the CLOs.

CLOWorksheetsModule quizzes
CLO1 Explain image formation and camera geometryW 1W 2W 4M1M2M4
CLO2 Process images and calibrate camerasW 1W 2M1M2
CLO3 Apply perception for navigation and detectionW 3W 4W 5M3M4M5