BackupGGCode / python-tesseract

python wrapper class for tesseract OCR (Linux & Mac & Windows)
3 stars 1 forks source link

Enhancement - Set OpenCV Image #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
For our project we need to combine OpenCV library and tesseract python 
bindings. So it seems more effective to set OpenCV image directly to tesseract 
instead of storing it into a file and let tesseract re-read it. 

Would it be possible to integrate following changes (included in the enclosed 
patch, the diff is made towards revision 95) into the python-tesseract project? 
I tested the patched changes under Ubuntu 11.04.

I also find out that shared tesseract library no longer names tesseract_api, so 
I also edited setup.py.

Original issue reported on code.google.com by hana.tru...@eccam.com on 1 Nov 2011 at 1:37

Attachments:

GoogleCodeExporter commented 9 years ago
Can't make it work
ImportError: /usr/local/lib/python2.7/dist-packages/_tesseract.so: undefined 
symbol: cvSetData

What is the version of opencv u are using?

thank u for your code anyway

Original comment by FreeT...@gmail.com on 3 Nov 2011 at 2:01

GoogleCodeExporter commented 9 years ago
Thanks for looking on my proposed enhancement! I'm using OpenCV 2.1.0 lib which 
is in the Ubuntu repositories.

Have you linked the _tesseract.so also with the OpenCV lib? I added cv as 
additional library in setup.py script, I thought it is sufficient... Perhaps it 
also needs a cxcore part 
(http://opencv.willowgarage.com/wiki/CompileOpenCVUsingLinux)?

Original comment by hana.tru...@eccam.com on 3 Nov 2011 at 7:16

GoogleCodeExporter commented 9 years ago
Tesseract-ocr is now included in the download list
http://code.google.com/p/python-tesseract/downloads/list

Original comment by FreeT...@gmail.com on 3 Feb 2012 at 4:19

GoogleCodeExporter commented 9 years ago

Original comment by FreeT...@gmail.com on 3 Feb 2012 at 4:24

GoogleCodeExporter commented 9 years ago
I tried this patch and it works great. Just a note: If you are running OpenCv2, 
all the references to the string "cv.iplimage" need to be changed to 
"cv2.cv.iplimage". But other than that, it works as advertised. Thanks to the 
OP.

Original comment by agho...@gmail.com on 7 Mar 2012 at 4:40

GoogleCodeExporter commented 9 years ago
I am confused. Why will need to include opencv2? Why not install python-opencv 
instead?

Original comment by FreeT...@gmail.com on 12 Apr 2012 at 3:16

GoogleCodeExporter commented 9 years ago
Updated ... 
http://python-tesseract.googlecode.com/files/python-tesseract_0.7-1.3_amd64.deb

Could you send me simple script on how to use your added functions/methods?

Many thanks 

Original comment by FreeT...@gmail.com on 12 Apr 2012 at 3:41

GoogleCodeExporter commented 9 years ago
This is an enhancement, not a defect.

Original comment by FreeT...@gmail.com on 12 Apr 2012 at 3:43

GoogleCodeExporter commented 9 years ago
Done!

Original comment by FreeT...@gmail.com on 19 Apr 2012 at 11:05