As the title says, I want to compare the different complexities of the algorithms I want to use to use in a performance analysis between different denoise methods.
The different methods I want to test is the following
guassianBlur()
medianBlur()
bilateralFilter()
fastNlMeansDenoisingColored()
And possible also some sharpening algorithms as well.
hi !
as it is said in this question sometimes open cv documentation is referring to some scientific articles with the complexity in it.
for gaussianBlur for example in this tutorial you can find a link to a scientific article (a lot of pages). But if you search for separable filtering (which is said to be used for the implementation of gaussian blurring) then you find that it takes O(kn^2) with k the size of the kernel and n the number of pixels on one side of the image (assuming that the image is a square N=n^2). For medianBlur(), open cv uses the Perreault and Herbert algorithm cited in the article which is time constant (O(1) per pixel) so the whole algorithm is O(n^2).
for bilateralFilter() it is said in the article that it is way slower than separable filtering. Not sure if opencv uses this particular algorithm, but in A Simple Trick to Speed Up and Improve
the Non-Local Means by Laurent Condat, gives a complexity of O(S^2P^sn^2) with S = 21 P= 7 with default settings in open cv.
it’s hard to find a precise answer for every algorithm but you can find it with the scientific article provided.
Best thing would be to check with the source code that this is the same algorithm that is implemented but this is very long work.
Hi thanks for the reply, am I right in understanding the scientific article is the following:
Computer Vision: Algorithms and Applications, 2nd ed
Also if possible it would be nice if you could link where it shows that opencv uses the Perreault and Herbert algorithm.
yes of course, here you can fine line 56 that they give the copyright of the algorithm to Perreault.
In this part of the repository here you can check the copyrights on every function.
Thanks I will try to look into the other algorithms as well.