Optimization of mathematical morphology functions of OpenCV
Greetings.
I am currently working on a project with Qt (SDK 1.2.1) and OpenCV (2.2.0) under Windows 7.
I recently presented a problem that I think is complex (or at least more complex than those faced so far) and as I do not wear long time to be working with Qt + OpenCV (I'm still a novice at both libraries), I'm not sure how solve or rather, what are my possible tools to solve it. We next sought to explain:
In my project I'm working mainly with mathematical morphology functions of OpenCV (erosion, dilation, opening, ect.). The images digital I'm working with are images of histological samples of breast tissue (on these images apply morphological operations); these images in particular are quite large, about 4000 * 3000 pixels, and consequently the calculation time of the operations morphological is very long ... eg:
- Do dilatation with 20 iterations and a rectangular structuring element of 3 * 3 takes about 7 seconds.
- Make opening with 10 iterations and an elliptical structuring element of 15 * 15 is about 5 minutes.
So, my specific question is that do TO REDUCE THE TIME it takes to apply the different morphological operations. I thought about using parallelization (multithreaded programming), but I have several questions in the following areas:
- Is it possible with OpenCV parallelization, since I think I must own routines parallelize the OpenCV (erosion, dilation, ect.)?
- What tasks should be parallelized and how?
- What parallelization library use?
To the last question I've read in some places (including the page OpenCV) on TBB, but I do not entirely clear what exactly is TBB?, and how it works and/or use?.
Is the TBB library as Pthreads or OpenMP parallelization?, Ie, do I have to schedule myself/encode parallelized manually as tasks (with all that that implies)?
or, conversely ... Does the parallelization is automatic and transparent? ... as I understand it.
Thanks in advance for any help and / or suggestions.