Merge pull request #16841 from TolyaTalamanov:at/warp-perspective

G-API: Implement WarpPerspective

* Implement WarpPerspective kernel

* Fix comment to review
This commit is contained in:
Anatoliy Talamanov
2020-03-25 14:23:32 +03:00
committed by GitHub
parent b0563ce368
commit c303aaa94d
6 changed files with 93 additions and 3 deletions
+6
View File
@@ -371,6 +371,12 @@ GMat normalize(const GMat& _src, double a, double b,
return core::GNormalize::on(_src, a, b, norm_type, ddepth);
}
GMat warpPerspective(const GMat& src, const Mat& M, const Size& dsize, int flags,
int borderMode, const Scalar& borderValue)
{
return core::GWarpPerspective::on(src, M, dsize, flags, borderMode, borderValue);
}
GMat warpAffine(const GMat& src, const Mat& M, const Size& dsize, int flags,
int borderMode, const Scalar& borderValue)
{
@@ -558,6 +558,15 @@ GAPI_OCV_KERNEL(GCPUNormalize, cv::gapi::core::GNormalize)
}
};
GAPI_OCV_KERNEL(GCPUWarpPerspective, cv::gapi::core::GWarpPerspective)
{
static void run(const cv::Mat& src, const cv::Mat& M, const cv::Size& dsize,
int flags, int borderMode, const cv::Scalar& borderValue, cv::Mat& out)
{
cv::warpPerspective(src, out, M, dsize, flags, borderMode, borderValue);
}
};
GAPI_OCV_KERNEL(GCPUWarpAffine, cv::gapi::core::GWarpAffine)
{
static void run(const cv::Mat& src, const cv::Mat& M, const cv::Size& dsize,
@@ -636,6 +645,7 @@ cv::gapi::GKernelPackage cv::gapi::core::cpu::kernels()
, GCPUConvertTo
, GCPUSqrt
, GCPUNormalize
, GCPUWarpPerspective
, GCPUWarpAffine
>();
return pkg;