From 3c814ebf874795391807bced8d49613b7e086560 Mon Sep 17 00:00:00 2001 From: Anna Khakimova Date: Wed, 16 Feb 2022 14:21:14 +0300 Subject: [PATCH] GAPI Perf Tests:Workaround for the OpenCV's issue. --- modules/gapi/perf/common/gapi_core_perf_tests_inl.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 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 ec57aa9..72837da 100644 --- a/modules/gapi/perf/common/gapi_core_perf_tests_inl.hpp +++ b/modules/gapi/perf/common/gapi_core_perf_tests_inl.hpp @@ -436,8 +436,8 @@ PERF_TEST_P_(DivPerfTest, TestPerformance) // FIXIT Unstable input data for divide initMatsRandU(type, sz, dtype, false); - //This condition need to workaround bug in OpenCV. - //It reinitializes divider matrix without zero values. + //This condition need to workaround issue in the OpenCV. + //It reinitializes divider matrix without zero values for CV_16S DST type. if (dtype == CV_16S && dtype != type) cv::randu(in_mat2, cv::Scalar::all(1), cv::Scalar::all(255)); @@ -482,6 +482,11 @@ PERF_TEST_P_(DivCPerfTest, TestPerformance) // FIXIT Unstable input data for divide initMatsRandU(type, sz, dtype, false); + //This condition need as workaround the issue in the OpenCV. + //It reinitializes divider scalar without zero values for CV_16S DST type. + if (dtype == CV_16S || (type == CV_16S && dtype == -1)) + cv::randu(sc, cv::Scalar::all(1), cv::Scalar::all(SHRT_MAX)); + // OpenCV code /////////////////////////////////////////////////////////// cv::divide(in_mat1, sc, out_mat_ocv, scale, dtype); -- 2.7.4