2D gaussian filter manual process??

2 views (last 30 days)
nu
nu on 18 Jan 2014
Answered: Image Analyst on 18 Jan 2014
i have image resolution 585x564 pixel and i want to processed with 2d gaussian filter. and i found some code..
function h = Gaussian2D(hsize, sigma)
n1 = hsize; n2 = hsize;
for i = 1 : n2
for j = 1 : n1
% size is 10;
% -5<center<5 area is covered.
c = [j-(n1+1)/2 i-(n2+1)/2]';
% A product of both axes is 2D Gaussian filtering
h(i,j) = Gauss(c(1), sigma)*Gauss(c(2), sigma);
end
end
end
i guest sigma is standard deviation of gaussian distribution. but i dont know what is hsize is?? and the standard deviation,how i can define value for standard deviation??
  1 Comment
nu
nu on 18 Jan 2014
for the Gauss function.
function Gaussian_filtered = Gauss(image_x, sigma) % for single axis % http://en.wikipedia.org/wiki/Gaussian_filter Gaussian_filtered = exp(-image_x^2/(2*sigma^2)) / (sigma*sqrt(2*pi)); end

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 18 Jan 2014
hsize is the window size. You can have a window of a certain size, and the spread of the Gaussian within that can be anything. I can be really narrow Gaussian so that it completely fits in the window (the filter array), or it can be a really wide Gaussian where the tails get lost because they extend outside the window.

Categories

Find more on Audio Processing Algorithm Design in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!