Commit 08536943 authored by AsyaPronina's avatar AsyaPronina Committed by Alexander Alekhin

Merge pull request #12949 from AsyaPronina:missed_multiply_operator_for_GMAT

Made scale parameter optional for mul kernel wrapper (#12949)

* Added missed operator*(GMat, GMat). Made scale parameter optional for mul kernel.

* Fixed perf test for mul(GMat, GMat) kernel

* Removed operator*(GMat, GMat) as not needed
parent 6e3ea8b4
...@@ -581,7 +581,7 @@ Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref ...@@ -581,7 +581,7 @@ Supported matrix data types are @ref CV_8UC1, @ref CV_8UC3, @ref CV_16UC1, @ref
@param ddepth optional depth of the output matrix. @param ddepth optional depth of the output matrix.
@sa add, sub, div, addWeighted @sa add, sub, div, addWeighted
*/ */
GAPI_EXPORTS GMat mul(const GMat& src1, const GMat& src2, double scale, int ddepth = -1); GAPI_EXPORTS GMat mul(const GMat& src1, const GMat& src2, double scale = 1.0, int ddepth = -1);
/** @brief Multiplies matrix by scalar. /** @brief Multiplies matrix by scalar.
......
...@@ -201,11 +201,11 @@ PERF_TEST_P_(MulPerfTest, TestPerformance) ...@@ -201,11 +201,11 @@ PERF_TEST_P_(MulPerfTest, TestPerformance)
initMatsRandU(type, sz, dtype, false); initMatsRandU(type, sz, dtype, false);
// OpenCV code /////////////////////////////////////////////////////////// // OpenCV code ///////////////////////////////////////////////////////////
cv::multiply(in_mat1, in_mat2, out_mat_ocv, dtype); cv::multiply(in_mat1, in_mat2, out_mat_ocv, 1.0, dtype);
// G-API code //////////////////////////////////////////////////////////// // G-API code ////////////////////////////////////////////////////////////
cv::GMat in1, in2, out; cv::GMat in1, in2, out;
out = cv::gapi::mul(in1, in2, dtype); out = cv::gapi::mul(in1, in2, 1.0, dtype);
cv::GComputation c(GIn(in1, in2), GOut(out)); cv::GComputation c(GIn(in1, in2), GOut(out));
// Warm-up graph engine: // Warm-up graph engine:
......
...@@ -149,11 +149,11 @@ g_api_ocv_pair_mat_mat opPlusM = {std::string{"operator+"}, ...@@ -149,11 +149,11 @@ g_api_ocv_pair_mat_mat opPlusM = {std::string{"operator+"},
[](cv::GMat in1,cv::GMat in2){return in1+in2;}, [](cv::GMat in1,cv::GMat in2){return in1+in2;},
[](const cv::Mat& in1, const cv::Mat& in2, cv::Mat& out){cv::add(in1, in2, out);}}; [](const cv::Mat& in1, const cv::Mat& in2, cv::Mat& out){cv::add(in1, in2, out);}};
g_api_ocv_pair_mat_mat opMinusM = {std::string{"operator-"}, g_api_ocv_pair_mat_mat opMinusM = {std::string{"operator-"},
[](cv::GMat in,cv::GMat c){return in-c;}, [](cv::GMat in,cv::GMat in2){return in-in2;},
[](const cv::Mat& in, const cv::Mat& c, cv::Mat& out){cv::subtract(in, c, out);}}; [](const cv::Mat& in, const cv::Mat& in2, cv::Mat& out){cv::subtract(in, in2, out);}};
g_api_ocv_pair_mat_mat opDivM = {std::string{"operator/"}, g_api_ocv_pair_mat_mat opDivM = {std::string{"operator/"},
[](cv::GMat in,cv::GMat c){return in/c;}, [](cv::GMat in,cv::GMat in2){return in/in2;},
[](const cv::Mat& in, const cv::Mat& c, cv::Mat& out){cv::divide(in, c, out);}}; [](const cv::Mat& in, const cv::Mat& in2, cv::Mat& out){cv::divide(in, in2, out);}};
g_api_ocv_pair_mat_mat opGreater = {std::string{"operator>"}, g_api_ocv_pair_mat_mat opGreater = {std::string{"operator>"},
[](cv::GMat in1,cv::GMat in2){return in1>in2;}, [](cv::GMat in1,cv::GMat in2){return in1>in2;},
[](const cv::Mat& in1, const cv::Mat& in2, cv::Mat& out){cv::compare(in1, in2, out, cv::CMP_GT);}}; [](const cv::Mat& in1, const cv::Mat& in2, cv::Mat& out){cv::compare(in1, in2, out, cv::CMP_GT);}};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment