From 9c19a0cdba3e489b1944392028633ea8430d95eb Mon Sep 17 00:00:00 2001 From: Hao Chen Date: Wed, 14 Aug 2024 16:57:44 +0800 Subject: [PATCH] Reinitialize divider matrix in DivRCPerfTest and DivPerfTest Cases. This patch reinitializes divider matrix without zero values in DivRCPerfTest and DivPerfTest test cases. --- modules/gapi/perf/common/gapi_core_perf_tests_inl.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/gapi/perf/common/gapi_core_perf_tests_inl.hpp b/modules/gapi/perf/common/gapi_core_perf_tests_inl.hpp index 3a777cff3d..c5cf6c0ea9 100644 --- a/modules/gapi/perf/common/gapi_core_perf_tests_inl.hpp +++ b/modules/gapi/perf/common/gapi_core_perf_tests_inl.hpp @@ -438,7 +438,7 @@ PERF_TEST_P_(DivPerfTest, TestPerformance) //This condition need to workaround the #21044 issue in the OpenCV. //It reinitializes divider matrix without zero values for CV_16S DST type. - if (dtype == CV_16S && dtype != type) + if (dtype != type) cv::randu(in_mat2, cv::Scalar::all(1), cv::Scalar::all(255)); // OpenCV code /////////////////////////////////////////////////////////// @@ -530,8 +530,7 @@ PERF_TEST_P_(DivRCPerfTest, TestPerformance) initMatsRandU(type, sz, dtype, false); //This condition need to workaround the #21044 issue in the OpenCV. //It reinitializes divider matrix without zero values for CV_16S DST type. - if (dtype == CV_16S || (type == CV_16S && dtype == -1)) - cv::randu(in_mat1, cv::Scalar::all(1), cv::Scalar::all(255)); + cv::randu(in_mat1, cv::Scalar::all(1), cv::Scalar::all(255)); // OpenCV code /////////////////////////////////////////////////////////// cv::divide(sc, in_mat1, out_mat_ocv, scale, dtype);