Skip to content

A project utilising openCV, mediapipe and tkinter to create a simple fitness assistant for people currently going through physiotherapy

License

Notifications You must be signed in to change notification settings

Ganeshkharde1/Knee-Therapy-Assistant-Opencv

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Knee-Therapy-Assistant-Opencv

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:

image

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 Screenshot (20) the opening screen

Screenshot (21) output screen, when angle> 140

Screenshot (22) output screen, with angle<140 (notice that the timer has been activated)

Screenshot (26) 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!

About

A project utilising openCV, mediapipe and tkinter to create a simple fitness assistant for people currently going through physiotherapy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%