Mirrored from upstream: opencv#28253
Original author: @soemay · created 2025-12-19T18:52:24Z
Upstream labels: bug, optimization, category: imgproc
Selection: mirrored by mirror-issues.py
System Information
Tested with OpenCV 4.11, 4.12 (official windows packages)
Windows 11 (64-Bit)
Compiler: MSVC Version 19.44.35222 (Visual Studio 2022)
Tested CPUs: Intel Xeon W-3335, AMD Ryzen 5 3600 (no AVX512, does not show regression)
Detailed description
Observed Timing:
Intel Xeon W-3335
OpenCV 4.11: ~32 ms average
OpenCV 4.12: ~94 ms average
AMD Ryzen 5 3600
OpenCV 4.11: ~32 ms average
OpenCV 4.12: ~30 ms average (reason no AVX512?)
I assume the last changes from opencv#27299 caused this behaviour.
Because if i revert these changes and compile OpenCV 4.12 myself I get the same performance as in OpenCV 4.11.
Steps to reproduce
#include <opencv2/opencv.hpp>
#include <iostream>
#include <opencv2/imgproc.hpp>
int main()
{
cv::Mat randomMat(5000, 5000, CV_8UC1);
cv::randu(randomMat, 0, 256);
const int runs = 100;
cv::TickMeter tm;
tm.start();
for (int i = 0; i < runs; ++i)
{
cv::medianBlur(randomMat, randomMat, 5);
}
tm.stop();
std::cout << "Elapsed time avg: " << tm.getTimeMilli() / runs << " ms" << std::endl;
return 0;
}
Issue submission checklist
System Information
Tested with OpenCV 4.11, 4.12 (official windows packages)
Windows 11 (64-Bit)
Compiler: MSVC Version 19.44.35222 (Visual Studio 2022)
Tested CPUs: Intel Xeon W-3335, AMD Ryzen 5 3600 (no AVX512, does not show regression)
Detailed description
Observed Timing:
Intel Xeon W-3335
OpenCV 4.11: ~32 ms average
OpenCV 4.12: ~94 ms average
AMD Ryzen 5 3600
OpenCV 4.11: ~32 ms average
OpenCV 4.12: ~30 ms average (reason no AVX512?)
I assume the last changes from opencv#27299 caused this behaviour.
Because if i revert these changes and compile OpenCV 4.12 myself I get the same performance as in OpenCV 4.11.
Steps to reproduce
Issue submission checklist