file_velocity: Compute velocity for CSV file generated by create_csv(),...

View source: R/file_velocity.R

file_velocityR Documentation

Compute velocity for CSV file generated by create_csv(), using velocity_x() and velocity_y()

Description

A wrapper for the OpenPoseR functions velocity_x() and velocity_y() that makes it possible to directly pass a file name and or path including a file name to the function. Will create two CSV files with the infixes "velocity_x" and "velocity_y" in the given input directory as its output.

Can be used to call velocity_x() and velocity_y() for a CSV file (*.csv) created using the create_csv() function and (optinally but recommend) cleaned with either clean_data() or file_clean() without manually loading the data from the file into R first.

Usage

file_velocity(file, model, fps = 25)

Arguments

file

Name of CSV file (*.csv) or path to file including filename.

model

Specify which tracking model generated the data. Supply either body25, hands, or face. If no model is supplied the model will be guessed on the basis of the CSV file name provided (the file name contains model information when created using create_csv() from this package).

fps

Optional. Frames per second of original video file used for tracking. Defaults to 25.

Examples

# Compute velocity for file "~/myvideo/myvideo_body25.csv"
file_velocity("~/myvideo/myvideo_body25_cleaned.csv")

# Compute velocity for file "~/myvideo/myvideo.csv" and manually specify model
file_velocity("~/myvideo/myvideo_cleaned.csv", model = "body25")

trettenbrein/OpenPoseR documentation built on April 22, 2022, 4:03 a.m.