Skip to contents

create an object of class tracklets from a list of tracklets.

Usage

trackletsClass(tracklets)

Arguments

tracklets

A list of data frame containing tracklets information. The presence of x, y coordinates and time column named as x.pos, y.pos and frame is necessary for each tracklets.

Value

An object of class tracklets.

Author

Quentin PETITJEAN

Examples


set.seed(2023)
# generate some dummy tracklets
## start to specify some parameters to generate tracklets
TrackN <- 500 # the number of tracklet to simulate
TrackL <- 1:1000 # the length of the tracklets or a sequence to randomly sample tracklet length

TrackList <- stats::setNames(lapply(lapply(seq(TrackN), function(i)
  trajr::TrajGenerate(sample(TrackL, 1), random = TRUE, fps = 1)), function(j)
    data.frame(
      x.pos = j$x - min(j$x),
      y.pos = j$y - min(j$y),
      frame = j$time
    )), seq(TrackN))
    
 test <- trackletsClass(TrackList)