Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

# Multivariate Gaussian kernel in any derivative order 1.0

Date Added: September 02, 2013  |  Visits: 219

NDGAUSS: create ND gaussian kernel in any derivative order. g = ndgauss(hsize,sigma); [g,xi,yi,..] = ndgauss(hsize,sigma);Inputs: - hsize is N-length of kernel size. - sigma is N-length of standard deviations (gaussian widths).Outputs: - g is the kernel. The size of g is hsize(1) x hsize(2) x ... hsize(n). - [xi,yi,..] is the grid to create the kernel.Options:1. 'der', . Default is 0. The option must be in N-length array. Each defines which derivative order. Example: a. to create d^2G(x,y) / dxdy, then 'der' = [1 1]. b. to create d^2G(x,y) / dy^2, then 'der' = [0 2].2. 'normalize', 1 | 0. Default is 0. If this option is set to 1, the kernel will be divided by its sum that makes the sum of kernel is 1. Warning: gaussian derivative kernel may not be sum to 1, e.g., dG(x,y)/dxdy.NOTE: a hermite function is needed. See the requirement below for the link to this function.Examples:1. To create 33x33 2D gaussian kernel with different sigma: zi = ndgauss([33 33],[2*sqrt(2) 1.2]); imagesc(zi); colormap(gray); axis image;2. To create several 1D gaussian kernel in different derivative orders: leg = cell(1,5); for i=0:4 yi(:,i+1) = ndgauss(33,2*sqrt(2),'der',i); leg{i+1} = sprintf('g%d(x)',i); end plot(yi); legend(leg);3. To create 15x15 Laplacian of Gaussian of width 2: Lg = ndgauss([15 15],[2 2],'der',[2 0]) + ... ndgauss([15 15],[2 2],'der',[0 2]); figure; colormap(gray); subplot(1,2,1); imagesc(Lg); axis image; subplot(1,2,2); surf(Lg); axis vis3d;More info: http://suinotes.wordpress.com/2010/05/27/g...rivative-order/Authors: Avan Suinesiaputra - avan dot sp at gmail dot com. Fadillah Z Tala - fadil dot tala at gmail dot com.

 Requirements: No special requirements Platforms: Matlab Keyword: Cell,  I3d04,  Legendleg,  Legi,  Ndgauss Sqrt Deri,  Orders,  Plotyi,  Sprintfgdxi,  Yii Users rating: 0/10