2D gaussian filter manual process??
Show older comments
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??
Answers (1)
Image Analyst
on 18 Jan 2014
0 votes
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 Image Filtering 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!