pat1

clear
filename = 'test1_im3.jpg';
rgb = im2double(imread(filename));
g = rgb2gray(rgb);
imshow(g);
[cx cy c] = improfile();
pause();
hold on;
plot(cx,cy,'LineWidth',2);
hold off;
dist = sqrt((cx-cx(1)).^2+(cy-cy(1)).^2);
plot(dist,c);
xlabel('distance along profile (pixels)');
ylabel('relative gray level');
dc = [0; diff(c)];
plot(dist, dc);
xlabel('distance along profile (pixels)');
ylabel('\Delta g');