calibrationParameters: Calibrate coordinates in one reference frame to another.

View source: R/calibrate.R

calibrationParametersR Documentation

Calibrate coordinates in one reference frame to another.

Description

Adapted from some old Python code. This will return a list of 12 parameters that can be used to convert new measuerements in the same coordinate system used in Mcoords to coordinates in the coordinate system used in Tcoords. This is use in some eye-trackers, but can also be used for old fashioned touch screens that sometimes return warped.

Usage

calibrationParameters(Mcoords, Tcoords)

Arguments

Mcoords

A data frame with columns of x and y measurements

Tcoords

A data frame with target coordinates in columns x and y.

Details

Not yet.

Value

Parameter weights for a 12 term linear model.

Examples

data("localization_aligned")
str(localization_aligned)

# let's see if we can convert the touch screen pixels to (centi)meters
train <- localization_aligned[c(1:16),]
test <- localization_aligned[c(17:24),]

trainTaps <- train[,which(names(train) %in% c('tapx_px', 'tapy_px'))]
names(trainTaps) <- c('x','y')

trainHand <- train[,which(names(train) %in% c('handx_m', 'handy_m'))]
names(trainHand) <- c('x','y')

calibrationParameters(trainTaps,trainHand)

thartbm/SMCL documentation built on Oct. 23, 2022, 5:17 a.m.