makeMotionMovie: Make a movie out of motion data

Description Usage Arguments References Examples

View source: R/makeMotionMovie.R

Description

Use the animation and scatterplot3d packages to output a gif or a mp4 movie out of the motion data extracted from the AFS/AMC files. For gifs need to install ImageMagick, for mp4s need ffmpeg, see the animation package for details. Note this function will create a new gif/mp4 file in your working directory.

Usage

1
2
3
4
5
makeMotionMovie(asf, amc, xyz, movieType = "gif", framesPerSecond = 120,
  skipNFrames = 1, fileName = "motion", imgName = "motion",
  rotateMotion = FALSE, viewAngle = 40, nSkeletons = 1,
  sdExtraSkeleton = 80, twoSkeletons = FALSE, amc2 = NULL, xyz2 = NULL,
  ...)

Arguments

asf

ASF object read with readASF()

amc

AMC object read with readAMC()

xyz

the xyz list object obtained with getMotionData()

movieType

type of video, "gif" or "mp4", defaults to "gif"

framesPerSecond

no. of frames per second, defaults to 120

skipNFrames

size of frames step to skip, defaults to 1, i.e. no skipping. This parameter is useful when there are many frames and the gif can fail simply because the command is too long, e.g. in the "lambada" example, we input 4 here

fileName

name for the output file, defaults to "motion"

imgName

the animation's img.name parameter, defaults to "motion"

rotateMotion

a boolean indicating whether to rotate the skeleton in motion, defaults to FALSE

viewAngle

the scatterplot3d's angle parameter, defaults to 40

nSkeletons

number of skeletons to animate from this motion, defaults to 1, ignored if twoSkeletons is TRUE

sdExtraSkeleton

standard deviation of the position of other skeletons, in case nSkeletons > 1, defaults to 80 (centimeters)

twoSkeletons

a boolean indicating whether a pair of skeletons are entered into the function, defaults to TRUE. If FALSE one must specify amc2 and xyz2

amc2

AMC object of the 2nd skeleton, if twoSkeletons is TRUE

xyz2

xyz list object of the 2nd skeleton, if twoSkeletons is TRUE

...

additional arguments to the scatterplot3d function

References

A blog post describing the package with more examples: http://giorasimchoni.com/2017/08/08/2017-08-08-lambada-the-mocap-package/

The CMU Graphics Lab Motion Capture Database: http://mocap.cs.cmu.edu/

Examples

1
2
3
4
5
6
asfFilePath <- system.file("extdata", "lambada.asf", package = "mocap")
asf <- readASF(asfFilePath)
amcFilePath <- system.file("extdata", "lambada.amc", package = "mocap")
amc <- readAMC(amcFilePath, asf)
xyz <- getMotionData(asf, amc)
makeMotionMovie(asf, amc, xyz, skipNFrames = 4)

gsimchoni/mocap documentation built on May 14, 2019, 11:16 a.m.