mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 15:53:03 +04:00
Merge pull request #13070 from elatkin:el/gapi_perf_sobel
GAPI (fluid): optimization of Sobel 3x3 (#13070) * GAPI: performance test for Sobel * GAPI: performance test for Sobel w/FP32 input * GAPI: Sobel speedup: 2.5x (U8) up to 10x (float) * GAPI: Sobel 3x3 to support U8 into S16 * GAPI (fluid): Sobel 3x3 speedup: 10% (uchar), 1.5x (float) * GAPI (fluid): Sobel 3x3 speedup: +10x (uchar), but -20% (float) * GAPI (fluid): Sobel 3x3 speedup: +10% (float) * GAPI (fluid): Sobel 3x3 speedup: +15% (float), +10% (uchar) * GAPI (fluid): Sobel 3x3: address GCC warnings * GAPI (fluid): Sobel 3x3: separate *.cpp file w/SIMD code * GAPI (fluid): Sobel 3x3: fixed AVX2 code, AVX2 speedup 20-50% (uchar), 10-20% (float) * GAPI (fluid): Sobel 3x3: fix CV_SIMD code for AVX2 * GAPI (fluid): Sobel 3x3: refactor
This commit is contained in:
committed by
Alexander Alekhin
parent
a456b968cf
commit
4e40e5bb88
@@ -476,7 +476,7 @@ PERF_TEST_P_(SobelPerfTest, TestPerformance)
|
||||
|
||||
// G-API code //////////////////////////////////////////////////////////////
|
||||
cv::GMat in;
|
||||
auto out = cv::gapi::Sobel(in, dtype, dx, dy, kernSize );
|
||||
auto out = cv::gapi::Sobel(in, dtype, dx, dy, kernSize);
|
||||
cv::GComputation c(in, out);
|
||||
|
||||
// Warm-up graph engine:
|
||||
@@ -484,7 +484,7 @@ PERF_TEST_P_(SobelPerfTest, TestPerformance)
|
||||
|
||||
TEST_CYCLE()
|
||||
{
|
||||
c.apply(in_mat1, out_mat_gapi, std::move(compile_args));
|
||||
c.apply(in_mat1, out_mat_gapi);
|
||||
}
|
||||
|
||||
// Comparison //////////////////////////////////////////////////////////////
|
||||
@@ -494,7 +494,6 @@ PERF_TEST_P_(SobelPerfTest, TestPerformance)
|
||||
}
|
||||
|
||||
SANITY_CHECK_NOTHING();
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -31,8 +31,6 @@ INSTANTIATE_TEST_CASE_P(SepFilterPerfTestCPU_other, SepFilterPerfTest,
|
||||
Values(-1, CV_32F),
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(Filter2DPerfTestCPU, Filter2DPerfTest,
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
@@ -109,10 +107,20 @@ INSTANTIATE_TEST_CASE_P(Dilate3x3PerfTestCPU, Dilate3x3PerfTest,
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SobelPerfTestCPU, SobelPerfTest,
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||
Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1),
|
||||
Values(3, 5),
|
||||
Values(szVGA, sz720p, sz1080p),
|
||||
Values(-1, CV_32F),
|
||||
Values(-1, CV_16S, CV_32F),
|
||||
Values(0, 1),
|
||||
Values(1, 2),
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SobelPerfTestCPU32F, SobelPerfTest,
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(CV_32FC1),
|
||||
Values(3, 5),
|
||||
Values(szVGA, sz720p, sz1080p),
|
||||
Values(CV_32F),
|
||||
Values(0, 1),
|
||||
Values(1, 2),
|
||||
Values(cv::compile_args(IMGPROC_CPU))));
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
// This file is part of OpenCV project.
|
||||
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||
// of this distribution and at http://opencv.org/license.html.
|
||||
//
|
||||
// Copyright (C) 2018 Intel Corporation
|
||||
|
||||
|
||||
#include "../perf_precomp.hpp"
|
||||
#include "../common/gapi_imgproc_perf_tests.hpp"
|
||||
#include "../../src/backends/fluid/gfluidimgproc.hpp"
|
||||
|
||||
|
||||
#define IMGPROC_FLUID cv::gapi::imgproc::fluid::kernels()
|
||||
|
||||
namespace opencv_test
|
||||
{
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SobelPerfTestFluid, SobelPerfTest,
|
||||
Combine(Values(AbsExact().to_compare_f()),
|
||||
Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16SC1), // add CV_32FC1 when ready
|
||||
Values(3), // add 5x5 once supported
|
||||
Values(szVGA, sz720p, sz1080p),
|
||||
Values(-1, CV_16S, CV_32F),
|
||||
Values(0, 1),
|
||||
Values(1, 2),
|
||||
Values(cv::compile_args(IMGPROC_FLUID))));
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(SobelPerfTestFluid32F, SobelPerfTest,
|
||||
Combine(Values(AbsToleranceSobel(1e-3).to_compare_f()),
|
||||
Values(CV_32FC1),
|
||||
Values(3), // add 5x5 once supported
|
||||
Values(szVGA, sz720p, sz1080p),
|
||||
Values(CV_32F),
|
||||
Values(0, 1),
|
||||
Values(1, 2),
|
||||
Values(cv::compile_args(IMGPROC_FLUID))));
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user