NAME

Finance::MICR::GOCR - interface to using gocr for reading MICR line of a check image

DESCRIPTION

Ad hock module to inbetween with gocr Most of the work offered in this module is about coaxing gocr to read an image and detect a MICR line.

The output of this module itself is not genuinely useful without using

Finance::MICR::GOCR::Check

SYNOPSYS

my $gocr = new Finance::MICR::GOCR({
	abs_path => '/tmp/xmicr/micr/micr_image.pbm', 
});

print $gocr->out;

new()

my $gocr = new Finance::MICR::GOCR({
	abs_path => '/tmp/xmicr/micr/micr_image.pbm', 
	abs_gocr_bin => '/usr/local/bin/gocr', 
	abs_path_gocrdb => '/usr/share/micrdb/', 
	s => 80,
	d => 20,
	cleanup_string => 0,
});

Parameters to constructor Test the default values before experimenting.

abs_path

Required. This is the absolute path to the image that is the check. The image pbm file with micr code in it. The present filetypes for gocr are PNM, PGM, PBM, PPM, or PCX - depending on the version of gocr you have.

abs_gocr_bin

Optional. If provided, this is absolut path to the gocr binary if left out, we try to find with File::Which, if not found, dies.

abs_path_gocrdb

Defaults to '/usr/share/micrdb/' absolute path to the directory holding your micr database via the command line, the path must be set ending in backslash, the backslash can be used here or not

s

Optional. spacing, gocr space between characters. default value is 80. suggested is no more then 120. If your resolution is high, you would want this higher.

d

Optional. gocr dust size, default is 20 things smaller then this are ignored

cleanup_string

Optional. boolean, default is 1. more regexes to cleanup gocr garble.

METHODS

out()

Returns MICR line from gocr. This is not a verified MICR line. The out is cleaned up unless you set cleanup_string to 0 via constructor. returns undef if cannot get raw string.

abs_path()

returns absolute path to file being used if it is not on disk, croaks. If the file is not PNM, PGM, PBM, PPM, or PCX, croaks.

Some gocr parameters

abs_path_gocrdb()

returns absolute path to the database we are using for gocrdb set via constructor defaults to : /usr/share/micrdb/

abs_gocr_bin()

returns abs path to gocr binary being used

s()

returns gocr -s space between characters. default value is 80 if you provide a value, will set to that

d()

returns dust size if you provide a value, will set to that default is 20

cleanup_string()

returns true or false this is set via constructor argument if argument provided, will set

get_raw()

returns raw gocr output of the image file being used. this is with the parameters we've set, s, d, etc. Not entrirely raw.

DEBUG

The debug flag is

$Finance::MICR::GOCR::DEBUG = 1;

This is also an lvalue sub.

SEE ALSO

Finance::MICR::LineParser

gocr manual

AUTHOR

Leo Charre leocharre at cpan dot org

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 64:

Unknown directive: =over4

Around line 66:

'=item' outside of any '=over'