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.
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 topic | Modules | Where it is taught | Status |
|---|---|---|---|
| Digital image processing | M1 | Module 1: An image is an array of numbers, Edge detection with Sobel and Choosing a threshold with Otsu's method | Covered |
| Image enhancement | M1 | Module 1: Image enhancement (Example 3, contrast stretching, histogram equalisation and a median versus mean filter, with lab step 5 using CLAHE) | Covered |
| Feature extraction | M1M2 | Module 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 DLT | Covered |
| Object detection and classification | M3 | Module 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 AP | Covered |
| Image segmentation | M1 | Module 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 tracking | M3 | Module 3: Predicting position with a Kalman filter (Example 2) and Association and MOTA (Example 3) | Covered |
| Depth estimation | M4 | Module 4: Stereo depth and Single-camera scale | Covered |
| Environmental perception | M4M5 | Module 4: Choosing perception sensors · Module 5: Periods of lost tracking and Limitations of RGB and thermal images | Covered |
| Sensor fusion | M2M4M5 | Module 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 alignment | Covered |
| Applications to UAS missions | M2M3M4M5 | Module 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 system | Covered |
Weekly teaching plan
| Week | Topic | Pre-class | Lecture | Lab | Evidence |
|---|---|---|---|---|---|
| 1 M1 | An image is an array of numbers | Read module 1 up to 'An image is an array of numbers' | Pixels, channels and reading images with OpenCV and NumPy | In 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 reproducible | Notebook that loads and displays the image |
| 2 M1 | Edge detection with Sobel and image enhancement | Read the Sobel and image-enhancement sections; run Examples 1 and 3 | Convolution with the Sobel kernel; edges versus noise; contrast stretching, histogram equalisation, CLAHE and the median filter | In 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 3 | Edge images before and after blur, and images before and after enhancement |
| 3 M1 | Otsu's threshold and model-based segmentation | Read the Otsu and model-based segmentation sections; run Examples 2 and 4; take the module 1 quiz | Histograms and separating bright roofs from dark ground; cloud shadows and a single threshold; FCN and U-Net, and evaluation with per-class IoU and mIoU | In 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 report | Worksheet 1 report and quiz result |
| 4 M2 | Homography and DLT | Read module 2 on homography and DLT | Mapping an oblique image to the ground plane with known points | In 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 matrix | Oblique image used and reference target coordinates |
| 5 M2 | Measuring ground distance from an oblique image; automatic keypoints and RANSAC | Run Example 1; read the automatic keypoints and matching section; run Example 3 | Measurement error; Harris corners, SIFT and ORB descriptors, the ratio test, and the effect of wrong points on a homography | In 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 RANSAC | Image distances versus known distances, and match counts before and after the ratio test and RANSAC |
| 6 M2 | Camera–IMU time offset | Read the time-offset section; run Example 2; take the module 2 quiz | Finding the offset by cross-correlation; the Kalibr approach | In 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 procedure | Worksheet 2 report and quiz result |
| 7 M3 | How detection and classification work; predicting position with a Kalman filter | Read module 3 on how detection and classification work and on the Kalman filter; run Examples 1 and 2 | Softmax; 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 hidden | In 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 file | Per-frame box file |
| 8 M3 | IoU association and MOTA evaluation | Read the association section; run Example 3 | Tracking-by-detection, two cars passing and identity switches | In 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 3 | MOTA and identity-switch count |
| 9 M3 | Tuning the tracker; midterm | Review modules 1–3; take the module 3 quiz | Midterm 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 count | Worksheet 3 report and midterm score |
| 10 M4 | Stereo depth | Read module 4 on stereo depth; run Example 1 | Baseline, disparity and depth error that grows with range | In 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 prediction | Measured depth versus true range and prediction |
| 11 M4 | Single-camera scale | Read the scale section; run Example 2 | Estimating scale by least squares and why acceleration is needed | In 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 difference | Scale table for both segments |
| 12 M4 | Camera–IMU fusion and choosing perception sensors | Read the camera–IMU Kalman fusion and sensor-choice sections; run Example 3; take the module 4 quiz | Predicting with the IMU, correcting with the camera and estimating bias; EKF, MSCKF and ArduPilot EKF3; strengths and limits of stereo, LiDAR and camera with IMU | In 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 drone | Fused-error plot during the camera dropout, worksheet 4 report and quiz result |
| 13 M5 | ATE and alignment | Read module 5 on ATE; run Example 1 | ATE before and after alignment and how it differs from RPE | In 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 data | ATE and RPE table |
| 14 M5 | Lost tracking and limitations of RGB and thermal images | Read both sections; run Example 2; take the module 5 quiz | Reporting periods without output and surfaces that break perception | In 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 lecturer | Lost-tracking fraction by surface |
| 15 M5 | Perception mini-project presentations | Prepare the team's perception operating conditions and limitations | Course wrap-up and project criteria | The 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 comments | Mini-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
- In class: run Example 1 and compare with cv2.Sobel on the same image
- In class: apply Gaussian blur before edge detection and note the effect on noise
- 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
- Self-study: apply cv2.createCLAHE and cv2.medianBlur to a hazy or noisy image and compare with Example 3
- 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
- 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
- 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)
- Table 3 gives IoU for every class and the mIoU, not pixel accuracy alone
- The method-choice summary cites at least two numbers or images from this worksheet
- Every comparison image has a caption, and no image shows outsiders at identification level
Instructor guide
Class timing
- Review images as arrays, Sobel and Otsu20 min
- Steps 1-2: Sobel versus cv2.Sobel and the effect of Gaussian blur40 min
- Step 3: Otsu versus THRESH_OTSU, and adaptive threshold on the cloud-shadow image40 min
- Step 4: contrast stretching, CLAHE and the median filter30 min
- Step 5: model segmentation, hand labelling and IoU40 min
- Wrap-up, questions and hand-in checklist10 min
Expected results
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
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
- In class: estimate the homography with Example 1 from the oblique image with four targets of known spacing
- In class: measure other ground distances from the image and compare with the known distances
- In class: compare with cv2.findHomography; add one wrong point and observe RANSAC
- In class: estimate the offset with Example 2 from the gyro and video data
- 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
- 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
- The DLT code matches cv2.findHomography on the same four points (to within 0.01 m)
- Table 2 has both without and with RANSAC on the same wrong point, and match counts before and after the ratio test
- The time-offset answer quotes Table 3 and states the resolution set by the sample rate
- The camera-IMU calibration procedure is in numbered steps, includes removing propellers before rotating the drone by hand, and the report shows no outsiders
Instructor guide
Class timing
- Review homography, DLT and time offset20 min
- Steps 1-2: estimate H and measure ground distances40 min
- Step 3: a wrong point and RANSAC30 min
- Step 4: time offset by cross-correlation35 min
- Step 5: ORB, ratio test and RANSAC40 min
- Wrap-up, Kalibr procedure assignment and hand-in checklist15 min
Expected results
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
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
- In class: run the detector on every frame, save the boxes and check one box by hand as in Example 1
- Self-study: compare full-frame with tiled detection
- In class: write the tracker from Example 2 with IoU association
- In class: label ground-truth tracks for the first 20 frames
- Self-study: label all 100 frames and compute MOTA with Example 3
- Self-study: vary the IoU threshold and the missing-frame limit before closing a track
- 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
- Ground truth is labelled for all 100 frames, and every row of Table 2 separates FN, FP, IDSW and the number of real objects
- Table 2 has at least four settings, changing one parameter at a time
- Table 3 names the cause of each miscount, citing the frame where it happened
- No image or video in the report shows readable licence plates or outsiders (blurred)
Instructor guide
Class timing
- Review softmax, box decoding, the Kalman filter and MOTA20 min
- Step 1: run the detector and check a box by hand30 min
- Step 3: write the tracker with IoU association50 min
- Step 4: label ground-truth tracks for the first 20 frames40 min
- Trial MOTA on 20 frames and one parameter change25 min
- Wrap-up, self-study assignment and hand-in checklist15 min
Expected results
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
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
- In class: compute depth from disparity at 1–10 m against true range and Example 1
- In class: use the plain textureless wall image and note the missing depth
- Self-study: make the table of computed depth against prediction
- In class: estimate scale with Example 2 from camera and IMU data, comparing acceleration with constant speed
- In class: run Example 3, remove camera corrections between seconds 10 and 15, and compare with a filter without bias in its state
- 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
- The modified Example 3 code removing camera corrections from 10 to 15 s runs reproducibly, with error plots for both filters attached
- Table 2 says which segment accelerates and which is constant speed, with a residual RMS in every row
- The sensor proposal cites at least one number from Table 1 or 3 and states the conditions in which the chosen sensors fail
Instructor guide
Class timing
- Review Z = fB/d, scale and the camera-IMU Kalman filter20 min
- Steps 1-2: stereo depth and the plain wall (lecturer camera demo if available)45 min
- Step 4: scale for two segments35 min
- Step 5: camera dropout from 10 to 15 s, comparing two filters50 min
- Discuss sensor choice and assign the proposal20 min
- Hand-in checklist10 min
Expected results
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
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
- In class: create synthetic reference and estimated trajectories; test Example 1 with various rotations and shifts
- Self-study: compute aligned ATE and 1-second RPE on the module 4 dataset
- In class: find lost-tracking periods with Example 2 and inspect the frames for causes
- Self-study: compare the lost-tracking fraction over grass, road and water from the lecturer-prepared data
- Self-study: write operating conditions and limitations of the team's perception system
- 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
- The Umeyama alignment code is reproducible, and the no-rotation, no-shift case gives nearly equal errors before and after alignment
- Every period in Table 2 has a cause backed by actual images or frames, not a guess
- The operating-conditions document states surfaces, lighting and the longest acceptable lost-tracking time, with the required system response
- The presentation has plots and tables and uses only the lecturer-prepared data, with no images of outsiders
Instructor guide
Class timing
- Review ATE, RPE, alignment and lost tracking20 min
- Step 1: synthetic trajectories and alignment for several cases40 min
- Step 2: ATE and RPE on the module 4 data40 min
- Step 3: find lost-tracking periods and inspect the images for causes40 min
- Steps 4-5: compare surfaces and draft operating conditions40 min
- Step 6: present results and answer questions60 min
Expected results
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
Scoring rubric
For worksheets and the mini-project. Each criterion scores level (1–4) ÷ 4 × weight.
| Criterion | Weight | Excellent (4) | Good (3) | Fair (2) | Needs work (1) |
|---|---|---|---|---|---|
| Correctness of algorithms and code | 30% | Correct, reproducible code matching OpenCV or predictions, with differences explained | Nearly all correct and reproducible | Some errors or partly irreproducible | Code fails or results badly wrong |
| Fair measurement and evaluation | 30% | Right metrics for the question (MOTA, ATE, RPE), with ground truth and failure periods reported | Right metrics with minor gaps | Metrics mismatched or no ground truth | No evaluation |
| Interpretation and limitations | 20% | Explains failures from image evidence and states clear operating conditions | Mostly explained | Vague, not evidence-based | Limitations not addressed |
| Communication and safe data use | 20% | Clear report with figures and tables; data used within conditions and privacy protected | Clear with minor flaws | Hard to follow or some safety points ignored | Does 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.