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

Method WordFontAttributes does not work #68

Closed
zikcheng opened this issue Aug 9, 2017 · 7 comments
Closed

Method WordFontAttributes does not work #68

zikcheng opened this issue Aug 9, 2017 · 7 comments

Comments

@zikcheng
Copy link

zikcheng commented Aug 9, 2017

Hi, I want to use method WordFontAttributes to get font information of recognized words, but I failed. The image is
test
and my code is

with PyTessBaseAPI() as api:
    api.SetImageFile('test.png')
    api.Recognize()
    iterator = api.GetIterator()
    print(iterator.WordFontAttributes())

It outputs None. Is there something wrong in my code?

@sirfz
Copy link
Owner

sirfz commented Aug 9, 2017

Have you tried different images? It worked on the image I tested on (try eurtext.tif).

@zikcheng
Copy link
Author

I tried my code on the eurotext.tif, but it still output None. Is the output result related with the environment?
The OS is Ubuntu 16.04, python version is 3.6.1, tesseract version is

tesseract 4.00.00alpha
 leptonica-1.74.4
  libjpeg 8d (libjpeg-turbo 1.4.2) : libpng 1.6.31 : libtiff 4.0.6 : zlib 1.2.8

, and tesserocr version is 2.2.2

@sirfz
Copy link
Owner

sirfz commented Aug 10, 2017

Did some further testing and found weird behavior. If I use the 4.00 tessdata, there are no font attributes returned for the image. However, if I use the 3.04.00 tessdata, font attributes are returned. You can bring this issue up with the tesseract team if you want to look into it.

In the mean time, I recommend you use the latest stable version (3.05.01) with the 3.04.00 tessdata.

@sirfz
Copy link
Owner

sirfz commented Aug 11, 2017

Closing this issue given it's tesseract-related.

@sirfz sirfz closed this as completed Aug 11, 2017
@NehaPandey58
Copy link

Method WordFontAttributes is not working for me also. I am using
tesseract 4.0.0-beta.1-270-g5a56
leptonica-1.74.4
libjpeg 6b : libpng 1.6.34 : zlib 1.2.11
Kindly help.

@kvdesai
Copy link

kvdesai commented May 5, 2019

I landed up here while trying to figure out how to determine FontSize using tesserocr.

The tesseract issue #1074 referenced above seems to have been fixed.
https://github.com/tesseract-ocr/tesseract/pull/1173/commits

However, with tesserocr the method WordFontAttributes is still returning None.
Following is my setup

Ubuntu 16.04, x64
Python 3.7.1

$ tesseract --version
tesseract 4.1.0-rc1-263-gb107
leptonica-1.78.0
libgif 5.1.4 : libjpeg 8d (libjpeg-turbo 1.4.2) : libpng 1.2.54 : libtiff 4.0.6 : zlib 1.2.8 : libwebp 0.4.4 : libopenjp2 2.3.0
Found SSE

tesserocr.__version__
2.4.0

Any suggestions to fix this, or a work around to determine Font Size and Is Bold?

@Jamxscape
Copy link

I landed up here while trying to figure out how to determine FontSize using tesserocr.

The tesseract issue #1074 referenced above seems to have been fixed.
https://github.com/tesseract-ocr/tesseract/pull/1173/commits

However, with tesserocr the method WordFontAttributes is still returning None.
Following is my setup

Ubuntu 16.04, x64
Python 3.7.1

$ tesseract --version
tesseract 4.1.0-rc1-263-gb107
leptonica-1.78.0
libgif 5.1.4 : libjpeg 8d (libjpeg-turbo 1.4.2) : libpng 1.2.54 : libtiff 4.0.6 : zlib 1.2.8 : libwebp 0.4.4 : libopenjp2 2.3.0
Found SSE

tesserocr.__version__
2.4.0

Any suggestions to fix this, or a work around to determine Font Size and Is Bold?

Have you ever solved this problem?I Use tesseract 4.1.1 and tessdata 4.0 It doesnot work also,and just return to None

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

No branches or pull requests

5 participants