What Ever I Code

March 24, 2008

Genrating Gaussian Mask

Filed under: matlab, probability — Tags: , , , , — mohsenam @ 5:33 am

Matlab file for the Gaussian Mask

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function mask =gaussMask(stdIn)
varIn = stdIn*stdIn;
T = 0.1;
halfSize = round(sqrt(-2*log(T)*varIn))
[x y] = meshgrid(-halfSize:halfSize, -halfSize:halfSize);

mask = (1/(2*pi*varIn))*exp(-0.5*(x.^2 + y.^2)/varIn);
weight = sum(sum(mask));

mask = mask./weight;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.