A project utilising openCV, mediapipe and tkinter to create a simple fitness assistant for people currently going through physiotherapy for Traumatic Arthritis
Overview: The program counts the number of succesful reps done by the user, and then returns some useful stats that help the user with progress tracking But there are some ground rules that need to be set up A 'rep' only counts if: The knee reaches an angle < 140 degrees stays in that position for 8 seconds or more the knee is extended back to an angle> 140 degrees
With this in mind, we have developed the following algorithm How it works: We use mediapipe to create a pose object, which finds 32 unique points, or 'landmarks' on the human body. These landmarks are then used to create vectors to represent the femur and the calf muscle. We use these vectors to find the angle of thr right knee using the cosine formula:
where a and b are femur and calf vectors Now that we have our angle, we can use it to find out if our rep was successful or not. Once the angle reduces to <140 degrees, we activate a timer to keep track of the duration of the rep. Rest of the program works in accordance to the above definition of a rep
I've also used tkinter to make the program more organised the opening screen
output screen, when angle> 140
output screen, with angle<140 (notice that the timer has been activated)
final window, with all relevant information for tracking progress
https://drive.google.com/file/d/1QM8UFQciXxJll5SZaTAhdqO4mg6tzM8r/view here's the reference video. Download it (or maybe try it on other clips too) and the run the code
That's it for now, have a nice day!