Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCV Denoising is very slow

Require image denoising. Try it with OpenCV and got very bad performance ~30s per image!

try to use:

cv::fastNlMeansDenoising
cv::fastNlMeansDenoisingColored
cv::xphoto::dctDenoising

images : maxsize(1024x1024) colred 3 channel

sample of calling:

Mat src;
cv::imread("myfileName.jpg", src); //assume it's 1024x768 photo
Mat trg(src.size(),src.type());
cv::xphoto::dctDenoising(src,trg,15); // sygma 15 got from algorithm's site as balanced value

All works well but VERY slow.

My configuration:

Lenovo T510, core i7

Windows 10

OpenCV 3.0.0 (sources - latest - stable)

TBB (latest bin from official site)

OpenCV built with VS2015 with default CMAKE setting without "world" module and WITH_TBB, all TBB dirs set well to (.../ia32/vc12)

(For first look i thought that problem is that my opencv built without TBB, but TBB not help with denoising)

Resources:

  1. During execution CPU loaded up to 100% all cores (so multiprocessing in work)

  2. Uses up to 14 threads (so mutithreading is in work)

Is where way to fix this performance issue or it's real speed of denoising with OpenCV?

May be it's some issues with C++ settings my console app built (i'm from .net world and C++ is not so familiar for me)?

like image 370
comdiv Avatar asked Sep 26 '22 14:09

comdiv


1 Answers

Answer was simple - i was using Debug version of opencv (how it's usual for .net) but for C++ performance vary dramatically between Debug and Release configuration.

After remapping to Release build i have duration nearby 5s per image. It's not so fast i was expected but it's usable.

like image 52
comdiv Avatar answered Sep 29 '22 16:09

comdiv