2D gaussian filter manual process??

조회 수: 3 (최근 30일)
nu
nu 2014년 1월 18일
답변: Image Analyst 2014년 1월 18일
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
nu
nu 2014년 1월 18일
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

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2014년 1월 18일
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.

Community Treasure Hunt

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

Start Hunting!

Translated by