1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

imgproc: optimize tiled parallel filter with TLS buffers and custom border fill

This commit is contained in:
Ismail
2026-04-24 09:22:35 +02:00
parent a5295015b2
commit d16f2bfef2
9 changed files with 472 additions and 32 deletions
+42
View File
@@ -97,4 +97,46 @@ PERF_TEST_P( Image_KernelSize, GaborFilter2d,
SANITY_CHECK(filteredImage, 1e-6, ERROR_RELATIVE);
}
// Performance test for the tiled parallel FilterEngine path (images >= 1MP).
// Exercises filter2D and sepFilter2D separately across common types and border modes.
typedef TestBaseWithParam< tuple<Size, int, BorderMode, bool> > ImgProc_ParallelFilter_Perf;
PERF_TEST_P( ImgProc_ParallelFilter_Perf, filter2D_parallel,
Combine(
Values( Size(1280, 1024), sz1080p ),
Values( CV_8UC1, CV_8UC3, CV_32FC1 ),
Values( BORDER_DEFAULT, BORDER_CONSTANT ),
Values( false, true ) // false = filter2D, true = sepFilter2D
)
)
{
const Size sz = get<0>(GetParam());
const int type = get<1>(GetParam());
const int borderMode = get<2>(GetParam());
const bool isSep = get<3>(GetParam());
Mat src(sz, type);
Mat dst(sz, type);
declare.in(src, WARMUP_RNG).out(dst);
if (isSep)
{
Mat kx = (Mat_<float>(1, 3) << 0.25f, 0.5f, 0.25f);
Mat ky = (Mat_<float>(3, 1) << 0.25f, 0.5f, 0.25f);
TEST_CYCLE() cv::sepFilter2D(src, dst, -1, kx, ky,
Point(-1, -1), 0, borderMode);
}
else
{
Mat kernel = (Mat_<float>(3, 3) <<
1/16.f, 2/16.f, 1/16.f,
2/16.f, 4/16.f, 2/16.f,
1/16.f, 2/16.f, 1/16.f);
TEST_CYCLE() cv::filter2D(src, dst, -1, kernel,
Point(-1, -1), 0, borderMode);
}
SANITY_CHECK_NOTHING();
}
} // namespace