calc_animal_pos: Calculate animal position

View source: R/calc_animal_pos.R

calc_animal_posR Documentation

Calculate animal position

Description

Calculates the position of animal relative to a camera based on image pixel positions and site calibration models.

Usage

calc_animal_pos(
  animal_pos,
  calib_models,
  dep_tag = "deploymentID",
  sequence_id = "sequenceID",
  x = "x",
  y = "y",
  image_width = "imageWidth",
  image_height = "imageHeight"
)

Arguments

animal_pos

Data frame (tibble) of animal position digitization data. It must contain (at least) the columns defined in args dep_tag, sequence_id, x, y, image_width and image_height.

calib_models

Named list of deployment calibration models or site calibration models (calibs objects), produced using cal.site() (not yet included in this package). The deployment names are used as names.

dep_tag

Column in animal_pos against which names of the elements can be matched to apply the right deployment calibration models. Default: "deploymentID".

sequence_id

Column in animal_pos containing the sequence ID the images belong to. Default: "sequenceID".

x

Column in animal_pos containing x pixel positions for each digitised point. Default: "x".

y

Column in animal_pos containing y pixel positions for each digitised point. Default: "y".

image_width

Column in animal_pos containing the pixel x dimension of each image. Default: "imageWidth". Notice that the pixel x dimension must be consistent for each deployment.

image_height

Column in animal_pos containing the pixel y dimension of each image. Default: "imageHeight". Notice that the pixel y dimension must be consistent for each deployment.

Value

Original tibble data frame as passed via animal_pos with additional columns:

  • radius: Radial distance from camera.

  • angle: Angular distance from camera.

  • frame_count: Indicator of the frame order within each sequence.

Examples

# Use default values
calc_animal_pos(animal_positions, dep_calib_models)

inbo/camtraptor documentation built on June 2, 2025, 5:17 a.m.