Skip to main content
. 2024 May 10;24(10):3022. doi: 10.3390/s24103022
Algorithm 1 Motion analysis using OpenPose and DeepLabCut.
  • 1:

    procedure MotionAnalysis(video, outputPath, openPosePath, deepLabCutPath)

  • 2:

        poseData ExtractPoseData(video,openPosePath)

  • 3:

        deepLabCutModel InitializeDeepLabCut(deepLabCutPath)

  • 4:

        for frame in ExtractFrames(video,poseData) do

  • 5:

            keypoints ExtractKeypoints(frame,deepLabCutModel)

  • 6:

            SaveOutput(keypoints,outputPath)

  • 7:

        end for

  • 8:

    end procedure

  • 9:

    function ExtractPoseData(video,openPosePath)   ▹ Deploy OpenPose and filter output

  • 10:

        Process video with OpenPose.

  • 11:

        Parse and filter pose data based on confidence.

  • 12:

        return Filtered pose data.

  • 13:

    end function

  • 14:

    function InitializeDeepLabCut(path)       ▹ Set up and return DeepLabCut model

  • 15:

        Initialize and configure the DeepLabCut model.

  • 16:

        return Initialized model.

  • 17:

    end function

  • 18:

    function ExtractFrames(video,data)        ▹ Return frames of interest for analysis

  • 19:

        Extract frames based on pose data.

  • 20:

        return List of frames.

  • 21:

    end function

  • 22:

    function ExtractKeypoints(frame,model)    ▹ Apply DeepLabCut to extract keypoints

  • 23:

        Annotate frame with keypoints using the model.

  • 24:

        return Annotated keypoints.

  • 25:

    end function

  • 26:

    function SaveOutput(data,path)             ▹ Save data to specified path

  • 27:

        Save data.

  • 28:

    end function