Learn R Programming

Rvision (version 0.4.2)

getPerspectiveTransform: Perspective Transform

Description

getPerspectiveTransform computes the matrix of a perspective transform from 4 pairs of corresponding points.

Usage

getPerspectiveTransform(from, to)

Arguments

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.

Value

A 3x3 matrix.

See Also

warpPerspective

Examples

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataLab