ov_get_court_ref: Define the reference points on a court image

View source: R/transformation.R

ov_get_court_refR Documentation

Define the reference points on a court image

Description

This function is used to define the reference points on a court image, to be used with ov_transform_points(). The court coordinate system is that used in datavolley::dv_court(), datavolley::ggcourt(), and related functions. Try ⁠plot(c(0, 4), c(0, 7), type = "n", asp = 1); datavolley::dv_court()⁠ or ggplot2::ggplot() + datavolley::ggcourt() + ggplot2::theme_bw() for a visual depiction.

Usage

ov_get_court_ref(image_file, video_file, t = 60, type = "corners")

Arguments

image_file

string: path to an image file (jpg) containing the court image (not required if video_file is supplied)

video_file

string: path to a video file from which to extract the court image (not required if image_file is supplied)

t

numeric: the time of the video frame to use as the court image (not required if image_file is supplied)

type

string: currently only "corners"

Value

A data.frame containing the reference information

See Also

ov_transform_points(), datavolley::dv_court(), datavolley::ggcourt()

Examples

if (interactive()) {
  crt <- ov_get_court_ref(image_file = system.file("extdata/2019_03_01-KATS-BEDS-court.jpg",
                          package = "ovideo"))

}

openvolley/ovideo documentation built on March 19, 2024, 9:52 p.m.