Start » Filter Reference » OpenCV » Geometric Image Transformations » cvWarpPerspective
Module: | OpenCV |
---|
Applies a perspective transformation to an image.
Name | Type | Range | Description | |
---|---|---|---|---|
inSrc | Image | Source image. | ||
inM | Matrix | 3x3 transformation matrix. | ||
inDWidth | Integer | 0 - | Width of destination image. | |
inDHeight | Integer | 0 - | Height of destination image. | |
inInterpolation | CvInterpolationMethod | Interpolation method. | ||
inWarpInverseMap | Bool | True value means that M is the inverse transformation, dst->src. | ||
inBorderMode | CvBorderType | Pixel extrapolation method. | ||
inBorderValue | Pixel* | Value used in case of a constant border. | ||
outDst | Image | Output image. |
Description
WarpPerspective transforms source image using specified inM matrix as follows:
when inWarpInverseMap is true. Otherwise, the transformation is first inverted and then put to formula above instead of inM.
Remarks
The useful transformation matrix may be obtained using cvGetPerspectiveTransform filter.
Errors
This filter can throw an exception to report error. Read how to deal with errors in Error Handling.
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Input transformation matrix must have dimensions 3 x 3 in cvWarpPerspective. |
Complexity Level
This filter is available on Basic Complexity Level.
See Also
- cvGetPerspectiveTransform – Calculates the perspective transform from four pairs of corresponding points.
- cvWarpAffine – Applies an affine transformation to an image.
- cvGetAffineTransform – Calculates the affine transform from 3 corresponding points.