Comments (10)
[deleted comment]
from python-tesseract.
Also, the attached bmp file can be parsed using this code:
print tesseract.ProcessPagesWrapper("p.bmp", _tessApi)
However, it fails if cv image is used:
image=cv.LoadImage("p.bmp", cv.CV_LOAD_IMAGE_GRAYSCALE)
tesseract.SetCvImage(image,_tessApi)
text=_tessApi.GetUTF8Text() # Prints 'Empty page!!' error message
conf=_tessApi.MeanTextConf()
print text, conf
What's the reason for that? Did I do something wrong?
Original comment by [email protected]
on 10 Feb 2013 at 10:51
Attachments:
from python-tesseract.
[deleted comment]
from python-tesseract.
https://code.google.com/p/tesseract-ocr/issues/detail?id=852&thanks=852&ts=13605
82829
Original comment by [email protected]
on 11 Feb 2013 at 11:41
from python-tesseract.
The problem aroused because you did not provide sufficient border for
tesseract. The following python program shall work
import cv2.cv as cv
import tesseract
image0=cv.LoadImage("p.bmp", cv.CV_LOAD_IMAGE_UNCHANGED)
print image0
offset=15
IPL_BORDER_REPLICATE=1
IPL_BORDER_CONSTANT=0
image=cv.CreateImage((image0.width+offset*2, image0.height+offset*2),
cv.IPL_DEPTH_8U, 3 )
cv.CopyMakeBorder(image0,image, (offset,offset), IPL_BORDER_CONSTANT,
(255,255,255))
cv.NamedWindow("Red Eye Test")
#cv.ShowImage("Red Eye Test", image)
#cv.WaitKey(0)
cv.DestroyWindow("Red Eye Test")
api = tesseract.TessBaseAPI()
api.Init(".","eng",tesseract.OEM_DEFAULT)
#api.SetPageSegMode(tesseract.PSM_SINGLE_WORD)
api.SetPageSegMode(tesseract.PSM_AUTO)
tesseract.SetCvImage(image,api)
text=api.GetUTF8Text()
conf=api.MeanTextConf()
image=None
print text
print conf
Original comment by [email protected]
on 15 Feb 2013 at 10:34
from python-tesseract.
Yeah, I kinda figured that problem out on myself. I added some border to the
picture and most of the 'Empty page' errors are gone, although there are still
a few images still can't be parsed no matter how wide the border I added. Maybe
it's a matter of the color of the border?
Anyway, what really makes me itchy is the first problem. Had anyone seen that
error before?
Original comment by [email protected]
on 25 Feb 2013 at 8:49
from python-tesseract.
What is "the first problem" you have referred?
Original comment by [email protected]
on 25 Feb 2013 at 9:05
from python-tesseract.
The one in the op, that running of test-slim failed at 'ProcessPagesRaw'.
Original comment by [email protected]
on 28 Feb 2013 at 2:59
from python-tesseract.
Send me your ssh account and password tben
Original comment by [email protected]
on 28 Feb 2013 at 11:57
from python-tesseract.
Original comment by [email protected]
on 25 Apr 2014 at 4:34
- Changed state: Done
from python-tesseract.
Related Issues (20)
- fails on python build HOT 5
- Import Error (DLL load failed: The specified module could not be found) HOT 18
- ..._tesseract.so: undefined symbol: _ZN9tesseract16TessTextRendererC1Ev HOT 4
- APP CRASH HOT 2
- Leptonica 1.71 breaks python-tesseract 0.9-0.3 HOT 5
- Python-tesseract on raspberry pi HOT 24
- 64bit crashes Python HOT 4
- Executing the #ri.BoundingBox(level,x1,y1,x2,y2) command for either words or characters
- Building on Centos 7: invalid conversion from ‘const Pix*’ to ‘Pix*’ HOT 9
- Parameter Requirment HOT 1
- self training combine multi-box HOT 1
- Memory leak HOT 3
- Will it be on PyPI? HOT 1
- import error on Mac OS X 10.9.5 HOT 13
- tesseract has no attribute pixRead HOT 10
- python-tesseract for python 3.x version windows 64b HOT 3
- Fails to compile on Ubuntu Trusty with OpenCV 3
- cvSetData error on import HOT 2
- Can't install on OSX
- python compatibility to win7 not avalaible in win7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-tesseract.