getPerspectiveTransform | R Documentation |
getPerspectiveTransform
computes the matrix of a perspective
transform from 4 pairs of corresponding points in a source and destination
image.
getPerspectiveTransform(from, to, from_dim, to_dim = from_dim)
from |
A 4x2 matrix indicating the location (x, y) of 4 points in the source image. |
to |
A 4x2 matrix indicating the location (x, y) of 4 points in the
destination image. The order of the points must correspond to the order in
|
from_dim |
A vector which first two elements indicate the number of rows and columns of the source image. |
to_dim |
A vector which first two elements indicate the number of rows
and columns of the destination image. If not specified, |
A 3x3 matrix.
Simon Garnier, garnier@njit.edu
warpPerspective
, findHomography
from <- matrix(c(1, 1, 2, 5, 6, 5, 5, 1), nrow = 4, byrow = TRUE)
to <- matrix(c(1, 1, 1, 5, 5, 5, 5, 1), nrow = 4, byrow = TRUE)
getPerspectiveTransform(from, to, c(1080, 1920), c(1080, 1920))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.