Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

IPP Gaussian function

Masilamani__Sujitha
547 Views

I'm trying to implement C version of  function as 1D convolution filters. With the help of Intel IPP document, I got to know the 5x5 2D kernel coefficients with sigma/standard deviation used for this function is 

2/571 7/571 12/571 7/571 2/571
7/571 31/571 52/571 31/571 7/571
12/571 52/571 127/571 52/571 12/571
7/571 31/571 52/571 31/571 7/571
2/571 7/571 12/571 7/571 2/571

I tried generating and using various 1D kernel coefficients with same sigma (1.0) value. But still the outputs are differing. I would like to know the 1D kernel coefficients for the above 2D kernel.

Please let me know how to generate it.

Thanks in advance.

0 Kudos
2 Replies
Igor_A_Intel
Employee
547 Views

Hi Sujitha,

you can use Matlab for this purpose, or calculate coefficients manually:

sigma = 1;
sz = 5;    % length of gaussian Filter vector
x = linspace(-sz / 2, sz / 2, sz);
gFilter = exp(-x .^ 2 / (2 * sigma ^ 2));
gFilter = gFilter / sum (gFilter); % normalization

regards, Igor

0 Kudos
Masilamani__Sujitha
547 Views

Thanks Igor.

I could generate 1D kernel coefficients for gaussian with the above formula and it matches with ippi output. But in the ippi doc, the formula to generate 1D gaussian seperable filter kernel looks different.

https://software.intel.com/en-us/ipp-dev-reference-thresholdadaptivegauss

Gi = A * exp( - (i-(maskSize.width-1)/2)2)/(0.5 * sigma2)

It is (0.5 * sigma^2)  here. Is it a typo?

0 Kudos
Reply