MocapV2 is a Python-based motion capture system that utilizes computer vision techniques, primarily leveraging OpenCV, to detect and track infrared (IR) markers attached to objects in real-time.
MocapV2 aims to provide an accessible motion capture solution using readily available hardware, such as standard webcams. The system analyzes video input frame by frame, identifies IR markers, and estimates their 3D positions.
Originally developed for tracking studio cameras, MocapV2 can also be used for general motion capture applications. The modular architecture facilitates easy extension and integration into larger projects.
- Real-time Tracking: Detects and tracks IR markers from a video stream.
- OpenCV Integration: Uses OpenCV for video capture, image processing, and tracking.
- Visual Feedback: The GUI displays camera feeds and allows real-time parameter adjustments.
- Realtime Socket Communication: The calculated object transformations can be transmitted via sockets, enabling integration with applications like Unity 3D, Unreal Engine, and Blender.
- Modular Codebase: Organized structure for ease of development and scalability.
- Language: Python 3.x
- Core Libraries:
- OpenCV (opencv-python) - Video capture, image processing, and display.
- NumPy - Efficient numerical computations.
Follow these steps to set up the project:
git clone https://github.com/RashmikaDushan/MocapV2.git
cd MocapV2Using venv:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activateUsing conda:
conda create -n mocapv2 python=3.9 # Adjust Python version if needed
conda activate mocapv2pip install opencv-python numpyNote: Depending on your OS and Python version, OpenCV might require additional system dependencies.
To run the real-time motion capture demo:
- Ensure that at least two webcams are connected and accessible.
- Navigate to the project's root directory:
cd MocapV2 - Activate the virtual environment (if not already activated).
- Run the main application script:
python app.py
A window will open, displaying the webcam feed with settings in real-time. Press Esc to close the program.
Contributions are welcome! To contribute:
- Fork the repository on GitHub.
- Clone your fork:
git clone https://github.com/YourUsername/MocapV2.git
- Create a new branch:
git checkout -b feature/your-feature-name # or bugfix/issue-description - Make changes and commit:
git commit -am 'Add feature X' - Push changes:
git push origin feature/your-feature-name
- Open a Pull Request (PR) on the original repository.
Ensure your code follows best practices and update documentation if needed. You can also report bugs or suggest features by opening an issue on GitHub.
This project is licensed under the MIT Personal Use License.
You may use and modify this software for personal, non-commercial purposes only.
For full details, refer to the LICENSE file.
- Inspired by jyjblrd/Low-Cost-Mocap, with portions of the code adapted from it.
- Built using OpenCV for essential computer vision tasks.