function showStep(img, P, fullImg) if nargin < 3 fullImg = 0; end start = P(1, :); if fullImg detail = img; rs = 1; cs = 1; else winsize = 20; rs = start(1) - winsize; re = start(1) + winsize; cs = start(2) - winsize; ce = start(2) + winsize; detail = img(rs:re, cs:ce); end clf imagesc(detail) colormap gray axis image; axis off hold on a = start - [rs, cs] + 1; plot(a(2), a(1), '.') for k = 2:size(P, 1) b = P(k, :) - [rs, cs] + 1; plot(b(2), b(1), '.') plot([a(2) b(2)], [a(1) b(1)], '-') a = b; end set(gca, 'Position', [0 0 1 1])