Hough transform: Difference between revisions
m
→{{header|Perl}}: corrected read of existing image
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: corrected read of existing image) |
|||
Line 655:
$height = 2 * int $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
$img->read(file => 'ref/pentagon.png') or die "Cannot read: ", $img->errstr;
$ht->write(file => 'hough_transform.png');
</lang>
|