findHomography | R Documentation |
findHomography
computes a perspective transformation
between two planes.
findHomography(
from,
to,
from_dim,
to_dim = from_dim,
method = "RANSAC",
ransac_reproj_th = 3,
max_it = 2000,
conf = 0.95
)
from |
A Nx2 matrix indicating the location (x, y) of N points in the source image. |
to |
A Nx2 matrix indicating the location (x, y) of N 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, |
method |
A character string indicating the method used to compute a homography matrix. It can be one of the followings: "LS" (least-square), "RANSAC" (RANSAC-based robust method; the default), "LMEDS" (Least-Median robust method), or "RHO" (PROSAC-based robust method). |
ransac_reproj_th |
Maximum allowed reprojection error to treat a point pair as an inlier (used in the RANSAC and RHO methods only). If 'from' and 'to' are measured in pixels, it usually makes sense to set this parameter somewhere in the range of 1 to 10. |
max_it |
The maximum number of RANSAC iterations. |
conf |
Confidence level, between 0 and 1. |
A 3x3 homography matrix.
Simon Garnier, garnier@njit.edu
getPerspectiveTransform
, getAffineTransform
,
warpPerspective
src <- cbind(x = c(0, 1, 1, 0), y = c(0, 0, 1, 1))
dst <- src + 1
findHomography(src, dst, c(10, 10))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.