Hough transform: Difference between revisions

m
→‎{{header|Perl}}: corrected read of existing image
m (→‎{{header|Perl}}: corrected read of existing image)
Line 655:
$height = 2 * int $height/2;
$xsizeheight = 2 * int $im->getwidth()height/2;
my($xsize, $ysize) = ($im->getwidth, $im->getheight();
my $ht = Imager->new(xsize => $width, ysize => $height);
 
for my $i (0..$height-1) { for my $j (0..$width-1) { $canvas[$i][$j] = 255 } }
$ht = Imager->new(xsize => $width, ysize => $height);
for $i (0..$height) { for $j (0..$width) { $canvas[$i][$j] = 255 } }
 
$ht->box(filled => 1, color => 'white');
 
Line 683 ⟶ 681:
}
 
my $img = Imager->new(file => 'pentagon.png');
$img->read(file => 'ref/pentagon.png') or die "Cannot read: ", $img->errstr;
$ht = hough($img);
$ht->write(file => 'hough_transform.png');
</lang>
2,392

edits