PWP Report
PWP Report
PWP Report
Micro-Project
On
SAWANTWADI
MAHARASHTRA STATE BOARD OF
TECHNICAL EDUCATION
CERTIFICATE
This is to certify that,
Seal of
Institution
INDEX
Sr. Topic Name Page
No. No.
1. Abstract 1
2. Introduction 1
5. Advantages 5
6. Disadvantages 6-7
7. Program Code 8
8. Output 9-10
9. Conclusiom 11-12
10. Reference 13
11. Reference 14
1.INTRODUCTION:-
Our "Motion Capture using Python" project is a real-time 2D motion capture system
developed with Python, OpenCV, and the `cvzone` library. It aims to detect and record
human poses from video sources like pre-recorded videos or live webcam streams. By
analyzing video frames, the system identifies key landmarks on the human body and
stores their positions. The project demonstrates the capabilities of Python in computer
vision and serves as an educational resource for students interested in motion tracking.
With its accurate and versatile motion capture capabilities, the project lays the
groundwork for potential future advancements in 3D motion capture and integration
with other technologies.
2.OBJECTIVE:-
The objective of the "Motion Capture using Python" project is to develop a real-time
2D motion capture system that can accurately detect and record the human pose from
a video source. Using Python programming language, OpenCV, and the `cvzone`
library, the project aims to achieve efficient pose detection by identifying key
landmarks on thehuman body, such as joints and limbs, in each frame of the video.
The extracted (x, y, z) coordinates of these landmarks will be stored in a list for
further analysis and use. The system's primary focus is to provide accurate and
reliable motion capture results, enabling smooth real-time processing of video frames
from various sources, including pre-recorded videos and live webcam feeds.
Additionally, the project aims to be educational, serving as a valuable learning
resource for students interested in computer vision and motion tracking. Ultimately,
the project will showcase the capabilities of Python and OpenCV in the realm of
motion capture and lay the groundwork for potentialfuture expansions into 3D motion
capture or integration with advanced machine learning models for enhanced pose
estimation and analysis.
1
3. TECHNOLOGY AND TOOLS USED:-
In our "Motion Capture using Python" project, several tools and technologies have
been employed to develop a real-time 2D motion capture system. The project
leverages the following key tools and technologies:
3. cvzone Library: The `cvzone` library is utilized to enhance the pose estimation
process by providing specialized classes like `PoseDetector`. It extends OpenCV's
functionality and simplifies the implementation of complex computer vision tasks.
4. Video Input: The project handles video input, either from pre-recorded video files
(e.g., "Video.mp4") or live webcam streams. This enables real-time motion capture
and processing.
5. Text File I/O: The system uses Python's file handling capabilities to save the
collected pose data to a text file ("AnimationFile.txt") in a structured format.
By incorporating these tools and technologies, the project achieves a reliable and
efficient 2D motion capture system, showcasing the potential of Python and OpenCV
in computer vision applications.
2
4.DESCRIPTION OF PROJECT:-
The "Motion Capture using Python" project is a comprehensive and accessible 2D
motion capture system developed to detect and record the human pose from a video
source. Utilizing Python, OpenCV, and the `cvzone` library, this project offers a user-
friendly solution for capturing motion data and opens the door to various applications,
such as animation, sports analysis, and interactive experiences.
The core functionality of the project lies in its ability to process video frames in real-
time, extracting key landmarks on the human body through the `cvzone.PoseModule`.
These landmarks represent critical joints and body parts, including shoulders, elbows,
knees, and more. The system records the (x, y, z) coordinates of these landmarks, with
the y-coordinate adjusted to follow the standard image coordinate system. This data is
collected and stored in a list called `posList`, facilitating easy access and management.
To use the system, users can input a video file containing footage of a person in motion
or utilize a live webcam stream. The project then performs pose detection on each frame,
enabling accurate motion capture in real-time. Moreover, users have the option to save
the captured pose data to a text file named "AnimationFile.txt". This file stores the data
in a structured format, allowing for further analysis, animation, or integration into other
projects.
The "Motion Capture using Python" project not only serves as a functional 2D motion
capture system but also serves as a valuable educational tool for students interested in
computer vision and motion tracking. By showcasing the capabilities of Python and
OpenCV in the realm of computer vision, the project encourages exploration and
experimentation in motion capture technology.
3
5.ADVANTAGES:-
Advantages of the "Motion Capture using Python" Project:
4. Real-time Processing: The system offers real-time pose detection and motion
capture, enabling immediate feedback and analysis of human movements.
5. Data Storage: It facilitates easy storage and management of captured pose data,
allowing users to access and manipulate the information for further analysis or
integration into other projects.
7. Customization Options: Users can customize the project to suit their specific
requirements, whether by adjusting parameters, adding new features, or extending
its functionality to meet unique use cases.
8. Scalability: It lays the groundwork for potential expansion into 3D motion capture
and integration with advanced machine learning models, offering scalability and
adaptability for future developments.
4
6.DISADVANTAGES:-
Disadvantages of the "Motion Capture using Python" Project:
2. Accuracy Limitations: While the project strives for accuracy, the pose detection
maynot be as precise as more sophisticated motion capture systems, especially in
complex or occluded scenarios.
5. Limited Features: The project provides basic motion capture functionalities, but
it lacks more advanced features like gesture recognition or model-based pose
estimation,which may be essential for specific applications.
5
7.PROGRAM CODE: -
import cv2
from cvzone.PoseModule import PoseDetector
cap = cv2.VideoCapture('Video.mp4')
detector = PoseDetector()
posList = []
while True:
success, img = cap.read()
img = detector.findPose(img)
lmList, bboxInfo = detector.findPosition(img)
if bboxInfo:
lmString = ''
for lm in lmList:
lmString += f'{lm[1]},{img.shape[0] - lm[2]},{lm[3]},'
posList.append(lmString)
print(len(posList))
cv2.imshow("Image", img)
key = cv2.waitKey(1)
if key == ord('s'):
with open("AnimationFile.txt", 'w') as f:
f.writelines(["%s\n" % item for item in posList])
6
8.OUTPUT:-
7
9.CONCLUSION:-
In conclusion, the "Motion Capture using Python" project successfully demonstrates a
real-time 2D motion capture system with the help of Python, OpenCV, and the `cvzone`
library. The project offers a user-friendly solution for detecting and recording human
poses from video sources. It serves as an educational resource, showcasing the potential
of Python and OpenCV in computer vision applications. While the project excels in real-
time processing and ease of implementation, it is limited to 2D motion capture, and
accuracy may vary based on video quality. Despite its limitations, the project lays the
foundation for further research and development in the dynamic field of motion capture
technology.
8
10.REFERENCES:-
1. Source code: https://www.computervision.zone/courses/3d-motion-capture/
2. Official OpenCV Documentation: https://docs.opencv.org/
3. cvzone GitHub Repository: https://github.com/codewithharry/cvzone
4. Python Documentation: https://docs.python.org/
5.https://chat.openai.com/