Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Noora-Alhajeri/Smart-Camera

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Camera System

Overview

This project presents a real-time smart camera tracking system that combines motion-based multiple object tracking with particle filtering for robust object tracking. The system autonomously detects and follows objects using MATLAB for image processing and an Arduino-controlled servo mechanism for real-time camera adjustments.


Design

System Overview

The system consists of a USB webcam, Arduino UNO, and a pan-tilt servo mount. The webcam captures real-time video, processed in MATLAB to detect objects and compute position errors, which drive servo adjustments. System Overview

Component Design

The development flowchart illustrates the integration of two tracking methodologies:

  • Motion-Based Object Tracking (Yellow) – Detects and tracks moving objects in a static scene.
  • Particle Filtering (Green) – Enhances robustness by refining object position estimation.
  • Hybrid Integration Process (Blue) – Switches to particle filtering after 100 frames of stable tracking.

Object tracking is refined through color histograms, with differences computed using a distance function. The log probability function then determines the object's most probable location. The system continuously updates the camera’s position using a PID-controlled servo mechanism, ensuring seamless tracking.

Flow Diagram

Hardware and Circuit Connections

  • Arduino UNO microcontroller
  • Pan & Tilt Servo Motors (for camera movement)
  • Logitech HD Webcam
  • TinkerCad Circuit Simulation

Circuit Design


Algorithm Development

The system integrates motion-based tracking for initial object detection and particle filtering for enhanced accuracy in dynamic scenes.

1️. Motion-Based Multiple Object Tracking

  • Detects objects in a static camera setup
  • Segments moving objects using a background model.
  • Uses MATLAB's updateAssignedTracks() function Motion-Based Multiple Object Tracking

2️. Particle Filter Tracker

  • Tracks objects when the camera moves
  • Uses Bhattacharyya distance for histogram matching
  • Updates particle locations dynamically Particle Filter with PID Integration

3️. Servo Motor Control (PID Tracking)

  • Computes position error between the object and frame center.
  • Adjusts camera angles to maintain object focus

MATLAB Implementation

The system consists of three primary MATLAB scripts:

  1. Motion-Based Object Tracking./MotionBasedMultiObjectTracking.m
    • Detects objects using background subtraction.
  2. Particle Filter Tracker./particleFilterTracker3.m
    • Tracks objects dynamically with histogram matching.
  3. Main Execution Script./TESTCODEFINAL.m
    • Configures Arduino and executes the tracking system.

Execution Flow:

  • Arduino initializes servo motors.
  • Motion tracker detects objects and extracts bounding box dimensions and histograms.
  • Particle filter refines tracking.
  • PID controller adjusts servo angles for object centering.

License & Copyright

This project is licensed under the MIT License.

You are free to use, modify, and distribute this project for educational and research purposes, but proper credit must be given to the original author (Noora-Alhajeri).

Copyright Notice

© 2025 Noora-Alhajeri. All rights reserved.

Originally Developed: December 10, 2022
Uploaded to GitHub: 2025


Contact

For questions or collaboration, feel free to reach out:

📧 Email: n.s3eedalhajeri@gmail.com
🌐 LinkedIn: Noora-Alhajeri

About

This project presents a real-time smart camera tracking system that uses motion-based multiple object tracking combined with particle filtering for robust tracking. Implemented in MATLAB with an Arduino-controlled pan-tilt servo for real-time camera adjustments.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.