PosturePerfection
|
This is a project completed as part of the 5th Year Engineering course, Real Time Embedded Programming, at The University of Glasgow.
Code documentation can be found here, however more general information regarding the project can be found on our website.
The project is separated into three main sections, each with a unique function.
The system is broken down into various stages to allow us to make use of multithreading such that when one stage is processing one frame, another can simultaneously operate on an entirely different frame. In this way, a pipeline is created, with ordering only essential during the PostProcessing stage which applies IIR filtering to smoothen the output.
The Pipeline at the core of the system is configurable to run with a various number of threads. Initial testing indicated optimal performance at 8 threads, and so this is currently in use within the pipeline. The pipeline consists of the following key stages:
The FrameGenerator runs in a single thread, ensuring that frames are continually captured from the OpenCV camera input at regular intervals defined by the user set frame rate. A timer is used to capture the frames used at regular intervals, making use of the CppTimer
wrapper developed here.
The PreProcessor and InferenceCore run in a single thread, of which 8 are run simulataneously by default. When one of these threads is ready, the latest frame captured from the FrameGenerator is passed through these two stages. By making use of this threading approach, a more performant system is achieved than if threading was not used.
The PostProcessor and PostureEstimator run in another thread. Ordering is essential for IIR filtering, and therefore throughout these different stages a unique ID is incremented and passed with each frame. Upon reaching the PostProcessor stage, IIR filtering is applied using the frames in order, before running posture estimation. Finally, using the results of posture estimation, a rendering of the user's posture is overlayed on the image itself. Note that for the scope of this project, a decision was made to use only the upper body joints of the user's posture as these are the most likely to be visible when the user places their camera side on and are the joints which contribute most significantly to a user's posture. However, extension to use the lower body joints is straightforward should this be desired in the future.
GUI
indicates to the user that they have not yet initialised an "Ideal Posture".The image and the resulting PoseStatus are then passed to the Graphical User Interface.
The GUI is responsible for user interaction and displaying a live feed of the user's posture. Processing itself is completed within the Pipeline, with the PostureEstimating::PostureEstimator
responsible for continually passing a PoseStatus
to the GUI indicating if a good posture is currently being adopted, and any computed changes which would improve the user's posture.
A Notification System has been developed to allow an alert to be sent to a separate device when then system detects a poor posture. In this way, although the PosturePerfection system will be placed at the side of the user to analyse their posture profile, an alert can be sent to their laptop device which they are working on so that they are immediately notified of their poor posture.