/**
* <p>Applies a perspective transformation to an image.</p>
*
* <p>The function <code>warpPerspective</code> transforms the source image using
* the specified matrix:</p>
*
* <p><em>dst(x,y) = src((M_11 x + M_12 y + M_13)/(M_(31) x + M_32 y +
* M_33),<BR>(M_21 x + M_22 y + M_23)/(M_(31) x + M_32 y + M_33))</em></p>
*
* <p>when the flag <code>WARP_INVERSE_MAP</code> is set. Otherwise, the
* transformation is first inverted with "invert" and then put in the formula
* above instead of <code>M</code>.
* The function cannot operate in-place.</p>
*
* @param src input image.
* @param dst output image that has the size <code>dsize</code> and the same
* type as <code>src</code>.
* @param M <em>3x 3</em> transformation matrix.
* @param dsize size of the output image.
* @param flags combination of interpolation methods (<code>INTER_LINEAR</code>
* or <code>INTER_NEAREST</code>) and the optional flag <code>WARP_INVERSE_MAP</code>,
* that sets <code>M</code> as the inverse transformation (<em>dst->src</em>).
* @param borderMode pixel extrapolation method (<code>BORDER_CONSTANT</code> or
* <code>BORDER_REPLICATE</code>).
* @param borderValue value used in case of a constant border; by default, it
* equals 0.
*
* @see <a href="http://docs.opencv.org/modules/imgproc/doc/geometric_transformations.html#warpperspective">org.opencv.imgproc.Imgproc.warpPerspective</a>
* @see org.opencv.imgproc.Imgproc#warpAffine
* @see org.opencv.imgproc.Imgproc#remap
* @see org.opencv.core.Core#perspectiveTransform
* @see org.opencv.imgproc.Imgproc#getRectSubPix
* @see org.opencv.imgproc.Imgproc#resize
*/
public static void warpPerspective(Mat src, Mat dst, Mat M, Size dsize, int flags, int borderMode, Scalar borderValue)
{
warpPerspective_0(src.nativeObj, dst.nativeObj, M.nativeObj, dsize.width, dsize.height, flags, borderMode, borderValue.val[0], borderValue.val[1], borderValue.val[2], borderValue.val[3]);
return;
}
Imgproc.java 文件源码
java
阅读 24
收藏 0
点赞 0
评论 0
项目:OpenCV_Android_Plus
作者:
评论列表
文章目录