Description Usage Arguments Details
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.
1 | rect_transform(points, x.old, y.old, x.new, y.new)
|
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. |
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.