rect_transform: Geometric transform of xy coordinates between arbitrary...

Description Usage Arguments Details

View source: R/trigonometry.R

Description

Function that transformis xy coordinates from any quadrilateral system to any other quadrilateral system. This is a perspective transform, useful for transforming data from a camera perspective to a known coordinate system. x and y should be vectors (of any length) of points that need to be translated. x.old and y.old should give the four corner coordinates of the old quadrilateral, while x.new and y.new do the same for the new quadrilateral. Does not preserves names.

Usage

1
rect_transform(points, x.old, y.old, x.new, y.new)

Arguments

points

Two column matrix with xy coordinates.

x.old

Vector of length four with x coordinates of old quadrilateral.

y.old

Vector of length four with y coordinates of old quadrilateral.

x.new

Vector of length four with x coordinates of new quadrilateral.

y.new

Vector of length four with y coordinates of new quadrilateral.

Details

Strongly inspired by: http://alumni.media.mit.edu/~cwren/interpolator/ Original math from: http://www.robots.ox.ac.uk/~vgg/presentations/bmvc97/criminispaper/planedev.html


Ax3man/trackr documentation built on Oct. 8, 2019, 10:53 p.m.