How the Gaussian Filter Algorithm Works in OpenCV

I am writing my own Gaussian filter, but it is very slow.

The OpenCV Gaussian algorithm runs much faster, 20 times, than my Gaussian filter. I want to rewrite the Gauss OpenCV algorithm in my project, and I don't want to include opencv in my project.

but

Can someone give me a description of the algorithm, opencv source code seems too difficult to understand?

+5
source share
5 answers

, : . , , , , ; , , .

, , , SIMD. SSE3, .

+12

, 3- , . Wikipedia , , , :

Kernel:               
[0 1 2 0 0
1 4 6 4 1      X   Iterate over every single pixel in the image
2 6 10 6 2
1 4 6 4 1
0 1 2 1 0]

( , , , , , )

, , . , NxM , ​​ - PxP. PPN * M. P, . , , .

. , , , , . Intel x86, , , , Intel (IPP) . IIRC, OpenCV IPP, ...

- , . , , , , .

+4

. , .

+2

​​ , , OpenCV (FFT).

+1

, , , . . , , - , , .

To answer a faster question - you want to know how OpenCV optimizes its code, which is a very technical and broad topic. I would venture to suggest that it uses assembly language and GPU-specific functions. I would start to learn the assembly and explore the CUDA package to take advantage of your GPU.

-1
source

All Articles