mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
significantly improved parallel non-local means by using granularity parameter in parallel_for_ loop. Because the algorithm deals with sliding sums, it's essential that each thread has enough work to do, otherwise the algorithm gets higher theoretical complexity and thus there is no speedup comparing to 1-thread code (at best).
This commit is contained in:
@@ -156,3 +156,14 @@ TEST(Photo_White, issue_2646)
|
||||
|
||||
ASSERT_EQ(0, nonWhitePixelsCount);
|
||||
}
|
||||
|
||||
TEST(Photo_Denoising, speed)
|
||||
{
|
||||
string imgname = string(cvtest::TS::ptr()->get_data_path()) + "shared/5MP.png";
|
||||
Mat src = imread(imgname, 0), dst;
|
||||
|
||||
double t = (double)getTickCount();
|
||||
fastNlMeansDenoising(src, dst, 5, 7, 21);
|
||||
t = (double)getTickCount() - t;
|
||||
printf("execution time: %gms\n", t*1000./getTickFrequency());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user