Zhang-Suen thinning algorithm: Difference between revisions
Content added Content deleted
SqrtNegInf (talk | contribs) m (→{{header|Perl 6}}: removed DEBUG, in-lined source data) |
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: in-lined source 'image') |
||
Line 2,994: | Line 2,994: | ||
=={{header|Perl}}== |
=={{header|Perl}}== |
||
{{trans|Perl 6}} |
{{trans|Perl 6}} |
||
<lang perl>use List::Util qw(sum |
<lang perl>use List::Util qw(sum min); |
||
$source = <<'END'; |
|||
open $fh, '<', "zhang-suen.txt"; |
|||
............................................................ |
|||
while ($line = <$fh>) { |
|||
..#################...................#############......... |
|||
chomp $line; |
|||
..##################...............################......... |
|||
⚫ | |||
..###################............##################......... |
|||
..########.....#######..........###################......... |
|||
....######.....#######.........#######.......######......... |
|||
....######.....#######........#######....................... |
|||
....#################.........#######....................... |
|||
....################..........#######....................... |
|||
....#################.........#######....................... |
|||
....######.....#######........#######....................... |
|||
....######.....#######........#######....................... |
|||
....######.....#######.........#######.......######......... |
|||
..########.....#######..........###################......... |
|||
..########.....#######.######....##################.######.. |
|||
..########.....#######.######......################.######.. |
|||
..########.....#######.######.........#############.######.. |
|||
............................................................ |
|||
END |
|||
for $line (split "\n", $source) { |
|||
⚫ | |||
} |
} |
||