English | 简体中文
Rope Skipping Counter is a video processing application based on OpenCV and MediaPipe, designed to count rope skipping repetitions in real-time. By detecting changes in the user's posture, this application accurately recognizes skipping actions and keeps count.
- Real-time detection of human pose and extraction of hip and shoulder positions.
- Calculation and visualization of the Y-axis center to monitor vertical body movement.
- Counting rope skipping repetitions based on movement amplitude.
- Real-time drawing of skipping counts and center point positions.
- Python
- OpenCV
- MediaPipe
- Matplotlib
- NumPy
Make sure you have the following libraries installed:
pip install opencv-python mediapipe matplotlib numpy
-
Rename the video file to be processed as
demo.mp4
and place it in the code folder. -
Run the code:
python rope_skipping_counter.py
-
Once processing is complete, the output will be saved as
demo_output.mp4
.
You can adjust the following parameters as needed:
buffer_time
: Buffer duration, default is 50.dy_ratio
: Movement amplitude threshold, default is 0.3.up_ratio
: Rising threshold, default is 0.55.down_ratio
: Falling threshold, default is 0.35.flag_low
andflag_high
: Thresholds to control the flip flag.
During the run, the program will display the skipping count and center point position in the video frames. After completion, you can view the visualized skipping process in the output video.