· Module 02

Track a Coloured Object with OpenCV on Raspberry Pi | Lecture 02

Dr. Redmond R. Shamshiri
Assistant Professor of Robotics · University of Southern Denmark (SDU)

Study Track a Coloured Object with OpenCV on Raspberry Pi | Lecture 02. Use the accompanying model, numerical example and practical task to connect the topic to a measurable engineering result. Notes are original supplemental material, not a transcript.

Lecture video: https://www.youtube.com/watch?v=GXBmFyRdUFE

Learning Objectives

  • Explain the role of detection metrics and operating thresholds in the engineering system.
  • Calculate the worked quantity with consistent units.
  • Design a measurement that can reveal an implementation failure.

Study guide

Original companion notes. These notes support the topic of this lesson. They are not a transcript or a claim about the exact contents, hardware settings or examples in the video.

Lesson focus: Track a Coloured Object with OpenCV on Raspberry Pi | Lecture 02

Define the input, measured output, units and pass/fail condition before running the experiment.

Detection metrics and operating thresholds

A detection score is not a calibrated probability of success in the field. Test on the relevant lighting, distance, crop and background. Report missed targets and false positives separately, and avoid evaluating near-duplicate frames from training footage.

Model, units and assumptions

\[Precision=\frac{TP}{TP+FP},\qquad Recall=\frac{TP}{TP+FN},\qquad IoU=\frac{|B_p\cap B_g|}{|B_p\cup B_g|}\]

TP, FP and FN depend on the matching rule, class and confidence threshold. Bp and Bg are predicted and reference bounding boxes. Specify the IoU threshold used for a true-positive match.

Worked engineering example

With 80 true positives, 20 false positives and 40 missed objects, precision is 0.80 and recall is 0.667. Raising confidence may improve precision while worsening recall.

Practical task and evidence

Apply the following procedure to the topic of this lesson: Track a Coloured Object with OpenCV on Raspberry Pi | Lecture 02.

  • Hold out scenes or recording sessions rather than random neighboring frames.
  • Inspect errors by lighting, distance and object size.
  • Measure acquisition-to-action latency as well as detection metrics.

Submit: a diagram or interface table, a short timestamped dataset, the calculation with units, and a paragraph explaining the largest observed limitation.

Check your understanding

Question. For TP = 45, FP = 5 and FN = 15, find precision and recall.

Show worked answer

Precision = 0.90; recall = 0.75.

Extension. Change one assumption in the model and explain which measurement would reveal that it no longer holds.

Summary

Detection metrics and operating thresholds: keep units, assumptions and timing explicit. Check the numerical model against an independent observation before using it in a larger system.

Practical AI Vision for Robotics: Raspberry Pi, Cameras, and ESP32 · Dr. Redmond R. Shamshiri · University of Southern Denmark (SDU)