This page uses cookies. For details and possible settings refer to our Privacy Policy.
Continuing to use this page means accepting the processing of cookie files.

Accept (hide info)
POL ENG GER 中文

You are here: Start » Filter Reference » Geometric Image Transformations » cvGetPerspectiveTransform

cvGetPerspectiveTransform

Calculates the perspective transform from four pairs of corresponding points.

Name Type Range Description
inSrc Point2DArray Coordinates of quadrangle vertices in the source image.
inDst Point2DArray Coordinates of the corresponding quadrangle vertices in the destination image.
outM Matrix Calculated transformation matrix.

Description

The function calculates the 3x3 matrix of perspective transform, that can be applied to an image using cvWarpPerspective filter.

Examples

The sets of corresponding points drawn on images. Such sets mean that after transform one wants to have points specified in first set transformed to points in second set.

Result of applying output matrix of cvGetPerspectiveTransform with input sets of points shown on images above to sample image using cvWarpPerspective. The cvWarpPerspective filter was used with inDWidth = 300, inDHeight = 300, inBorderMode = BORDER_CONSTANT and inInterpolation = INTER_CUBIC.

Errors

Each of input array must contain four points in cvGetAffineTransform

User Proficiency Level

Basic

See Also

cvGetAffineTransform, cvWarpAffine, cvWarpPerspective