% file:      	two_d_filter_ex.m, (c) Matthew Roughan, Sat Aug 21 2004
%
image1 = 'james.png';
[i1,map1] = imread(image1, 'png');
V = [[-1 -2 -1];[0 0 0];[1 2 1]];
H = [[-1 0 1];[-2 0 2];[-1 0 1]];
Dh = filter2(H, i1, 'same');
Dv = filter2(V, i1, 'same');

figure(100)
subplot(1,2,1)
image(i1, 'CDataMapping', 'scaled');

subplot(1,2,2)
theta = -pi/3;
emboss_image = (Dh*cos(theta) + Dv*sin(theta));
image(emboss_image, 'CDataMapping', 'scaled');
opts = struct('height',10, 'Color', 'bw');
exportfig(gcf,'Plots/2d_filter_emboss.eps', opts, 'color', 'gray');
