Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'module' object has no attribute 'SetCvImage' #44

Closed
GoogleCodeExporter opened this issue May 29, 2015 · 7 comments
Closed

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

1. Installing python-tesseract-0.8-1.7_20130612_.macosx-10.8-x86_64 using the 
instructions from the wiki on an Mac OS X system that has opencv and tesseract 
(+ other dependencies) installed.

What is the expected output? What do you see instead?

Upon running a test file:

import cv2.cv as cv
import tesseract

api = tesseract.TessBaseAPI()
api.Init(".","eng",tesseract.OEM_DEFAULT)
api.SetPageSegMode(tesseract.PSM_AUTO)

image=cv.LoadImage("eurotext.jpg", cv.CV_LOAD_IMAGE_GRAYSCALE)
tesseract.SetCvImage(image)
text=api.GetUTF8Text()
conf=api.MeanTextConf()

The compiler produces an error indicating a missing method:
AttributeError: 'module' object has no attribute 'SetCvImage'

Therefore there's something wrong with the installation?

What version of the product are you using? On what operating system?

python-tesseract-0.8-1.7_20130612_.macosx-10.8-x86_64 on OS X 10.6.8 and Python 
2.7.5 with supposedly the correct dependencies installed.


Original issue reported on code.google.com by matti.v....@gmail.com on 29 Jun 2013 at 8:28

@GoogleCodeExporter
Copy link
Author

The line: tesseract.SetCvImage(image)
Should obviously be: tesseract.SetCvImage(image, api)

The problem persists though.

Original comment by matti.v....@gmail.com on 29 Jun 2013 at 8:50

@GoogleCodeExporter
Copy link
Author

How about installing the svn version?


svn checkout http://python-tesseract.googlecode.com/svn/trunk/ python-tesseract
cd python-tesseract
python setup.py clean
python setup.py build
python setup.py install --user
export PYTHONPATH="/usr/local/lib/python2.7/site-packages:$PYTHONPATH"
python test.py

Original comment by FreeT...@gmail.com on 30 Jun 2013 at 3:36

@GoogleCodeExporter
Copy link
Author

you might need to rebuild opencv first. It is broken lately

brew tap homebrew/science
brew install opencv

Original comment by FreeT...@gmail.com on 30 Jun 2013 at 4:29

@GoogleCodeExporter
Copy link
Author

Reinstalled everything starting from brewed Python 2.7.5 and proceeding to 
install all libraries. Upon installing python-tesseract from the svn source, 
the problem persists.

Original comment by matti.v....@gmail.com on 30 Jun 2013 at 7:38

@GoogleCodeExporter
Copy link
Author

Contents of python-tesseract module in my system:

Original comment by matti.v....@gmail.com on 30 Jun 2013 at 7:47

Attachments:

@GoogleCodeExporter
Copy link
Author

If your IOS is version 10.8.5, it shall work. 

Original comment by FreeT...@gmail.com on 10 Nov 2013 at 3:46

@GoogleCodeExporter
Copy link
Author

Original comment by FreeT...@gmail.com on 9 May 2014 at 7:52

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant