Method WarpPerspective
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
WarpPerspective(InputArray, OutputArray, InputArray, Size, InterpolationFlags, BorderTypes, Scalar?, AlgorithmHint)
Applies a perspective transformation to an image.
public static void WarpPerspective(InputArray src, OutputArray dst, InputArray m, Size dsize, InterpolationFlags flags = InterpolationFlags.Linear, BorderTypes borderMode = BorderTypes.Constant, Scalar? borderValue = null, AlgorithmHint hint = AlgorithmHint.Default)
Parameters
srcInputArrayinput image.
dstOutputArrayoutput image that has the size dsize and the same type as src.
mInputArray3x3 transformation matrix.
dsizeSizesize of the output image.
flagsInterpolationFlagscombination of interpolation methods (INTER_LINEAR or INTER_NEAREST) and the optional flag WARP_INVERSE_MAP, that sets M as the inverse transformation (dst -> src).
borderModeBorderTypespixel extrapolation method (BORDER_CONSTANT or BORDER_REPLICATE).
borderValueScalar?value used in case of a constant border; by default, it equals 0.
hintAlgorithmHintHint that selects between alternative algorithm implementations (OpenCV 5).
WarpPerspective(InputArray, OutputArray, float[,], Size, InterpolationFlags, BorderTypes, Scalar?, AlgorithmHint)
Applies a perspective transformation to an image.
public static void WarpPerspective(InputArray src, OutputArray dst, float[,] m, Size dsize, InterpolationFlags flags = InterpolationFlags.Linear, BorderTypes borderMode = BorderTypes.Constant, Scalar? borderValue = null, AlgorithmHint hint = AlgorithmHint.Default)
Parameters
srcInputArrayinput image.
dstOutputArrayoutput image that has the size dsize and the same type as src.
mfloat[,]3x3 transformation matrix.
dsizeSizesize of the output image.
flagsInterpolationFlagscombination of interpolation methods (INTER_LINEAR or INTER_NEAREST) and the optional flag WARP_INVERSE_MAP, that sets M as the inverse transformation (dst -> src).
borderModeBorderTypespixel extrapolation method (BORDER_CONSTANT or BORDER_REPLICATE).
borderValueScalar?value used in case of a constant border; by default, it equals 0.
hintAlgorithmHintHint that selects between alternative algorithm implementations (OpenCV 5).