[−][src]Function opencv::core::perspective_transform
pub fn perspective_transform(
src: &dyn ToInputArray,
dst: &mut dyn ToOutputArray,
m: &dyn ToInputArray
) -> Result<()>
Performs the perspective matrix transformation of vectors.
The function cv::perspectiveTransform transforms every element of src by treating it as a 2D or 3D vector, in the following way: where and
Here a 3D vector transformation is shown. In case of a 2D vector transformation, the z component is omitted.
Note: The function transforms a sparse set of 2D or 3D vectors. If you want to transform an image using perspective transformation, use warpPerspective . If you have an inverse problem, that is, you want to compute the most probable perspective transformation out of several pairs of corresponding points, you can use getPerspectiveTransform or findHomography .
Parameters
- src: input two-channel or three-channel floating-point array; each element is a 2D/3D vector to be transformed.
- dst: output array of the same size and type as src.
- m: 3x3 or 4x4 floating-point transformation matrix.
See also
transform, warpPerspective, getPerspectiveTransform, findHomography