Given an object of class "tracklets", this function append some information (attribute) about tracking processing to the tracklets object. This can be especially useful for further use in other function of the MoveR package. Indeed the functions will automatically try to retrieve these informations without specifying it as argument.
Usage
setInfo(trackDat, frameR = NULL, scale = NULL, imgRes = c(NULL, NULL))
Arguments
- trackDat
An object of class "tracklets" containing a list of tracklets and their characteristics classically used for further computations (at least x.pos, y.pos, frame).
- frameR
A numeric value expressed in frames per second, the frequency at which frames are recorded/displayed in the video.
- scale
A ratio corresponding to the scaling factor to be applied to the trajectory coordinates (e.g., size in cm / size in pixels, default = 1).
- imgRes
A vector of 2 numeric values, the resolution of the video used as x and y limit of the plot (i.e., the number of pixels in image width and height).
Value
An object of class "tracklets" with the selected information (attribute) appended as attributes.
See also
trackletsClass
getinfo
Examples
if (FALSE) {
# Download the first dataset from the sample data repository
Path2Data <- MoveR::DLsampleData(dataSet = 1, tracker = "TRex")
Path2Data
# Import the data as an object of class "tracklets"
# and flip Y coordinates to start on the bottom-left
Data <- MoveR::readTrex(Path2Data[[1]],
flipY = T,
imgHeight = 2160,
rawDat = F
)
str(Data)
# get the tracking informations from the tracklets object (frameR corresponding to the frame rate is already returned because it is included in TRex output)
getInfo(Data)
# set the image resolution in the tracklets object
Data <- setInfo(Data, imgRes = c(3840, 2160))
# check the result (now the tracklets object contains both information about the frame rate and the image resolution, which can be used in further functions of the MoveR package automatically - without specifying it in function's argument)
getInfo(Data)
}