【OpenCv 学习ing】warpPerspective用法
2014-10-27 16:47
337 查看
文档说明:
Applies a perspective transformation to an image.
C++: void warpPerspective(InputArray src,
OutputArray dst, InputArray M, Size dsize, int flags=INTER_LINEAR, intborderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar())
Python: cv2.warpPerspective(src,
M, dsize[, dst[, flags[, borderMode[, borderValue]]]]) →
dst
C: void cvWarpPerspective(const
CvArr* src, CvArr* dst, const CvMat* mapMatrix, int flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, CvScalar fillval=cvScalarAll(0) )
Python: cv.WarpPerspective(src,
dst, mapMatrix, flags=CV_INNER_LINEAR+CV_WARP_FILL_OUTLIERS, fillval=(0, 0, 0, 0)) → None
The function warpPerspective transforms the source image using the specified matrix:
![](http://www.opencv.org.cn/opencvdoc/2.3.2/html/_images/math/4d8aae9979b955d5a94ac070827113377c052a5a.png)
when the flag WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with invert() and
then put in the formula above instead of M . The function cannot operate in-place.
===========================译:=================================================
功能: 对图像进行透视变换。
参数:
src 输入图像
dst 目标图像
map_matrix 3*3变换矩阵
flags CV_INTER_LINEAR 填充所有目标图像的像素,如果部分图像落在边界外,那么它们的值将被设定为fillval
CV_WARP_FILL_OUTLIERS 指定map_matrix是目标图像的输入图像的反变换
fillval 用于填充边界之外的像素的值
Applies a perspective transformation to an image.
C++: void warpPerspective(InputArray src,
OutputArray dst, InputArray M, Size dsize, int flags=INTER_LINEAR, intborderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar())
Python: cv2.warpPerspective(src,
M, dsize[, dst[, flags[, borderMode[, borderValue]]]]) →
dst
C: void cvWarpPerspective(const
CvArr* src, CvArr* dst, const CvMat* mapMatrix, int flags=CV_INTER_LINEAR+CV_WARP_FILL_OUTLIERS, CvScalar fillval=cvScalarAll(0) )
Python: cv.WarpPerspective(src,
dst, mapMatrix, flags=CV_INNER_LINEAR+CV_WARP_FILL_OUTLIERS, fillval=(0, 0, 0, 0)) → None
Parameters: | src – Source image. dst – Destination image that has the size dsize and the same type as src . M – ![]() transformation matrix. dsize – Size of the destination image. flags – Combination of interpolation methods (see resize() ) and the optional flag WARP_INVERSE_MAP that means that Mis the inverse transformation ( ![]() ). borderMode – Pixel extrapolation method (see borderInterpolate() ). When borderMode=BORDER_TRANSPARENT , it means that the pixels in the destination image that corresponds to the “outliers” in the source image are not modified by the function. borderValue – Value used in case of a constant border. By default, it is 0. |
---|
![](http://www.opencv.org.cn/opencvdoc/2.3.2/html/_images/math/4d8aae9979b955d5a94ac070827113377c052a5a.png)
when the flag WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with invert() and
then put in the formula above instead of M . The function cannot operate in-place.
===========================译:=================================================
功能: 对图像进行透视变换。
参数:
src 输入图像
dst 目标图像
map_matrix 3*3变换矩阵
flags CV_INTER_LINEAR 填充所有目标图像的像素,如果部分图像落在边界外,那么它们的值将被设定为fillval
CV_WARP_FILL_OUTLIERS 指定map_matrix是目标图像的输入图像的反变换
fillval 用于填充边界之外的像素的值
相关文章推荐
- 基础学习笔记之opencv(20):OpenCV中的颜色空间(ing...)
- 继续探索OpenCV[学习ing]
- 如何实现交互式的图像处理(学习ing)?
- 好好学习ing..
- Disuz!!NT 2.0开源啦!!学习ing!
- Opencv学习之鼠标响应及画图操作
- sizeof ( )——在学习openCV中 create matrix 时发现的问题
- OpenCV学习之图像处理[1]
- OpenCV学习笔记(一)
- opencv学习01
- 网上学习资料网址集合(随时整理ing)
- 2007年学习计划ING
- 学习opencv读写视频流的一些体会
- javaDB学习ing
- Delphi中的线程类(学习ing)
- sniffer pro学习小记(更新ing)
- 面向对象的设计模式的学习笔记,不断学习归纳总结ing
- 关于DWR中WebContextFactory的测试(学习中ing~~~~)
- OpenCV学习笔记(一)
- OpenCV中滤波器学习笔记(一)--CvSepFilter