python-tesseract is independent project - we can not modified it.

Anyway you can use tesseract 3.02.02 in python via ctypes - see example[1]

[1]
https://code.google.com/p/tesseract-ocr/source/browse/trunk/contrib/tesseract-c_api-demo.py?r=903

Zdenko


On Wed, Nov 20, 2013 at 10:30 AM, 007 <[email protected]> wrote:

> Please help in resolving import of tesseract
>
> What steps will reproduce the problem?
> 1. Install tesseract-ocr, leptonica-1.69 and python-tesseract from source
> 2. import tesseract from script
> 3. Also readText method from simplecv fails with " SimpleCV:2: 'Please
> install the correct OCR library required -
> http://code.google.com/p/tesseract-ocr/
> http://code.google.com/p/python-tesseract/'
>
> What is the expected output? What do you see instead?
> script should be able to import tesseract
>
> What version of the product are you using? On what operating system?
> Fedora18
> tesseract-ocr, leptonica-1.69 and python-tesseract from source
>
> Please provide any additional information below.
>
> --------------------------------------------------------------------------------------------------
> [root@localhost amzn_aiv]# find / -name tesseract.py*
> /home/amzn_aiv/python-tesseract/tesseract.pyc
> /home/amzn_aiv/python-tesseract/build/lib.linux-x86_64-2.7/tesseract.py
>
> /home/amzn_aiv/python-tesseract/debian/python-tesseract/usr/share/pyshared/tesseract.py
> /home/amzn_aiv/python-tesseract/tesseract.py
> /home/amzn_aiv/python-tesseract/test-slim/dlls/tesseract.py
>
> /home/amzn_aiv/.local/lib/python2.7/site-packages/python_tesseract-tesseract-py2.7-linux-x86_64.egg/tesseract.pyc
>
> /home/amzn_aiv/.local/lib/python2.7/site-packages/python_tesseract-tesseract-py2.7-linux-x86_64.egg/tesseract.py
> ===========================================================
> [root@localhost amzn_aiv]# export
> PYTHONPATH=/home/amzn_aiv/.local/lib/python2.7/site-packages/python_tesseract-tesseract-py2.7-linux-x86_64.egg/
> ==========================================================
> [root@localhost amzn_aiv]# cat ex.py
> import tesseract
> api = tesseract.TessBaseAPI()
> api.Init(".","eng",tesseract.OEM_DEFAULT)
> api.SetVariable("tessedit_char_whitelist",
> "0123456789abcdefghijklmnopqrstuvwxyz")
> api.SetPageSegMode(tesseract.PSM_AUTO)
>
> mImgFile = "eurotext.jpg"
> mBuffer=open(mImgFile,"rb").read()
> result = tesseract.ProcessPagesBuffer(mBuffer,len(mBuffer),api)
> print "result(ProcessPagesBuffer)=",result
> =========================================================
> [root@localhost amzn_aiv]# python ex.py
> Traceback (most recent call last):
>   File "ex.py", line 1, in <module>
>     import tesseract
>   File
> "/home/amzn_aiv/.local/lib/python2.7/site-packages/python_tesseract-tesseract-py2.7-linux-x86_64.egg/tesseract.py",
> line 26, in <module>
>     _tesseract = swig_import_helper()
>   File
> "/home/amzn_aiv/.local/lib/python2.7/site-packages/python_tesseract-tesseract-py2.7-linux-x86_64.egg/tesseract.py",
> line 22, in swig_import_helper
>     _mod = imp.load_module('_tesseract', fp, pathname, description)
> *ImportError:
> /home/amzn_aiv/.local/lib/python2.7/site-packages/python_tesseract-tesseract-py2.7-linux-x86_64.egg/_tesseract.so:
> undefined symbol:
> _ZN9tesseract11TessBaseAPI14NormalizeTBLOBEP5TBLOBP3ROWbP6DENORM*
> ====================================================
>
>
> Installation logs
> ---------------------------
>
> Install SimpleCV
> -----------------
>  sudo yum -y install python-ipython opencv-python scipy numpy pygame
> python-setuptools python-pip
>  sudo python-pip install
> https://github.com/sightmachine/SimpleCV/zipball/develop
>
> Compile leptonica
> ------------------
> wget http://www.leptonica.com/source/leptonica-1.69.tar.gz
> tar zxvf leptonica-1.69.tar.gz
> cd leptonica-1.69
> yum install giflib-devel libtiff-devel zlib-devel libpng-devel
> libjpeg-turbo-devel python-devel -y
> ./configure --prefix=/usr
> make
> sudo make install
>
> Compile Tesseract OCR
> ----------------------
> svn checkout http://tesseract-ocr.googlecode.com/svn/trunk/ tesseract-ocr
> ./configure --prefix=/usr
> make
> make install
>
> Compile Python-Tesseract
> ------------------------
> svn checkout http://python-tesseract.googlecode.com/svn/trunk/python-tesseract
> cd python-tesseract
> python config.py
> python setup.py clean
> python setup.py build
> python setup.py install --user
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "tesseract-ocr" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/tesseract-ocr?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "tesseract-ocr" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "tesseract-ocr" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tesseract-ocr?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to