Mentalix Application Note #10047
Sample Pixel!ENGINE OCR Script
Example 1: Convert faxes to text
#################################################################
# #
# This script can be used to convert faxes to text. You can #
# invoke the script with the command: #
# #
# engine ocrfax.tcl <image filename> #
# #
#################################################################
if {$argc >= 1} {
set ifile $argv
set img [image]
$img load $ifile
# If this is a low-resolution fax image, then it
# should be scaled to get the best OCR results.
if { ([$img getxres] == 204) && ([$img getyres] == 98) } {
set height [$img getheight]
set newheight [expr $height * 2]
$img scale [$img getwidth] $newheight
}
$img ocr /tmp/ocr.txt
} else {
puts "Usage: $argv0 <image file pathname>"
}
For additional information or assistance, please call Mentalix
Technical Support at (972) 423-9377 Ext. 33.
|