my problem is :
---------------
$ ./ocr.pl
Background color at index 0 [0 0 0]
Finding bounds starting at 0
Character at (15, 102)-(21, 111)
Illegal division by zero at
/usr/local/share/perl/5.10.1/OCR/PerfectCR.pm line 250.
my solution is :
---------------
I edit file /usr/local/share/perl/5.10.1/OCR/PerfectCR.pm
I replace :
my $avgcolor = sprintf("%.0f", $totalcolor/$totalweight);
$avgcolor = undef if $totalweight < 1;
by :
my $avgcolor = 0;
if ($totalweight != 0)
{
$avgcolor = sprintf("%.0f", $totalcolor/$totalweight);
$avgcolor = undef if $totalweight < 1;
}
else
{
$avgcolor = sprintf("%.0f",0);
$avgcolor = undef if $totalweight < 1;
}
my script is :
---------------
#!/usr/bin/perl -w
use OCR::PerfectCR;
use GD;
my $recognizer = OCR::PerfectCR->new;
$recognizer->load_charmap_file("charmap");
my $image = GD::Image->new("image.png") or die "Can't open example.png: $!";
my $string = $recognizer->recognize($image);
$recognizer->save_charmap_file("charmap");
my version is :
---------------
cpan[2]> install OCR::PerfectCR
OCR::PerfectCR is up to date (0.03).