Skip to content

Kjshinde/Dynamic-Cam-Align

Repository files navigation

Dynamic Camera

Table of Contents

  1. Project Description
  2. Power and Functional Block Diagram
  3. Bill of Materials
  4. Code
  5. Problems and Solutions
  6. Acknowledgements
  7. Useful Reading

Demo Vidoe

Dynamic.Cam.Align.mp4

Project Motivation / Statement of Need

Traditional fixed-position cameras lack flexibility, leaving gaps in coverage and limiting their effectiveness in dynamic environments. The Dynamic Camera Project overcomes these challenges by enabling object tracking across a 180-degree horizontal and 180-degree vertical field of view, ensuring comprehensive and adaptable surveillance.

This cost-effective system, powered by a Raspberry Pi Zero, servo motors, and OpenCV tracking algorithms, is ideal for applications like home security, robotics, and industrial automation. The project offers a modular, open-source solution for enhanced situational awareness and real-time tracking.


Block Diagram

Power and Functional Block Diagram


Bill of Materials

The complete Bill of Materials (BOM) is available here.


Code

The finalized working code is available here.

Setup Guide

  1. Set up the Raspberry Pi Zero by flashing it with Raspbian OS 1.
  2. Configure the Raspberry Pi for remote GPIO functionality 23.
  3. Install Python, set up a virtual environment, and install OpenCV on your laptop.
  4. Run the provided code.

Commands for Setting Up a Python Virtual Environment

For Windows

  • Create a Virtual Environment:

    python -m venv <path_to_your_environment_folder\name_of_environment>  
  • Activate the Environment:

    .\<name_of_environment>\Scripts\activate  
  • Deactivate the Environment:

    deactivate  

Problems and Solutions

Issue 1: this environment is externally managed Error When Using pip3

  • Cause: This error occurs because pip does not allow system-wide package installations by default. You must use a virtual environment.
  • Solution: Use the --break-system-packages flag cautiously to override this behavior:
    pip3 install <package_name> --break-system-packages  
    Alternatively, for safer options, refer to this Stack Overflow discussion.

Acknowledgements

Special thanks to Scott Driscoll for providing references and inspiration for this project.


Useful Reading

  1. How Servo Motors Work (Video)
  2. Current Sourcing from the Power Pin of Raspberry Pi Zero

References

Footnotes

  1. How to Set Up a Headless Raspberry Pi Zero (Without Monitor)

  2. Configuring Remote GPIO (Official Documentation)

  3. How to Configure Raspberry Pi Remote GPIO (Instructables)

About

This repo contains code and 3-D model and electronics layout for my person tracking rig.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors