Mageia Bugzilla – Attachment 10834 Details for
Bug 24459
OCR badly done with xsane and tesseract : to be OK it needs a little Perl script
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
script to use tesseract with xsane
xsane2tess.pl (text/plain), 656 bytes, created by
Philippe Didier
on 2019-03-03 21:32:06 CET
(
hide
)
Description:
script to use tesseract with xsane
Filename:
MIME Type:
Creator:
Philippe Didier
Created:
2019-03-03 21:32:06 CET
Size:
656 bytes
patch
obsolete
>#! /usr/bin/perl -w > >use strict; >use Getopt::Long; > >my $logfile = "/tmp/tesseract.log"; >my $lang; >my $inputfile; >my $outputfile; > >GetOptions ('log=s' => \$logfile, > 'l=s' => \$lang, > 'i=s' => \$inputfile, > 'o=s' => \$outputfile > ); > >open (LOG,"> $logfile") or die "Error Opening log file $logfile\n"; > >print LOG "Xsane to Tesseract by EquinoxeFR\n"; >print LOG "-i $inputfile\n"; >print LOG "-o $outputfile\n"; >print LOG "-l $lang\n"; > >print LOG `convert "$inputfile" -compress none "${outputfile}.tif"`; >print LOG `tesseract "${outputfile}.tif" "${outputfile}" -l $lang`; > >unlink( "${outputfile}.tif"); >unlink( "${outputfile}"); > >close(LOG);
#! /usr/bin/perl -w use strict; use Getopt::Long; my $logfile = "/tmp/tesseract.log"; my $lang; my $inputfile; my $outputfile; GetOptions ('log=s' => \$logfile, 'l=s' => \$lang, 'i=s' => \$inputfile, 'o=s' => \$outputfile ); open (LOG,"> $logfile") or die "Error Opening log file $logfile\n"; print LOG "Xsane to Tesseract by EquinoxeFR\n"; print LOG "-i $inputfile\n"; print LOG "-o $outputfile\n"; print LOG "-l $lang\n"; print LOG `convert "$inputfile" -compress none "${outputfile}.tif"`; print LOG `tesseract "${outputfile}.tif" "${outputfile}" -l $lang`; unlink( "${outputfile}.tif"); unlink( "${outputfile}"); close(LOG);
View Attachment As Raw
Actions:
View
Attachments on
bug 24459
: 10834