Closed GoogleCodeExporter closed 8 years ago
[deleted comment]
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 swol...@gmail.com
on 10 Feb 2013 at 10:51
Attachments:
[deleted comment]
https://code.google.com/p/tesseract-ocr/issues/detail?id=852&thanks=852&ts=13605
82829
Original comment by FreeT...@gmail.com
on 11 Feb 2013 at 11:41
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 FreeT...@gmail.com
on 15 Feb 2013 at 10:34
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 swol...@gmail.com
on 25 Feb 2013 at 8:49
What is "the first problem" you have referred?
Original comment by FreeT...@gmail.com
on 25 Feb 2013 at 9:05
The one in the op, that running of test-slim failed at 'ProcessPagesRaw'.
Original comment by swol...@gmail.com
on 28 Feb 2013 at 2:59
Send me your ssh account and password tben
Original comment by FreeT...@gmail.com
on 28 Feb 2013 at 11:57
Original comment by FreeT...@gmail.com
on 25 Apr 2014 at 4:34
Original issue reported on code.google.com by
swol...@gmail.com
on 10 Feb 2013 at 7:11