
I = imread('q.jpg');
I = rgb2gray(I);
% figure,imshow(I)

x = imcomplement(I);
h = surf(double(x));
set(h, 'FaceColor', 'texturemap', 'EdgeColor', 'none')
colormap(copper)
xlim([0 85])

%%
hy = fspecial('sobel');
hx = hy';
Iy = imfilter(double(I), hy, 'replicate');
Ix = imfilter(double(I), hx, 'replicate');
g = sqrt(Ix.^2 + Iy.^2);

figure,
h = surf(double(g));
set(h, 'FaceColor', 'texturemap', 'EdgeColor', 'none')
colormap(copper)
xlim([0 85])

%%
img = im2bw(I, graythresh(I));
d = -bwdist(~img,'chessboard');

figure,
h = surf(double(d));
set(h, 'FaceColor', 'texturemap', 'EdgeColor', 'none')
colormap(copper)
xlim([0 85])




