← Back to projects

Personal computer vision project

TowTruck Alert

Learning Python, OpenCV, and modern object detection through a real-time vehicle detection and tracking pipeline.

Status
V1 Complete
Focus
Computer vision fundamentals
Input
Live webcam feed
TowTruck Alert tracking cars on a road with bounding boxes, confidence scores, and tracking IDs

Overview

The original idea was to detect tow trucks entering an apartment complex and eventually notify residents. As I worked through the problem, the project became a broader exercise in building a solid real-time object detection and tracking pipeline.

The finished application processes a webcam feed, detects selected vehicle classes with Ultralytics YOLO, draws confidence-scored boxes, calculates center points, and assigns persistent IDs as objects move through the frame.

Current capabilities

Real-time detection

Processes object detection continuously from a live webcam feed.

Object tracking

Uses YOLO tracking to maintain persistent IDs across frames.

Vehicle filtering

Displays selected classes such as cars, trucks, and buses.

Confidence scores

Shows the model confidence associated with each detection.

Bounding boxes

Uses OpenCV to highlight detected objects in the frame.

Center-point calculation

Calculates and displays object center coordinates.

Workflow

Webcam
↓
Frame capture
↓
YOLO detection
↓
Vehicle filtering
↓
Object tracking
↓
Bounding boxes
↓
Tracking IDs + confidence
↓
Display frame

Learning progression

  1. 01

    First successful face detection

    The first milestone: loading OpenCV, detecting a face with a Haar Cascade, and drawing a first detection box.

  2. 02

    Finding my first major bug

    A misunderstanding of video frames opened hundreds of image windows—a major debugging lesson.

  3. 03

    Understanding video streams

    Debugging made it clear that OpenCV continuously processes webcam frames instead of creating individual images.

  4. 04

    Persistent object tracking

    The final milestone: Ultralytics YOLO detections receive persistent tracking IDs while moving through the scene.

Screenshots

An early webcam test with a green rectangle around a detected face
The first face detection test with OpenCV.
YOLO detecting a person, a bottle, and a potted plant in a webcam feed
Trying YOLO with several objects in the same frame.
A detected person with a confidence score, bounding box, and marked center point
Adding confidence scores and center points to detections.

Challenges

OpenCV coordinate systems

Learning how image coordinates map to boxes, center points, and frame annotations.

Video-frame processing

Understanding that a live feed is a continuous stream rather than a sequence of static image windows.

YOLO output

Learning to interpret pretrained-model detections, classes, and confidence values.

Detection versus tracking

Moving from identifying an object in one frame to following it through a scene with a persistent ID.

What I learned

  • Working with OpenCV and image coordinates.
  • Drawing graphics and labels directly on video frames.
  • Debugging real-time applications through small experiments.
  • Using pretrained machine-learning models responsibly.
  • Organizing a larger Python project into manageable milestones.
  • The value of iteration when a first idea evolves into a stronger learning project.
Technical stack
  • Python
  • OpenCV
  • Ultralytics YOLO
  • PyTorch
  • NumPy
  • Git
  • GitHub

Takeaway

Although TowTruck Alert began with a specific tow-truck use case, it evolved into a much broader exploration of computer vision. The project gave me a practical foundation for future AI and vision work: how a frame becomes a detection, and how a detection becomes something you can follow over time.

Explore the repository ↗