This project demonstrates a 2 Degrees of Freedom (2-DOF) pan and tilt mechanism designed to track and follow objects, such as faces, using deep learning. The system utilizes an Arduino for servo control, a main PC for object detection and localization, and a RealSense camera for capturing video streams.
- Introduction
- Features
- Hardware Components
- Software Components
- Installation and Setup
- Usage
- Video Demonstration
- License
- Acknowledgements
The objective of this project is to create a pan and tilt mechanism that can follow an object, specifically a human face. This is achieved by using two servo motors to control the horizontal (pan) and vertical (tilt) movement of the camera, an Arduino for servo control, and a main PC running a deep learning algorithm to detect and localize objects in real-time.
- Real-time Object Detection: Utilizes OpenCV and Haar cascades for face detection.
- 2-DOF Control: Pan and tilt mechanism controlled by two servo motors.
- Arduino Integration: Arduino handles servo control based on commands from the main PC.
- 3D Printed Parts: Custom designed and 3D printed parts for mounting the camera and servos.
- 2 x Servo Motors
- 1 x Arduino (e.g., Arduino Uno)
- 1 x Intel RealSense Camera
- 3D Printed Parts for mounting and mechanism
- Connecting wires and power supply
- Python
- OpenCV
- pyrealsense2
- Arduino IDE
- 3D Print Parts: Print all necessary parts for the pan and tilt mechanism.
- Assemble Mechanism: Attach the servo motors and RealSense camera to the 3D printed parts.
- Connect Servos to Arduino:
- Connect the yaw (pan) servo to pin 9 on the Arduino.
- Connect the pitch (tilt) servo to pin 10 on the Arduino.
- Connect Arduino to PC: Connect the Arduino to your main PC via a USB cable.
- Clone Repository:
git clone [email protected]:abhismirai10/Sweet_a_2_dof_robotic_follower.git cd 2dof-object-tracking
- Install Dependencies:
pip install opencv-python pyrealsense2 numpy pyserial
- Upload Arduino Code:
- Open the Arduino IDE.
- Load the
servo_control.ino
file from thearduino
directory. - Select the appropriate board and port, then upload the code to the Arduino.
- Run the Python Script:
python object_tracking.py
- Start the RealSense Camera: Ensure the camera is properly connected and functioning.
- Face Detection: The system will start detecting faces and send servo control commands to the Arduino to adjust the pan and tilt angles accordingly.
- Stop the Program: Press
q
in the OpenCV window to terminate the program.
Watch the video demonstration of the project on YouTube: 2-DOF Object Tracking Pan and Tilt Mechanism
This project is licensed under the MIT License. See the LICENSE file for details.
- OpenCV for the computer vision library.
- Intel for the RealSense camera.
- Arduino for the microcontroller platform.
- Special thanks to the contributors of the project.
Feel free to contribute to this project by opening issues or submitting pull requests. For any inquiries or feedback, please contact [[email protected]].