in reply to Re: Creating Heat Map in perl
in thread Creating Heat Map in perl
Hi,
Thanks for the reply, I am using below code, it is giving me following error.
Can't locate object method "Imager=HASH(0xfeeb4d0)" via package "Imager::Heatmap" at heatmap.pl line 28.
#!/usr/bin/perl -w use strict; #use warnings; use utf8; use XSLoader; use Carp; use Imager; use List::Util qw/ max /; use Imager; use Imager::Heatmap; my $hmap = Imager::Heatmap->new( xsize => 640, # Image width ysize => 480, # Image height xsigma => 10, # Sigma value of X-direction ysigma => 10, # Sigma value of Y-direction ); my @piont_datas = ( [ 10, 20, 50 ], [ 20, 40, 70 ] ); # Add point datas to construct density matrix $hmap->insert_datas(@piont_datas); # @point_datas should be: ( [ x1, y +1, weight1 ], [ x2, y2, weight2 ] ... ) #$hmap->insert_datas(...); # You can call multiple times to add large +data that cannot process at a time. # After adding datas, you could get heatmap as Imager instance. my $img = $hmap->draw; # Returned image is 4-channels image. So you can overlay it on other i +mages. my $base_img->rubthrough( src => $hmap->$img ); # Overlay on other im +ages(see Imager::Transformations) $img = Imager->new( xsize => $hmap->xsize, ysize => $hmap->ysize, channels => 4, ); # And you can access probability density matrix using matrix method if + you like. # In case, maybe you would like to create some graduations which be as +signed to color of heatmap and its value. $hmap->matrix;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Creating Heat Map in perl
by Corion (Patriarch) on Sep 04, 2013 at 07:11 UTC | |
Re^3: Creating Heat Map in perl
by space_monk (Chaplain) on Sep 04, 2013 at 10:16 UTC | |
by huzefa52 (Novice) on Sep 04, 2013 at 12:29 UTC | |
Re^3: Creating Heat Map in perl
by Mr. Muskrat (Canon) on Sep 04, 2013 at 22:22 UTC |
In Section
Seekers of Perl Wisdom