generate.map.affine: Generate a map function

generate.map.affineR Documentation

Generate a map function

Description

Given two sets of points (2D) this function will create a rigid transformation function that minimized the rmse of the two points sets. Because we use the backward transformation function for image warping, we need to compute the forward transformation function for pixel coordinate warping. If set1 is (x, y) and set2 is the target (x', y') point set, we want to find the backward transformation function M(x', y') -> (x, y). The forward transformation will be the inverse of M, i.e. M^-1(x, y) -> (x', y'). The iterative closest point algorithm used to find the best rigid transformation function may not find the best solution if the image is reflected. For this reason we calculate the transofmration function for all different combinations of reflections and select the function with the lowest rmse between the aligned set and reference set.

Usage

generate.map.affine(tr, forward = FALSE)

Arguments

tr

results obtained with find.optimal.transform

forward

Should the forward transformation be computed?

Value

A transformation function that takes x and y coordinates as input and outputs a list of warped x, y coordinates


jbergenstrahle/STUtility documentation built on March 14, 2023, 7:15 a.m.