[Pycodeocr-main] SF.net SVN: pycodeocr:[35] branches/laserb
Status: Beta
Brought to you by:
drtrigon
|
From: <la...@us...> - 2011-02-10 14:47:26
|
Revision: 35
http://pycodeocr.svn.sourceforge.net/pycodeocr/?rev=35&view=rev
Author: laserb
Date: 2011-02-10 14:47:19 +0000 (Thu, 10 Feb 2011)
Log Message:
-----------
Added Paths:
-----------
branches/laserb/README
branches/laserb/checksum.py
Added: branches/laserb/README
===================================================================
--- branches/laserb/README (rev 0)
+++ branches/laserb/README 2011-02-10 14:47:19 UTC (rev 35)
@@ -0,0 +1,149 @@
+#
+# This is the official homepage of PyCodeOCR; Turn your scanner into a free document
+# reader for invoices (e.g. for e-banking) with the help of tesseract-ocr available
+# for many unix (and also windows) platforms.
+#
+# This software is developed under linux (fedora).
+#
+# Search for:
+# * scanimage (SANE interface)
+# * convert (ImageMagick)
+# * tesseract-ocr
+# * Python Imaging Library (PIL)
+# * gocr
+# * libdmtx
+# * PDF417Decode.exe (by Morovia Corporation) through WINE
+# for further information.
+#
+#
+# ================================================================================
+# LICENCE
+#
+# The application uses SANE interface, ImageMagick, tesseract (and python) which
+# are used under their own licences, but the main script is Public Domain.
+#
+#
+# ================================================================================
+# DOWNLOAD
+#
+# Official releases from:
+# https://sourceforge.net/projects/pycodeocr/
+#
+# Browse SVN:
+# http://pycodeocr.svn.sourceforge.net/viewvc/pycodeocr/
+# Latest (most recent) copy from SVN:
+# svn co https://pycodeocr.svn.sourceforge.net/svnroot/pycodeocr pycodeocr
+# More info about SVN:
+# http://kb.gnuher.de/zzz_old_articles/various/HOWTO%20-%20SVN%20Kurzanleitung.txt
+#
+#
+# ================================================================================
+# INSTALLATION / SETUP
+#
+# 1. step: (obviously you have to download this code)
+#
+# 2. step: if not alread present on your system install 'python'
+#
+# 3. step: install needed pakages for python, here is the list, you need to get
+# the correct versions for your OS:
+# * scanimage (SANE interface)
+# * convert (ImageMagick)
+# * tesseract
+# http://code.google.com/p/tesseract-ocr/
+# (better would be to get the appropriate pakage for your distro)
+# * Python Imaging Library (PIL)
+# (AND SANE/PIL python bindings, in fedora e.g. 'python-imaging-sane')
+# * gocr
+# (self compiled or better get the appropriate pakage for your distro)
+# [ binary/executable has to be in same folder as the script ]
+# * libdmtx (you may have to compile this by yourself if it is not yet
+# in your OS package repository; essentially you have to get all depen-
+# dencies like 'ImageMagick-devel' for 'Wand' e.g., then compile it
+# according to ./INSTALL, configure, make and so on, then install the
+# python wrapper/bindings according to ./wrapper/python/README, and
+# last you may have to use 'export LD_LIBRARY_PATH=/usr/local/lib'
+# in shell to solve the "3.1. ImportError")
+# http://www.libdmtx.org/downloads.php
+# If you have installed libdmtx and it is still not working, then maybe
+# your pydmtx.py is not installed correctly. You should find it in
+# /usr/share/doc/libdmtx-dev/examples/python/ . Just follow the
+# instructions given there.
+# * PDF417Decode.exe (by Morovia Corporation)
+# WINE is used to run this propietary/commercial Windows App., since
+# it is free for private purposes.
+# http://forums.morovia.com/free-pdf417-decoder-pdf417decode-t231.html
+# [ binary/executable has to be in same folder as the script ]
+#
+# 4. step: run the script and enjoy the results and PLEASE report me any bugs or
+# problems
+#
+#
+# ================================================================================
+# ABOUT / INFO
+#
+# This script uses first the SANE scanner interface to scan a specific area (look
+# at 'Orientation hints' below for more info). Then ImageMagick is used to adjust
+# the data and TesserAct to do a proper OCR. Afterwards some fuzzy logic char re-
+# placement is used to correct any recognition errors. Finally a verification of
+# the retrieved code is performed and if successfull the code is pasted to clip-
+# board - ready for pasting into your e-banking web formular. Additionally a pre-
+# view of the scanned data is showed with the help of PIL. The GUI is cross plat-
+# form since it is GTK/glade.
+# Barcode support: gocr supports at least EAN128, EAN-8, EAN-13, may be others too
+# libdmtx support different kinds of DataMatrix barcode
+# and pdf417decoder supports PDF417 barcodes.
+# Confer also http://de.wikipedia.org/wiki/Strichcode as reference, the english one
+# http://en.wikipedia.org/wiki/Barcode was not yet checked.
+#
+#
+# Orientation hints:
+#
+# ^^ The text on your invoice to scan is ^^
+# ^^ oriented this way (but mirrored). ^^
+# ^^ And in the lower right corner is the ^^
+# ^^ code to scan: #### CODE #### ^^
+#
+# 0 deg (0°)
+# +---------------------------+
+# | |
+# | |
+# | >>>>>>|
+# | # |
+# | |
+# | >>>>>>|
+# +---------------------------+
+#
+# 90 deg (90°)
+# +---------------------------+
+# | |
+# | |
+# | |
+# | v # v|
+# | v v|
+# | v v|
+# +---------------------------+
+#
+# 180 deg (180°)
+# +---------------------------+
+# | |
+# | |
+# | <<<<<<|
+# | |
+# | # |
+# | <<<<<<|
+# +---------------------------+
+#
+# 270 deg (270°)
+# +---------------------------+
+# | |
+# | |
+# | |
+# | ^ ^|
+# | ^ ^|
+# | ^ # ^|
+# +---------------------------+
+#
+# If there is is any question or suggestion please contact me at sf.net, thanks!
+#
+
+
Added: branches/laserb/checksum.py
===================================================================
--- branches/laserb/checksum.py (rev 0)
+++ branches/laserb/checksum.py 2011-02-10 14:47:19 UTC (rev 35)
@@ -0,0 +1,19 @@
+## @file checksum.py
+# Modulo 10 checksum for e-banking codes
+class modulo10:
+ # thanks to http://www.hosang.ch/modulo10.aspx
+ # much more details http://www.sic.ch/de/dl_tkicch_dta.pdf ( page 51 )
+ # @see http://www.bundesbank.de/download/zahlungsverkehr/zv_pz201012.pdf
+ # @see http://www.bundesbank.de/zahlungsverkehr/zahlungsverkehr_pruefziffernberechnung.php
+ def __init__(self):
+ self.tabelle = [0,9,4,6,8,2,7,1,3,5]
+
+ def run(self,nr):
+ self.uebertrag = 0
+ # iterate over each character
+ for i in range(len(nr)):
+ self.uebertrag = self.tabelle[(self.uebertrag + int(nr[i]) )%10]
+
+ return (10-self.uebertrag)%10
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|