Anonymous user
Zhang-Suen thinning algorithm: Difference between revisions
m
→{{header|Mathematica}}
Line 995:
Partition[check[#[[1]], #[[2]], tmp, 2] & /@ i,
Dimensions[tmp][[2]]]];
FixedPoint[iter, dat]</lang>▼
Which results in:
(printMat is only defined to print an text output - the natural Mathemaica way would be to use ArrayPlot function, which create a graphic object which we can't paste into this wiki)
<pre>▼
printMat[mat_] :=
Line 1,001 ⟶ 1,008:
StringJoin, {"1" -> "#", "0" -> "."}];
▲FixedPoint[iter, dat]</lang>
▲<pre>
dat1 = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1,
|