Gaussian derivatives
Generate Gaussian kernels for a given scale "sigma", and display the kernel.
The size of the kernel should be floor(3*sigm)+1;
(i) Write an m-file "gauss.m" which generates Gaussian kernel.
function G=gauss(sigm)
s=floor(3*sigm)+1;
x=[-s:s];
G = exp(-x.^2/(2*sigm^2));
G=G/sum(sum(G));
plot(?);
Why G has to be normalized?
(ii) write an m-file gauss_x.m which generates 1 order derivative of the Gaussian kernel.
function G=gauss_x(sigm)
s=floor(3*sigm)+1;
x=[-s:s];
G=?
(iii) Write an m-file gauss_xx.m which generates 2 order derivative of the Gaussian kernel.
function G=gauss_xx(sigm)
s=floor(3*sigm)+1;
x=[-s:s];
G=?
Observe Gaussian kernels for different sigma values.
Why the size of the kernel should be (3*sigm)+1 ?