- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page