All Projects → kostecky → VBT-Barbell-Tracker

kostecky / VBT-Barbell-Tracker

Licence: CC0-1.0 license
A proof of concept app to optically track a barbell through its range of motion using OpenCV to give the lifter realtime feedback on concentric avg velocity, cutoff velocity, and displacement for a Velocity Based Training program.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to VBT-Barbell-Tracker

OpenCV-Object-Tracking
Object Tracking Using OpenCV and Python Plus Comparing different Trackers
Stars: ✭ 32 (-39.62%)
Mutual labels:  object-tracking, opencv-python
iterative-grabcut
This algorithm uses a rectangle made by the user to identify the foreground item. Then, the user can edit to add or remove objects to the foreground. Then, it removes the background and makes it transparent.
Stars: ✭ 35 (-33.96%)
Mutual labels:  opencv-python
ACVR2017
An Innovative Salient Object Detection Using Center-Dark Channel Prior
Stars: ✭ 20 (-62.26%)
Mutual labels:  object-tracking
visualize-voc-format-data
A simple utility programe to visualize pascal voc (format) dataset images with bounding boxes. Useful to check whether there is any error in forming annotation files.
Stars: ✭ 23 (-56.6%)
Mutual labels:  opencv-python
multi object tracker
An optical flow and Kalman Filter based tracker
Stars: ✭ 31 (-41.51%)
Mutual labels:  object-tracking
PeekingDuck
A modular framework built to simplify Computer Vision inference workloads.
Stars: ✭ 143 (+169.81%)
Mutual labels:  object-tracking
CSA
Official implementation of CVPR2020 Paper "Cooling-Shrinking Attack"
Stars: ✭ 48 (-9.43%)
Mutual labels:  object-tracking
Obstacle-Detection-and-Path-Planning
Processing an Image to find obstacles and the minimum path between two similar objects using OpenCV.
Stars: ✭ 61 (+15.09%)
Mutual labels:  opencv-python
camera-live-streaming
Camera Live Streaming with Flask and Open-CV
Stars: ✭ 69 (+30.19%)
Mutual labels:  opencv-python
flask-ocr
use flask and tesseract to have a basic ocr, also you need opencv2, this code use opencv2 to have a basic image process
Stars: ✭ 27 (-49.06%)
Mutual labels:  opencv-python
Siammask
[CVPR2019] Fast Online Object Tracking and Segmentation: A Unifying Approach
Stars: ✭ 3,205 (+5947.17%)
Mutual labels:  object-tracking
one-rep-max
To some extent: A ClojureScript app for tracking workout data. But mostly: Some guy on the internet trying his hand at ClojureScript.
Stars: ✭ 35 (-33.96%)
Mutual labels:  weightlifting
Bitcamp-2019
Won the most innovative solution at Bitcamp 2019.🎖🎉
Stars: ✭ 15 (-71.7%)
Mutual labels:  opencv-python
Yolov5-Deepsort
最新版本yolov5+deepsort目标检测和追踪,能够显示目标类别,支持5.0版本可训练自己数据集
Stars: ✭ 201 (+279.25%)
Mutual labels:  object-tracking
Keras-LSTM-Trajectory-Prediction
A Keras multi-input multi-output LSTM-based RNN for object trajectory forecasting
Stars: ✭ 88 (+66.04%)
Mutual labels:  object-tracking
kernelized correlation filters gpu
Real-time visual object tracking using correlations filters and deep learning
Stars: ✭ 27 (-49.06%)
Mutual labels:  object-tracking
Intrusion Detection
Whenever founds internet connectivity confirms is it you, if not log you off and send you image of intruder.
Stars: ✭ 24 (-54.72%)
Mutual labels:  opencv-python
CV
Computer Vision applications using #Python and #OpenCV
Stars: ✭ 19 (-64.15%)
Mutual labels:  opencv-python
image-segmentation-auto-labels
A service to auto-generate masks for image segmentation
Stars: ✭ 22 (-58.49%)
Mutual labels:  opencv-python
Homography-Based-MOTDT
MOTDT with Homography Matrix for Multi-Object Tracking
Stars: ✭ 21 (-60.38%)
Mutual labels:  object-tracking

