Skip to content

Commit 15f9233

Browse files
committed
Image/geodesicDistanceMap.m: update doc
1 parent 7da853e commit 15f9233

File tree

1 file changed

+12
-23
lines changed

1 file changed

+12
-23
lines changed

src/@Image/geodesicDistanceMap.m

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -40,36 +40,25 @@
4040
% Displays info on iterations.
4141
%
4242
% Example
43-
% % computes distance function inside a complex particle
43+
% % computes distance function inside a complex particle
4444
% mask = Image.read('circles.png');
4545
% marker = Image.false(size(mask));
4646
% marker(80, 80) = 1;
4747
% % compute using quasi-enclidean weights
4848
% dist = geodesicDistanceMap(marker, mask);
49-
% figure; imshow(dist, []);
50-
% colormap(jet); title('Quasi-euclidean distance');
51-
% % compute using integer weights, giving integer results
52-
% dist34 = geodesicDistanceMap(marker, mask, int16([3 4]));
53-
% figure; imshow(double(dist34)/3, [0 max(dist34(mask))/3]);
54-
% colormap(jet); title('Borgefors 3-4 weights');
49+
% figure; show(double2rgb(dist));
50+
% title('Geodesic distance map');
5551
%
52+
% % compute the same distance map but using integer weights, giving
53+
% % integer results.
54+
% dist34 = geodesicDistanceMap(marker, mask, int16([3 4]));
55+
% % convert to double, taking into account values out of mask
56+
% dist34 = double(dist34) / 3;
57+
% dist34(~mask) = inf;
58+
% % display result
59+
% rgb = double2rgb(dist34);
60+
% figure; show(rgb); title('Geodesic distance map, integer weights');
5661
%
57-
% % uses the examples from bwdist with different distances
58-
% img = ones(255, 255);
59-
% img(126, 126) = 0;
60-
% res1 = geodesicDistanceMap(img);
61-
% res2 = geodesicDistanceMap(img, [1 inf]);
62-
% res3 = geodesicDistanceMap(img, [1 1]);
63-
% res4 = geodesicDistanceMap(img, [1 1.5]);
64-
% figure;
65-
% subplot(221); subimage(mat2gray(res1));
66-
% hold on; imcontour(res1); title('quasi-euclidean');
67-
% subplot(222); subimage(mat2gray(res2));
68-
% hold on; imcontour(res2); title('city-block');
69-
% subplot(223); subimage(mat2gray(res3));
70-
% hold on; imcontour(res3); title('chessboard');
71-
% subplot(224); subimage(mat2gray(res4));
72-
% hold on; imcontour(res4); title('approx euclidean');
7362
%
7463
% The function uses scanning algorithm. Each iteration consists in a
7564
% sequence of a forward and a backward scan. Iterations stop when

0 commit comments

Comments
 (0)