Skip to main content
. 2023 Feb 17;11(4):609. doi: 10.3390/healthcare11040609
Algorithm 1: Estimating correct pose
Input:Video, which is converted into frames and fed as images.
Step 1:Feed the input video. Convert it into N frames.
Step 2:Use the real-time multi-person pose estimation in Keras.
Step 3:Extract critical points to estimate posture.
Step 4:Set frame rate as 2 fps and estimate pose for five consecutive frames.
Step 5:Generate an array of 18 key points (p1, p2, …., p18) for each pose with x and y coordinates.
Step 6:Form a dictionary D with these key points. {D} = {p1, p2, p3, ….., p18}
Step 7:Update the confidence values for the key points.
Step 8:Use these key points to detect arms, knees, joints, etc.
Step 9:Test the video frame with the model trained using these key points to estimate the correct posture.
  • Let {Dv} be the dictionary generated by the input video. Let {Da} be the dictionary generated for a particular yoga pose (Yi) specified by the animated image (Ia).

  • Compare {Dv} and {Da}.
    • If {Dv} = {Da} => Yi (Yoga pose recognized) => All connected lines become green.
    • If {Dv} ≠ {Da} => Yi not matched => The connected lines remain white.
  • The user adjusts their pose according to the image until their pose matches with the yoga pose (Yi) specified by the animated image (Ia). [till {Dv} = {Da} situation is satisfied]

Output:Predicting whether the right pose is attained.
Step 10:Stop execution.