Image gradient
Write an m-file "grad.m" which computes and displays gradient and orientation of an input image (use Gaussian derivatives).
To compute Gaussian derivative in one dimension you need to perform differentiation in one dimension and smoothing in the other dimension.
( you have to compute 4 convolutions ).
function grad(imn,sigma)
gx=gauss_x(sigma);
g=gauss(sigma);
imgx=conv2(imn,gx);
imgxg=conv2(imgx,g');
figure(1);
imshow(imgxg,[]);
imgy=?
imgyg=?
figure(2);
imshow(imgyg,[]);
grad=?
figure(2);
imshow(grad,[]);
ori=atan2(imgyg,imgxg);
imshow(ori,[])
What the gradient represents in an image? What other kernels can be used to compute the gradient?