<P>你说的是不是这个函数?<BR><BR>%IGAUSS Gaussian smoothing kernel<BR>%<BR>% M = IGAUSS(W, SIGMA)<BR>%<BR>% Returns a W x W matrix with a unit amplitude Gaussian function of<BR>% standard deviation SIGMA. The Gaussian is centered within the matrix.<BR>%<BR>% SEE ALS ilog conv2<BR>%<BR>% Copyright (c) Peter Corke, 1999 Machine Vision Toolbox for Matlab</P>
<P><BR>% pic 10/96</P>
<P>function m = igauss(w, sigma)</P>
<P> ww = 2*w + 1;</P>
<P> [x,y] = meshgrid(-w:w, -w:w);</P>
<P> m = 1/(2*pi) * exp( -(x.^2 + y.^2)/2/sigma^2);</P>
<P> m = m / sum(sum(m));</P>