Family Day update
This commit is contained in:
parent
aac6731f2c
commit
9ad63ea473
2442 changed files with 39761 additions and 8255 deletions
8
Task/Image-convolution/Perl-6/image-convolution-1.pl6
Normal file
8
Task/Image-convolution/Perl-6/image-convolution-1.pl6
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
use PDL:from<Perl5>;
|
||||
use PDL::Image2D:from<Perl5>;
|
||||
|
||||
my $kernel = pdl [[-2, -1, 0],[-1, 1, 1], [0, 1, 2]]; # emboss
|
||||
|
||||
my $image = rpic 'frog.png';
|
||||
my $smoothed = conv2d $image, $kernel, {Boundary => 'Truncate'};
|
||||
wpic $smoothed, 'frog_convolution.png';
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
#!/usr/bin/env perl6
|
||||
|
||||
# Note: must install version from github NOT version from CPAN which needs to be updated.
|
||||
# Reference:
|
||||
# https://github.com/azawawi/perl6-magickwand
|
||||
# http://www.imagemagick.org/Usage/convolve/
|
||||
11
Task/Image-convolution/Perl/image-convolution.pl
Normal file
11
Task/Image-convolution/Perl/image-convolution.pl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
|
||||
use PDL;
|
||||
use PDL::Image2D;
|
||||
|
||||
my $kernel = pdl [[-2, -1, 0],[-1, 1, 1], [0, 1, 2]]; # emboss
|
||||
|
||||
my $image = rpic 'pythagoras_tree.png';
|
||||
my $smoothed = conv2d $image, $kernel, {Boundary => 'Truncate'};
|
||||
wpic $smoothed, 'pythagoras_convolution.png';
|
||||
Loading…
Add table
Add a link
Reference in a new issue