VBT-Barbell-Tracker

A proof of concept app to optically track a barbell through its range of motion using OpenCV to give the lifter realtime feedback on concentric avg velocity, cutoff velocity, and displacement for a Velocity Based Training program.

Demo

How it works

The app will detect a solid green area painted on to the end of your barbell. Given the measured diameter of this circle it will determine the pixel per mm scale to calculate distances and velocities of the barbell.

Movement of the barbell is continuously scanned to see if a lift is happening. When it detects a rep, it displays the most commonly referenced VBT metrics and informs you if your lifts are within 0.5-0.75 m/s as well as if they fall below a 20% velocity cutoff. There is an audible signal that is played of your lifts comply or fall outside of the range so you know when to terminate your set without having to keep your eyes on the computer.

The display tells you what rep you're on, the displacement of the bar, the velocity of the concentric part of the lift and whether the art should be terminated.

Once the barbell is at rest for 2 minutes, the counters and path tracking reset. You can also reset it by hand by pressing 'r'

Motivation

  • Optimize workouts by taking meaningful measurements, getting live feedback, and putting in minimum effective effort
  • Autoregulation of load-volume
  • Injury reduction
  • Initial exposure to OpenCV and optical processing
  • Initial exposure to training CNNs
  • Avoid the purchase of a hardware unit like openbarbell, push, etc.

Journey

  • Started off wanting the app to auto-detect a wide variety of barbells in generalized surroundings
  • Spent a week playing with Google Colab and training CNNs to do so. Moderate success, lots of GPU power needed and way too slow for running on CPU only devices
  • Spent time playing with many different tracking models in OpenCV. None were reliable in a variety of scenarios.
  • Realized that tracking a differentiated colour and shape was very fast, didn't require a GPU and was orders of magnitude more reliable than any tracking algorithm. Simple wins with a bit more initial setup, but it was worth it.

VBT

https://www.scienceforsport.com/velocity-based-training

Requirements

  • Python 3.7
  • A webcam or IP camera that supports RTSP
  • Lime Green paper/paint/etc.

Installation

  1. Create a new python 3.7 virtualenv
mkvirtualenv VBT-barbell-tracker
  1. Install python requirements
pip install -r requirements.txt
  1. Generate intrinsic camera values to undistort fisheye/barrel effect Generate intrinsic camera distortion values to remove any barrel/fisheye distortion that your camera may have. You can easily spot this by looking at the outer perimeter of your camera to see if straight lines appear curved.

    a. Using your webcam, take 10 or more snapshots of the chessboard printout. Save the images as .png files. Adhere the printout to a board, so it's very flat. The images should be taken to ensure you cover all areas of your image plane, paying attention to the outer perimeter where most of the distortion will take place. You can find the opencv chessboard image here: https://github.com/opencv/opencv/blob/master/doc/pattern.png

    b. Place these images in the ./images/ directory

    c. Take another image of the area you want to undistort as a test. Save it as test.png and place it in the ./images/ directory.

    d. Run the python undistort_fisheye.py script to discover the intrinsict values. They will be dumped out in a json file called fisheye_calibration_data.json

  2. Place lime green paper/paint/etc. on the end of the barbell that faces the camera, ensuring that it covers the entire face of it. Then, take a measurement of the diameter of the face of the barbell end you covered. Mine comes out to 50mm, so the radius would be 25mm. This is essential to calibrating the distance scale within the app. You can use any colour you want, but you will have to adjust parameters accordingly. The idea here is to use a colour that is highly differentiated from anything being captured in your surroundings or your clothing.

Usage

workon VBT-barbell-tracker

Running it on a video

python vbt_barbell_tracker.py --video press.mp4

Running it with your webcam

python VBT-barbell-tracker.py

Running it on a RTSP stream

python VBT-barbell-tracker.py --video 'rtsp://USER:[email protected]?tcp'

Hotkeys

r Clear set and reset all counters and bar tracker. This also happens automatically after 2 minutes of no movement.

Roadmap

  • Refactor POC
  • Use QT or simpleGUI to reformulate into a proper app with input/output to adjust parameters on the fly
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].